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.

44462 lines
1.6 MiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["DataSet"] = factory();
else
root["DataSet"] = factory();
})(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 = "./src/index.ts");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/_@antv_hierarchy@0.6.6@@antv/hierarchy/build/hierarchy.js":
/*!********************************************************************************!*\
!*** ./node_modules/_@antv_hierarchy@0.6.6@@antv/hierarchy/build/hierarchy.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
module.exports = factory();
else {}
})(typeof self !== 'undefined' ? self : this, 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, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // 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 = 31);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
/* harmony default export */ __webpack_exports__["a"] = (function (value) {
return Array.isArray ? Array.isArray(value) : Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(value, 'Array');
});
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var isArrayLike = function (value) {
/**
* isArrayLike([1, 2, 3]) => true
* isArrayLike(document.body.children) => true
* isArrayLike('abc') => true
* isArrayLike(Function) => false
*/
return value !== null && typeof value !== 'function' && isFinite(value.length);
};
/* harmony default export */ __webpack_exports__["a"] = (isArrayLike);
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_object__ = __webpack_require__(13);
function each(elements, func) {
if (!elements) {
return;
}
var rst;
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(elements)) {
for (var i = 0, len = elements.length; i < len; i++) {
rst = func(elements[i], i);
if (rst === false) {
break;
}
}
} else if (Object(__WEBPACK_IMPORTED_MODULE_1__is_object__["a" /* default */])(elements)) {
for (var k in elements) {
if (elements.hasOwnProperty(k)) {
rst = func(elements[k], k);
if (rst === false) {
break;
}
}
}
}
}
/* harmony default export */ __webpack_exports__["a"] = (each);
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
/**
* 是否为函数
* @param {*} fn 对象
* @return {Boolean} 是否函数
*/
/* harmony default export */ __webpack_exports__["a"] = (function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(value, 'Function');
});
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var toString = {}.toString;
var isType = function (value, type) {
return toString.call(value) === '[object ' + type + ']';
};
/* harmony default export */ __webpack_exports__["a"] = (isType);
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
/**
* 判断是否数字
* @return {Boolean} 是否数字
*/
var isNumber = function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(value, 'Number');
};
/* harmony default export */ __webpack_exports__["a"] = (isNumber);
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// isFinite,
var isNil = function (value) {
/**
* isNil(null) => true
* isNil() => true
*/
return value === null || value === undefined;
};
/* harmony default export */ __webpack_exports__["a"] = (isNil);
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
var _require = __webpack_require__(33),
mix = _require.mix;
module.exports = {
assign: mix
};
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
/* harmony default export */ __webpack_exports__["a"] = (function (str) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(str, 'String');
});
/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object_like__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_type__ = __webpack_require__(4);
var isPlainObject = function (value) {
/**
* isObjectLike(new Foo) => false
* isObjectLike([1, 2, 3]) => false
* isObjectLike({ x: 0, y: 0 }) => true
* isObjectLike(Object.create(null)) => true
*/
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__["a" /* default */])(value) || !Object(__WEBPACK_IMPORTED_MODULE_1__is_type__["a" /* default */])(value, 'Object')) {
return false;
}
if (Object.getPrototypeOf(value) === null) {
return true;
}
var proto = value;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(value) === proto;
};
/* harmony default export */ __webpack_exports__["a"] = (isPlainObject);
/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);
/* harmony default export */ __webpack_exports__["a"] = (function (value) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__["a" /* default */])(value)) return '';
return value.toString();
});
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var hierarchy = __webpack_require__(18);
var Layout = /*#__PURE__*/function () {
function Layout(root, options) {
if (options === void 0) {
options = {};
}
var me = this;
me.options = options;
me.rootNode = hierarchy(root, options);
}
var _proto = Layout.prototype;
_proto.execute = function execute() {
throw new Error('please override this method');
};
return Layout;
}();
module.exports = Layout;
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);
var contains = function (arr, value) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__["a" /* default */])(arr)) {
return false;
}
return arr.indexOf(value) > -1;
};
/* harmony default export */ __webpack_exports__["a"] = (contains);
/***/ }),
/* 13 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = (function (value) {
/**
* isObject({}) => true
* isObject([1, 2, 3]) => true
* isObject(Function) => true
* isObject(null) => false
*/
var type = typeof value;
return value !== null && type === 'object' || type === 'function';
});
/***/ }),
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);
var filter = function (arr, func) {
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__["a" /* default */])(arr)) {
return arr;
}
var result = [];
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(arr, function (value, index) {
if (func(value, index)) {
result.push(value);
}
});
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (filter);
/***/ }),
/* 15 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var isObjectLike = function (value) {
/**
* isObjectLike({}) => true
* isObjectLike([1, 2, 3]) => true
* isObjectLike(Function) => false
* isObjectLike(null) => false
*/
return typeof value === 'object' && value !== null;
};
/* harmony default export */ __webpack_exports__["a"] = (isObjectLike);
/***/ }),
/* 16 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = mix;
// FIXME: Mutable param should be forbidden in static lang.
function _mix(dist, obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {
dist[key] = obj[key];
}
}
}
function mix(dist, src1, src2, src3) {
if (src1) _mix(dist, src1);
if (src2) _mix(dist, src2);
if (src3) _mix(dist, src3);
return dist;
}
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var separateTree = __webpack_require__(30);
var VALID_DIRECTIONS = ['LR', // left to right
'RL', // right to left
'TB', // top to bottom
'BT', // bottom to top
'H', // horizontal
'V' // vertical
];
var HORIZONTAL_DIRECTIONS = ['LR', 'RL', 'H'];
var isHorizontal = function isHorizontal(direction) {
return HORIZONTAL_DIRECTIONS.indexOf(direction) > -1;
};
var DEFAULT_DIRECTION = VALID_DIRECTIONS[0];
module.exports = function (root, options, layoutAlgrithm) {
var direction = options.direction || DEFAULT_DIRECTION;
options.isHorizontal = isHorizontal(direction);
if (direction && VALID_DIRECTIONS.indexOf(direction) === -1) {
throw new TypeError("Invalid direction: " + direction);
}
if (direction === VALID_DIRECTIONS[0]) {
// LR
layoutAlgrithm(root, options);
} else if (direction === VALID_DIRECTIONS[1]) {
// RL
layoutAlgrithm(root, options);
root.right2left();
} else if (direction === VALID_DIRECTIONS[2]) {
// TB
layoutAlgrithm(root, options);
} else if (direction === VALID_DIRECTIONS[3]) {
// BT
layoutAlgrithm(root, options);
root.bottom2top();
} else if (direction === VALID_DIRECTIONS[4] || direction === VALID_DIRECTIONS[5]) {
// H or V
// separate into left and right trees
var _separateTree = separateTree(root, options),
left = _separateTree.left,
right = _separateTree.right; // do layout for left and right trees
layoutAlgrithm(left, options);
layoutAlgrithm(right, options);
options.isHorizontal ? left.right2left() : left.bottom2top(); // combine left and right trees
right.translate(left.x - right.x, left.y - right.y); // translate root
root.x = left.x;
root.y = right.y;
var bb = root.getBoundingBox();
if (options.isHorizontal) {
if (bb.top < 0) {
root.translate(0, -bb.top);
}
} else {
if (bb.left < 0) {
root.translate(-bb.left, 0);
}
}
} // fixed root position, default value is true
var fixedRoot = options.fixedRoot;
if (fixedRoot === undefined) fixedRoot = true;
if (fixedRoot) {
root.translate(-(root.x + root.width / 2 + root.hgap), -(root.y + root.height / 2 + root.vgap));
}
return root;
};
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
/* eslint-disable no-cond-assign */
var util = __webpack_require__(7);
var PEM = 18;
var DEFAULT_HEIGHT = PEM * 2;
var DEFAULT_GAP = PEM;
var DEFAULT_OPTIONS = {
getId: function getId(d) {
return d.id || d.name;
},
getHGap: function getHGap(d) {
return d.hgap || DEFAULT_GAP;
},
getVGap: function getVGap(d) {
return d.vgap || DEFAULT_GAP;
},
getChildren: function getChildren(d) {
return d.children;
},
getHeight: function getHeight(d) {
return d.height || DEFAULT_HEIGHT;
},
getWidth: function getWidth(d) {
var label = d.label || ' ';
return d.width || label.split('').length * PEM; // FIXME DO NOT get width like this
}
};
function Node(data, options) {
var me = this;
me.vgap = me.hgap = 0;
if (data instanceof Node) return data;
me.data = data;
/*
* Gaps: filling space between nodes
* (x, y) ----------------------
* | vgap |
* | -------------------- h
* | h | | e
* | g | | i
* | a | | g
* | p | | h
* | --------------------- t
* | |
* -----------width------------
*/
var hgap = options.getHGap(data);
var vgap = options.getVGap(data);
me.width = options.getWidth(data);
me.height = options.getHeight(data);
me.id = options.getId(data);
me.x = me.y = 0;
me.depth = 0;
if (!me.children) {
me.children = [];
}
me.addGap(hgap, vgap);
return me;
}
util.assign(Node.prototype, {
isRoot: function isRoot() {
return this.depth === 0;
},
isLeaf: function isLeaf() {
return this.children.length === 0;
},
addGap: function addGap(hgap, vgap) {
var me = this;
me.hgap += hgap;
me.vgap += vgap;
me.width += 2 * hgap;
me.height += 2 * vgap;
},
eachNode: function eachNode(callback) {
// Depth First traverse
var me = this;
var nodes = [me];
var current;
while (current = nodes.shift()) {
callback(current);
nodes = current.children.concat(nodes);
}
},
DFTraverse: function DFTraverse(callback) {
// Depth First traverse
this.eachNode(callback);
},
BFTraverse: function BFTraverse(callback) {
// Breadth First traverse
var me = this;
var nodes = [me];
var current;
while (current = nodes.shift()) {
callback(current);
nodes = nodes.concat(current.children);
}
},
getBoundingBox: function getBoundingBox() {
// BBox for just one tree node
var bb = {
left: Number.MAX_VALUE,
top: Number.MAX_VALUE,
width: 0,
height: 0
};
this.eachNode(function (node) {
bb.left = Math.min(bb.left, node.x);
bb.top = Math.min(bb.top, node.y);
bb.width = Math.max(bb.width, node.x + node.width);
bb.height = Math.max(bb.height, node.y + node.height);
});
return bb;
},
// translate
translate: function translate(tx, ty) {
if (tx === void 0) {
tx = 0;
}
if (ty === void 0) {
ty = 0;
}
this.eachNode(function (node) {
node.x += tx;
node.y += ty;
});
},
right2left: function right2left() {
var me = this;
var bb = me.getBoundingBox();
me.eachNode(function (node) {
node.x = node.x - (node.x - bb.left) * 2 - node.width; // node.x = - node.x;
});
me.translate(bb.width, 0);
},
bottom2top: function bottom2top() {
var me = this;
var bb = me.getBoundingBox();
me.eachNode(function (node) {
node.y = node.y - (node.y - bb.top) * 2 - node.height; // node.y = - node.y;
});
me.translate(0, bb.height);
}
});
function hierarchy(data, options, isolated) {
if (options === void 0) {
options = {};
}
options = util.assign({}, DEFAULT_OPTIONS, options);
var root = new Node(data, options);
var nodes = [root];
var node;
if (!isolated && !data.collapsed) {
while (node = nodes.shift()) {
if (!node.data.collapsed) {
var children = options.getChildren(node.data);
var length = children ? children.length : 0;
node.children = new Array(length);
if (children && length) {
for (var i = 0; i < length; i++) {
var child = new Node(children[i], options);
node.children[i] = child;
nodes.push(child);
child.parent = node;
child.depth = node.depth + 1;
}
}
}
}
}
return root;
}
module.exports = hierarchy;
/***/ }),
/* 19 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys__ = __webpack_require__(20);
function isMatch(obj, attrs) {
var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys__["a" /* default */])(attrs);
var length = _keys.length;
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__["a" /* default */])(obj)) return !length;
for (var i = 0; i < length; i += 1) {
var key = _keys[i];
if (attrs[key] !== obj[key] || !(key in obj)) {
return false;
}
}
return true;
}
/* harmony default export */ __webpack_exports__["a"] = (isMatch);
/***/ }),
/* 20 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);
var keys = Object.keys ? function (obj) {
return Object.keys(obj);
} : function (obj) {
var result = [];
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(obj, function (value, key) {
if (!(Object(__WEBPACK_IMPORTED_MODULE_1__is_function__["a" /* default */])(obj) && key === 'prototype')) {
result.push(key);
}
});
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (keys);
/***/ }),
/* 21 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);
var splice = Array.prototype.splice;
var pullAt = function pullAt(arr, indexes) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__["a" /* default */])(arr)) {
return [];
}
var length = arr ? indexes.length : 0;
var last = length - 1;
while (length--) {
var previous = void 0;
var index = indexes[length];
if (length === last || index !== previous) {
previous = index;
splice.call(arr, index, 1);
}
}
return arr;
};
/* harmony default export */ __webpack_exports__["a"] = (pullAt);
/***/ }),
/* 22 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each__ = __webpack_require__(2);
var uniq = function (arr) {
var resultArr = [];
Object(__WEBPACK_IMPORTED_MODULE_1__each__["a" /* default */])(arr, function (item) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__contains__["a" /* default */])(resultArr, item)) {
resultArr.push(item);
}
});
return resultArr;
};
/* harmony default export */ __webpack_exports__["a"] = (uniq);
/***/ }),
/* 23 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_by__ = __webpack_require__(24);
var groupToMap = function (data, condition) {
if (!condition) {
return {
0: data
};
}
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_function__["a" /* default */])(condition)) {
var paramsCondition_1 = Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(condition) ? condition : condition.replace(/\s+/g, '').split('*');
condition = function (row) {
var unique = '_'; // 避免出现数字作为Key的情况会进行按照数字的排序
for (var i = 0, l = paramsCondition_1.length; i < l; i++) {
unique += row[paramsCondition_1[i]] && row[paramsCondition_1[i]].toString();
}
return unique;
};
}
var groups = Object(__WEBPACK_IMPORTED_MODULE_2__group_by__["a" /* default */])(data, condition);
return groups;
};
/* harmony default export */ __webpack_exports__["a"] = (groupToMap);
/***/ }),
/* 24 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);
var hasOwnProperty = Object.prototype.hasOwnProperty;
function groupBy(data, condition) {
if (!condition || !Object(__WEBPACK_IMPORTED_MODULE_1__is_array__["a" /* default */])(data)) {
return {};
}
var result = {}; // 兼容方法和 字符串的写法
var predicate = Object(__WEBPACK_IMPORTED_MODULE_2__is_function__["a" /* default */])(condition) ? condition : function (item) {
return item[condition];
};
var key;
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(data, function (item) {
key = predicate(item);
if (hasOwnProperty.call(result, key)) {
result[key].push(item);
} else {
result[key] = [item];
}
});
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (groupBy);
/***/ }),
/* 25 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = (function (obj, key) {
return obj.hasOwnProperty(key);
});
/***/ }),
/* 26 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);
// @ts-ignore
var values = Object.values ? function (obj) {
return Object.values(obj);
} : function (obj) {
var result = [];
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(obj, function (value, key) {
if (!(Object(__WEBPACK_IMPORTED_MODULE_1__is_function__["a" /* default */])(obj) && key === 'prototype')) {
result.push(value);
}
});
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (values);
/***/ }),
/* 27 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var toString = {}.toString;
var getType = function (value) {
return toString.call(value).replace(/^\[object /, '').replace(/]$/, '');
};
/* harmony default export */ __webpack_exports__["a"] = (getType);
/***/ }),
/* 28 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var objectProto = Object.prototype;
var isPrototype = function (value) {
var Ctor = value && value.constructor;
var proto = typeof Ctor === 'function' && Ctor.prototype || objectProto;
return value === proto;
};
/* harmony default export */ __webpack_exports__["a"] = (isPrototype);
/***/ }),
/* 29 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object_like__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_string__ = __webpack_require__(8);
var isEqual = function (value, other) {
if (value === other) {
return true;
}
if (!value || !other) {
return false;
}
if (Object(__WEBPACK_IMPORTED_MODULE_2__is_string__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_2__is_string__["a" /* default */])(other)) {
return false;
}
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__["a" /* default */])(other)) {
if (value.length !== other.length) {
return false;
}
var rst = true;
for (var i = 0; i < value.length; i++) {
rst = isEqual(value[i], other[i]);
if (!rst) {
break;
}
}
return rst;
}
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__["a" /* default */])(other)) {
var valueKeys = Object.keys(value);
var otherKeys = Object.keys(other);
if (valueKeys.length !== otherKeys.length) {
return false;
}
var rst = true;
for (var i = 0; i < valueKeys.length; i++) {
rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);
if (!rst) {
break;
}
}
return rst;
}
return false;
};
/* harmony default export */ __webpack_exports__["a"] = (isEqual);
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
var hierarchy = __webpack_require__(18);
module.exports = function (root, options) {
// separate into left and right trees
var left = hierarchy(root.data, options, true); // root only
var right = hierarchy(root.data, options, true); // root only
// automatically
var treeSize = root.children.length;
var rightTreeSize = Math.round(treeSize / 2); // separate left and right tree by meta data
var getSide = options.getSide || function (child, index) {
if (index < rightTreeSize) {
return 'right';
}
return 'left';
};
for (var i = 0; i < treeSize; i++) {
var child = root.children[i];
var side = getSide(child, i);
if (side === 'right') {
right.children.push(child);
} else {
left.children.push(child);
}
}
left.eachNode(function (node) {
if (!node.isRoot()) {
node.side = 'left';
}
});
right.eachNode(function (node) {
if (!node.isRoot()) {
node.side = 'right';
}
});
return {
left: left,
right: right
};
};
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var hierarchy = {
compactBox: __webpack_require__(32),
dendrogram: __webpack_require__(114),
indented: __webpack_require__(116),
mindmap: __webpack_require__(118)
};
module.exports = hierarchy;
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
var TreeLayout = __webpack_require__(11);
var nonLayeredTidyTree = __webpack_require__(113);
var doTreeLayout = __webpack_require__(17);
var util = __webpack_require__(7);
var CompactBoxTreeLayout = /*#__PURE__*/function (_TreeLayout) {
_inheritsLoose(CompactBoxTreeLayout, _TreeLayout);
function CompactBoxTreeLayout() {
return _TreeLayout.apply(this, arguments) || this;
}
var _proto = CompactBoxTreeLayout.prototype;
_proto.execute = function execute() {
var me = this;
return doTreeLayout(me.rootNode, me.options, nonLayeredTidyTree);
};
return CompactBoxTreeLayout;
}(TreeLayout);
var DEFAULT_OPTIONS = {};
function compactBoxLayout(root, options) {
options = util.assign({}, DEFAULT_OPTIONS, options);
return new CompactBoxTreeLayout(root, options).execute();
}
module.exports = compactBoxLayout;
/***/ }),
/* 33 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(12);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_0__contains__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_0__contains__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference__ = __webpack_require__(34);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__difference__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__find__ = __webpack_require__(35);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_2__find__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__find_index__ = __webpack_require__(36);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_3__find_index__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__first_value__ = __webpack_require__(37);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "firstValue", function() { return __WEBPACK_IMPORTED_MODULE_4__first_value__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten__ = __webpack_require__(38);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_5__flatten__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__flatten_deep__ = __webpack_require__(39);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return __WEBPACK_IMPORTED_MODULE_6__flatten_deep__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__get_range__ = __webpack_require__(40);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "getRange", function() { return __WEBPACK_IMPORTED_MODULE_7__get_range__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__pull__ = __webpack_require__(41);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return __WEBPACK_IMPORTED_MODULE_8__pull__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__pull_at__ = __webpack_require__(21);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return __WEBPACK_IMPORTED_MODULE_9__pull_at__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__reduce__ = __webpack_require__(42);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_10__reduce__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__remove__ = __webpack_require__(43);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return __WEBPACK_IMPORTED_MODULE_11__remove__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__sort_by__ = __webpack_require__(44);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_12__sort_by__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__union__ = __webpack_require__(45);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_13__union__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__uniq__ = __webpack_require__(22);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_14__uniq__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__values_of_key__ = __webpack_require__(46);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "valuesOfKey", function() { return __WEBPACK_IMPORTED_MODULE_15__values_of_key__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__head__ = __webpack_require__(47);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_16__head__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__last__ = __webpack_require__(48);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_17__last__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__starts_with__ = __webpack_require__(49);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return __WEBPACK_IMPORTED_MODULE_18__starts_with__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__ends_with__ = __webpack_require__(50);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return __WEBPACK_IMPORTED_MODULE_19__ends_with__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__filter__ = __webpack_require__(14);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_20__filter__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__every__ = __webpack_require__(51);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_21__every__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__some__ = __webpack_require__(52);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_22__some__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__group__ = __webpack_require__(53);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "group", function() { return __WEBPACK_IMPORTED_MODULE_23__group__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__group_by__ = __webpack_require__(24);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_24__group_by__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__group_to_map__ = __webpack_require__(23);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupToMap", function() { return __WEBPACK_IMPORTED_MODULE_25__group_to_map__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__get_wrap_behavior__ = __webpack_require__(54);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "getWrapBehavior", function() { return __WEBPACK_IMPORTED_MODULE_26__get_wrap_behavior__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__wrap_behavior__ = __webpack_require__(55);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrapBehavior", function() { return __WEBPACK_IMPORTED_MODULE_27__wrap_behavior__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__number2color__ = __webpack_require__(56);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "number2color", function() { return __WEBPACK_IMPORTED_MODULE_28__number2color__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__parse_radius__ = __webpack_require__(57);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "parseRadius", function() { return __WEBPACK_IMPORTED_MODULE_29__parse_radius__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__clamp__ = __webpack_require__(58);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return __WEBPACK_IMPORTED_MODULE_30__clamp__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__fixed_base__ = __webpack_require__(59);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fixedBase", function() { return __WEBPACK_IMPORTED_MODULE_31__fixed_base__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__is_decimal__ = __webpack_require__(60);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDecimal", function() { return __WEBPACK_IMPORTED_MODULE_32__is_decimal__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__is_even__ = __webpack_require__(61);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEven", function() { return __WEBPACK_IMPORTED_MODULE_33__is_even__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__is_integer__ = __webpack_require__(62);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return __WEBPACK_IMPORTED_MODULE_34__is_integer__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__is_negative__ = __webpack_require__(63);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNegative", function() { return __WEBPACK_IMPORTED_MODULE_35__is_negative__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__is_number_equal__ = __webpack_require__(64);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumberEqual", function() { return __WEBPACK_IMPORTED_MODULE_36__is_number_equal__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__is_odd__ = __webpack_require__(65);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isOdd", function() { return __WEBPACK_IMPORTED_MODULE_37__is_odd__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__is_positive__ = __webpack_require__(66);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isPositive", function() { return __WEBPACK_IMPORTED_MODULE_38__is_positive__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__max_by__ = __webpack_require__(67);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return __WEBPACK_IMPORTED_MODULE_39__max_by__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__min_by__ = __webpack_require__(68);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return __WEBPACK_IMPORTED_MODULE_40__min_by__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__mod__ = __webpack_require__(69);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mod", function() { return __WEBPACK_IMPORTED_MODULE_41__mod__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__to_degree__ = __webpack_require__(70);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return __WEBPACK_IMPORTED_MODULE_42__to_degree__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__to_integer__ = __webpack_require__(71);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return __WEBPACK_IMPORTED_MODULE_43__to_integer__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__to_radian__ = __webpack_require__(72);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toRadian", function() { return __WEBPACK_IMPORTED_MODULE_44__to_radian__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__for_in__ = __webpack_require__(73);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return __WEBPACK_IMPORTED_MODULE_45__for_in__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__has__ = __webpack_require__(25);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_46__has__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__has_key__ = __webpack_require__(74);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "hasKey", function() { return __WEBPACK_IMPORTED_MODULE_47__has_key__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__has_value__ = __webpack_require__(75);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "hasValue", function() { return __WEBPACK_IMPORTED_MODULE_48__has_value__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__keys__ = __webpack_require__(20);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_49__keys__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__is_match__ = __webpack_require__(19);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_50__is_match__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__values__ = __webpack_require__(26);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_51__values__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__lower_case__ = __webpack_require__(76);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return __WEBPACK_IMPORTED_MODULE_52__lower_case__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__lower_first__ = __webpack_require__(77);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return __WEBPACK_IMPORTED_MODULE_53__lower_first__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__substitute__ = __webpack_require__(78);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "substitute", function() { return __WEBPACK_IMPORTED_MODULE_54__substitute__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__upper_case__ = __webpack_require__(79);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return __WEBPACK_IMPORTED_MODULE_55__upper_case__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__upper_first__ = __webpack_require__(80);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return __WEBPACK_IMPORTED_MODULE_56__upper_first__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__get_type__ = __webpack_require__(27);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "getType", function() { return __WEBPACK_IMPORTED_MODULE_57__get_type__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__is_arguments__ = __webpack_require__(81);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_58__is_arguments__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__is_array__ = __webpack_require__(0);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_59__is_array__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__is_array_like__ = __webpack_require__(1);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return __WEBPACK_IMPORTED_MODULE_60__is_array_like__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__is_boolean__ = __webpack_require__(82);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_61__is_boolean__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__is_date__ = __webpack_require__(83);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_62__is_date__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__is_error__ = __webpack_require__(84);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_63__is_error__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__is_function__ = __webpack_require__(3);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_64__is_function__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__is_finite__ = __webpack_require__(85);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_65__is_finite__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__is_nil__ = __webpack_require__(6);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return __WEBPACK_IMPORTED_MODULE_66__is_nil__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__is_null__ = __webpack_require__(86);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_67__is_null__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__is_number__ = __webpack_require__(5);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_68__is_number__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__is_object__ = __webpack_require__(13);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_69__is_object__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__is_object_like__ = __webpack_require__(15);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return __WEBPACK_IMPORTED_MODULE_70__is_object_like__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__is_plain_object__ = __webpack_require__(9);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return __WEBPACK_IMPORTED_MODULE_71__is_plain_object__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__is_prototype__ = __webpack_require__(28);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isPrototype", function() { return __WEBPACK_IMPORTED_MODULE_72__is_prototype__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__is_reg_exp__ = __webpack_require__(87);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_73__is_reg_exp__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__is_string__ = __webpack_require__(8);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_74__is_string__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__is_type__ = __webpack_require__(4);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isType", function() { return __WEBPACK_IMPORTED_MODULE_75__is_type__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__is_undefined__ = __webpack_require__(88);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_76__is_undefined__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__is_element__ = __webpack_require__(89);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_77__is_element__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__request_animation_frame__ = __webpack_require__(90);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "requestAnimationFrame", function() { return __WEBPACK_IMPORTED_MODULE_78__request_animation_frame__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__clear_animation_frame__ = __webpack_require__(91);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clearAnimationFrame", function() { return __WEBPACK_IMPORTED_MODULE_79__clear_animation_frame__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__augment__ = __webpack_require__(92);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "augment", function() { return __WEBPACK_IMPORTED_MODULE_80__augment__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__clone__ = __webpack_require__(93);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_81__clone__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__debounce__ = __webpack_require__(94);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_82__debounce__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__memoize__ = __webpack_require__(95);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_83__memoize__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__deep_mix__ = __webpack_require__(96);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "deepMix", function() { return __WEBPACK_IMPORTED_MODULE_84__deep_mix__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__each__ = __webpack_require__(2);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_85__each__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__extend__ = __webpack_require__(97);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_86__extend__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__index_of__ = __webpack_require__(98);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_87__index_of__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__is_empty__ = __webpack_require__(99);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_88__is_empty__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__is_equal__ = __webpack_require__(29);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_89__is_equal__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__is_equal_with__ = __webpack_require__(100);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return __WEBPACK_IMPORTED_MODULE_90__is_equal_with__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__map__ = __webpack_require__(101);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_91__map__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__map_values__ = __webpack_require__(102);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return __WEBPACK_IMPORTED_MODULE_92__map_values__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__mix__ = __webpack_require__(16);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return __WEBPACK_IMPORTED_MODULE_93__mix__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_93__mix__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__get__ = __webpack_require__(103);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_94__get__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__set__ = __webpack_require__(104);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return __WEBPACK_IMPORTED_MODULE_95__set__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__pick__ = __webpack_require__(105);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_96__pick__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__throttle__ = __webpack_require__(106);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_97__throttle__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__to_array__ = __webpack_require__(107);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_98__to_array__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__to_string__ = __webpack_require__(10);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return __WEBPACK_IMPORTED_MODULE_99__to_string__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__unique_id__ = __webpack_require__(108);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_100__unique_id__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__noop__ = __webpack_require__(109);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_101__noop__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__identity__ = __webpack_require__(110);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_102__identity__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__size__ = __webpack_require__(111);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_103__size__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__cache__ = __webpack_require__(112);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Cache", function() { return __WEBPACK_IMPORTED_MODULE_104__cache__["a"]; });
// array
// event
// format
// math
// object
// string
// type
// other
// 不知道为什么,需要把这个 export不然 ts 会报类型错误
/***/ }),
/* 34 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains__ = __webpack_require__(12);
/**
* Flattens `array` a single level deep.
*
* @param {Array} arr The array to inspect.
* @param {Array} values The values to exclude.
* @return {Array} Returns the new array of filtered values.
* @example
* difference([2, 1], [2, 3]); // => [1]
*/
var difference = function (arr, values) {
if (values === void 0) {
values = [];
}
return Object(__WEBPACK_IMPORTED_MODULE_0__filter__["a" /* default */])(arr, function (value) {
return !Object(__WEBPACK_IMPORTED_MODULE_1__contains__["a" /* default */])(values, value);
});
};
/* harmony default export */ __webpack_exports__["a"] = (difference);
/***/ }),
/* 35 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_match__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_plain_object__ = __webpack_require__(9);
function find(arr, predicate) {
if (!Object(__WEBPACK_IMPORTED_MODULE_2__is_array__["a" /* default */])(arr)) return null;
var _predicate;
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_function__["a" /* default */])(predicate)) {
_predicate = predicate;
}
if (Object(__WEBPACK_IMPORTED_MODULE_3__is_plain_object__["a" /* default */])(predicate)) {
_predicate = function (a) {
return Object(__WEBPACK_IMPORTED_MODULE_1__is_match__["a" /* default */])(a, predicate);
};
}
if (_predicate) {
for (var i = 0; i < arr.length; i += 1) {
if (_predicate(arr[i])) {
return arr[i];
}
}
}
return null;
}
/* harmony default export */ __webpack_exports__["a"] = (find);
/***/ }),
/* 36 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function findIndex(arr, predicate, fromIndex) {
if (fromIndex === void 0) {
fromIndex = 0;
}
for (var i = fromIndex; i < arr.length; i++) {
if (predicate(arr[i], i)) {
// 找到终止循环
return i;
}
}
return -1;
}
/* harmony default export */ __webpack_exports__["a"] = (findIndex);
/***/ }),
/* 37 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);
var firstValue = function (data, name) {
var rst = null;
for (var i = 0; i < data.length; i++) {
var obj = data[i];
var value = obj[name];
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__["a" /* default */])(value)) {
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array__["a" /* default */])(value)) {
rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云
} else {
rst = value;
}
break;
}
}
return rst;
};
/* harmony default export */ __webpack_exports__["a"] = (firstValue);
/***/ }),
/* 38 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/**
* Flattens `array` a single level deep.
*
* @param {Array} arr The array to flatten.
* @return {Array} Returns the new flattened array.
* @example
*
* flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]
*/
var flatten = function (arr) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(arr)) {
return [];
}
var rst = [];
for (var i = 0; i < arr.length; i++) {
rst = rst.concat(arr[i]);
}
return rst;
};
/* harmony default export */ __webpack_exports__["a"] = (flatten);
/***/ }),
/* 39 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/**
* Flattens `array` a single level deep.
*
* @param {Array} arr The array to flatten.
* @param {Array} result The array to return.
* @return {Array} Returns the new flattened array.
* @example
*
* flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]
*/
var flattenDeep = function (arr, result) {
if (result === void 0) {
result = [];
}
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(arr)) {
result.push(arr);
} else {
for (var i = 0; i < arr.length; i += 1) {
flattenDeep(arr[i], result);
}
}
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (flattenDeep);
/***/ }),
/* 40 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(14);
var getRange = function (values) {
// 存在 NaN 时min,max 判定会出问题
values = Object(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* default */])(values, function (v) {
return !isNaN(v);
});
if (!values.length) {
// 如果没有数值则直接返回0
return {
min: 0,
max: 0
};
}
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(values[0])) {
var tmp = [];
for (var i = 0; i < values.length; i++) {
tmp = tmp.concat(values[i]);
}
values = tmp;
}
var max = Math.max.apply(null, values);
var min = Math.min.apply(null, values);
return {
min: min,
max: max
};
};
/* harmony default export */ __webpack_exports__["a"] = (getRange);
/***/ }),
/* 41 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var arrPrototype = Array.prototype;
var splice = arrPrototype.splice;
var indexOf = arrPrototype.indexOf;
var pull = function (arr) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
for (var i = 0; i < values.length; i++) {
var value = values[i];
var fromIndex = -1;
while ((fromIndex = indexOf.call(arr, value)) > -1) {
splice.call(arr, fromIndex, 1);
}
}
return arr;
};
/* harmony default export */ __webpack_exports__["a"] = (pull);
/***/ }),
/* 42 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_plain_object__ = __webpack_require__(9);
var reduce = function (arr, fn, init) {
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__["a" /* default */])(arr) && !Object(__WEBPACK_IMPORTED_MODULE_2__is_plain_object__["a" /* default */])(arr)) {
return arr;
}
var result = init;
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(arr, function (data, i) {
result = fn(result, data, i);
});
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (reduce);
/***/ }),
/* 43 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pull_at__ = __webpack_require__(21);
var remove = function (arr, predicate) {
/**
* const arr = [1, 2, 3, 4]
* const evens = remove(arr, n => n % 2 == 0)
* console.log(arr) // => [1, 3]
* console.log(evens) // => [2, 4]
*/
var result = [];
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__["a" /* default */])(arr)) {
return result;
}
var i = -1;
var indexes = [];
var length = arr.length;
while (++i < length) {
var value = arr[i];
if (predicate(value, i, arr)) {
result.push(value);
indexes.push(i);
}
}
Object(__WEBPACK_IMPORTED_MODULE_1__pull_at__["a" /* default */])(arr, indexes);
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (remove);
/***/ }),
/* 44 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);
function sortBy(arr, key) {
var comparer;
if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__["a" /* default */])(key)) {
comparer = function (a, b) {
return key(a) - key(b);
};
} else {
var keys_1 = [];
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_string__["a" /* default */])(key)) {
keys_1.push(key);
} else if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(key)) {
keys_1 = key;
}
comparer = function (a, b) {
for (var i = 0; i < keys_1.length; i += 1) {
var prop = keys_1[i];
if (a[prop] > b[prop]) {
return 1;
}
if (a[prop] < b[prop]) {
return -1;
}
}
return 0;
};
}
arr.sort(comparer);
return arr;
}
/* harmony default export */ __webpack_exports__["a"] = (sortBy);
/***/ }),
/* 45 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__uniq__ = __webpack_require__(22);
var union = function () {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
return Object(__WEBPACK_IMPORTED_MODULE_0__uniq__["a" /* default */])([].concat.apply([], sources));
};
/* harmony default export */ __webpack_exports__["a"] = (union);
/***/ }),
/* 46 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_nil__ = __webpack_require__(6);
/* harmony default export */ __webpack_exports__["a"] = (function (data, name) {
var rst = [];
var tmpMap = {};
data.forEach(function (obj) {
var value = obj[name];
if (!Object(__WEBPACK_IMPORTED_MODULE_2__is_nil__["a" /* default */])(value)) {
// flatten
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__["a" /* default */])(value)) {
value = [value];
}
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(value, function (val) {
// unique
if (!tmpMap[val]) {
rst.push(val);
tmpMap[val] = true;
}
});
}
});
return rst;
});
/***/ }),
/* 47 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = head;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);
function head(o) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__["a" /* default */])(o)) {
return o[0];
}
return undefined;
}
/***/ }),
/* 48 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = last;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);
function last(o) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__["a" /* default */])(o)) {
var arr = o;
return arr[arr.length - 1];
}
return undefined;
}
/***/ }),
/* 49 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);
function startsWith(arr, e) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__is_string__["a" /* default */])(arr) ? arr[0] === e : false;
}
/* harmony default export */ __webpack_exports__["a"] = (startsWith);
/***/ }),
/* 50 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);
function endsWith(arr, e) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__is_string__["a" /* default */])(arr) ? arr[arr.length - 1] === e : false;
}
/* harmony default export */ __webpack_exports__["a"] = (endsWith);
/***/ }),
/* 51 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 只要有一个不满足条件就返回 false
* @param arr
* @param func
*/
var every = function (arr, func) {
for (var i = 0; i < arr.length; i++) {
if (!func(arr[i], i)) return false;
}
return true;
};
/* harmony default export */ __webpack_exports__["a"] = (every);
/***/ }),
/* 52 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 只要有一个满足条件就返回 true
* @param arr
* @param func
*/
var some = function (arr, func) {
for (var i = 0; i < arr.length; i++) {
if (func(arr[i], i)) return true;
}
return false;
};
/* harmony default export */ __webpack_exports__["a"] = (some);
/***/ }),
/* 53 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_to_map__ = __webpack_require__(23);
/* harmony default export */ __webpack_exports__["a"] = (function (data, condition) {
if (!condition) {
// 没有条件,则自身改成数组
return [data];
}
var groups = Object(__WEBPACK_IMPORTED_MODULE_0__group_to_map__["a" /* default */])(data, condition);
var array = [];
for (var i in groups) {
array.push(groups[i]);
}
return array;
});
/***/ }),
/* 54 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 获取封装的事件
* @protected
* @param {Object} obj 对象
* @param {String} action 事件名称
* @return {Function} 返回事件处理函数
*/
function getWrapBehavior(obj, action) {
return obj['_wrap_' + action];
}
/* harmony default export */ __webpack_exports__["a"] = (getWrapBehavior);
/***/ }),
/* 55 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 封装事件便于使用上下文this,和便于解除事件时使用
* @protected
* @param {Object} obj 对象
* @param {String} action 事件名称
* @return {Function} 返回事件处理函数
*/
function wrapBehavior(obj, action) {
if (obj['_wrap_' + action]) {
return obj['_wrap_' + action];
}
var method = function (e) {
obj[action](e);
};
obj['_wrap_' + action] = method;
return method;
}
/* harmony default export */ __webpack_exports__["a"] = (wrapBehavior);
/***/ }),
/* 56 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var numColorCache = {};
function numberToColor(num) {
// 增加缓存
var color = numColorCache[num];
if (!color) {
var str = num.toString(16);
for (var i = str.length; i < 6; i++) {
str = '0' + str;
}
color = '#' + str;
numColorCache[num] = color;
}
return color;
}
/* harmony default export */ __webpack_exports__["a"] = (numberToColor);
/***/ }),
/* 57 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
function parseRadius(radius) {
var r1 = 0,
r2 = 0,
r3 = 0,
r4 = 0;
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(radius)) {
if (radius.length === 1) {
r1 = r2 = r3 = r4 = radius[0];
} else if (radius.length === 2) {
r1 = r3 = radius[0];
r2 = r4 = radius[1];
} else if (radius.length === 3) {
r1 = radius[0];
r2 = r4 = radius[1];
r3 = radius[2];
} else {
r1 = radius[0];
r2 = radius[1];
r3 = radius[2];
r4 = radius[3];
}
} else {
r1 = r2 = r3 = r4 = radius;
}
return {
r1: r1,
r2: r2,
r3: r3,
r4: r4
};
}
/* harmony default export */ __webpack_exports__["a"] = (parseRadius);
/***/ }),
/* 58 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var clamp = function (a, min, max) {
if (a < min) {
return min;
} else if (a > max) {
return max;
}
return a;
};
/* harmony default export */ __webpack_exports__["a"] = (clamp);
/***/ }),
/* 59 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var fixedBase = function (v, base) {
var str = base.toString();
var index = str.indexOf('.');
if (index === -1) {
return Math.round(v);
}
var length = str.substr(index + 1).length;
if (length > 20) {
length = 20;
}
return parseFloat(v.toFixed(length));
};
/* harmony default export */ __webpack_exports__["a"] = (fixedBase);
/***/ }),
/* 60 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);
var isDecimal = function (num) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__["a" /* default */])(num) && num % 1 !== 0;
};
/* harmony default export */ __webpack_exports__["a"] = (isDecimal);
/***/ }),
/* 61 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);
var isEven = function (num) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__["a" /* default */])(num) && num % 2 === 0;
};
/* harmony default export */ __webpack_exports__["a"] = (isEven);
/***/ }),
/* 62 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);
var isInteger = Number.isInteger ? Number.isInteger : function (num) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__["a" /* default */])(num) && num % 1 === 0;
};
/* harmony default export */ __webpack_exports__["a"] = (isInteger);
/***/ }),
/* 63 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);
var isNegative = function (num) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__["a" /* default */])(num) && num < 0;
};
/* harmony default export */ __webpack_exports__["a"] = (isNegative);
/***/ }),
/* 64 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isNumberEqual;
var PRECISION = 0.00001; // numbers less than this is considered as 0
function isNumberEqual(a, b, precision) {
if (precision === void 0) {
precision = PRECISION;
}
return Math.abs(a - b) < precision;
}
;
/***/ }),
/* 65 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);
var isOdd = function (num) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__["a" /* default */])(num) && num % 2 !== 0;
};
/* harmony default export */ __webpack_exports__["a"] = (isOdd);
/***/ }),
/* 66 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);
var isPositive = function (num) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__["a" /* default */])(num) && num > 0;
};
/* harmony default export */ __webpack_exports__["a"] = (isPositive);
/***/ }),
/* 67 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);
/**
* @param {Array} arr The array to iterate over.
* @param {Function} [fn] The iteratee invoked per element.
* @return {*} Returns the maximum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* maxBy(objects, function(o) { return o.n; });
* // => { 'n': 2 }
*
* maxBy(objects, 'n');
* // => { 'n': 2 }
*/
/* harmony default export */ __webpack_exports__["a"] = (function (arr, fn) {
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__["a" /* default */])(arr)) {
return undefined;
}
var max = arr[0];
var maxData;
if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__["a" /* default */])(fn)) {
maxData = fn(arr[0]);
} else {
maxData = arr[0][fn];
}
var data;
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(arr, function (val) {
if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__["a" /* default */])(fn)) {
data = fn(val);
} else {
data = val[fn];
}
if (data > maxData) {
max = val;
maxData = data;
}
});
return max;
});
/***/ }),
/* 68 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);
/**
* @param {Array} arr The array to iterate over.
* @param {Function} [fn] The iteratee invoked per element.
* @return {*} Returns the minimum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* minBy(objects, function(o) { return o.n; });
* // => { 'n': 1 }
*
* minBy(objects, 'n');
* // => { 'n': 1 }
*/
/* harmony default export */ __webpack_exports__["a"] = (function (arr, fn) {
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__["a" /* default */])(arr)) {
return undefined;
}
var min = arr[0];
var minData;
if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__["a" /* default */])(fn)) {
minData = fn(arr[0]);
} else {
minData = arr[0][fn];
}
var data;
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(arr, function (val) {
if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__["a" /* default */])(fn)) {
data = fn(val);
} else {
data = val[fn];
}
if (data < minData) {
min = val;
minData = data;
}
});
return min;
});
/***/ }),
/* 69 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var mod = function (n, m) {
return (n % m + m) % m;
};
/* harmony default export */ __webpack_exports__["a"] = (mod);
/***/ }),
/* 70 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var DEGREE = 180 / Math.PI;
var toDegree = function (radian) {
return DEGREE * radian;
};
/* harmony default export */ __webpack_exports__["a"] = (toDegree);
/***/ }),
/* 71 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = (parseInt);
/***/ }),
/* 72 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var RADIAN = Math.PI / 180;
var toRadian = function (degree) {
return RADIAN * degree;
};
/* harmony default export */ __webpack_exports__["a"] = (toRadian);
/***/ }),
/* 73 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */]);
/***/ }),
/* 74 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has__ = __webpack_require__(25);
/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__has__["a" /* default */]);
/***/ }),
/* 75 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values__ = __webpack_require__(26);
/* harmony default export */ __webpack_exports__["a"] = (function (obj, value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__contains__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_1__values__["a" /* default */])(obj), value);
});
/***/ }),
/* 76 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);
var lowerCase = function (str) {
return Object(__WEBPACK_IMPORTED_MODULE_0__to_string__["a" /* default */])(str).toLowerCase();
};
/* harmony default export */ __webpack_exports__["a"] = (lowerCase);
/***/ }),
/* 77 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);
var lowerFirst = function (value) {
var str = Object(__WEBPACK_IMPORTED_MODULE_0__to_string__["a" /* default */])(value);
return str.charAt(0).toLowerCase() + str.substring(1);
};
/* harmony default export */ __webpack_exports__["a"] = (lowerFirst);
/***/ }),
/* 78 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function substitute(str, o) {
if (!str || !o) {
return str;
}
return str.replace(/\\?\{([^{}]+)\}/g, function (match, name) {
if (match.charAt(0) === '\\') {
return match.slice(1);
}
return o[name] === undefined ? '' : o[name];
});
}
/* harmony default export */ __webpack_exports__["a"] = (substitute);
/***/ }),
/* 79 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);
var upperCase = function (str) {
return Object(__WEBPACK_IMPORTED_MODULE_0__to_string__["a" /* default */])(str).toUpperCase();
};
/* harmony default export */ __webpack_exports__["a"] = (upperCase);
/***/ }),
/* 80 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);
var upperFirst = function (value) {
var str = Object(__WEBPACK_IMPORTED_MODULE_0__to_string__["a" /* default */])(value);
return str.charAt(0).toUpperCase() + str.substring(1);
};
/* harmony default export */ __webpack_exports__["a"] = (upperFirst);
/***/ }),
/* 81 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
/**
* 是否是参数类型
*
* @param {Object} value 测试的值
* @return {Boolean}
*/
var isArguments = function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(value, 'Arguments');
};
/* harmony default export */ __webpack_exports__["a"] = (isArguments);
/***/ }),
/* 82 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
/**
* 是否是布尔类型
*
* @param {Object} value 测试的值
* @return {Boolean}
*/
var isBoolean = function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(value, 'Boolean');
};
/* harmony default export */ __webpack_exports__["a"] = (isBoolean);
/***/ }),
/* 83 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
var isDate = function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(value, 'Date');
};
/* harmony default export */ __webpack_exports__["a"] = (isDate);
/***/ }),
/* 84 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
/**
* 是否是参数类型
*
* @param {Object} value 测试的值
* @return {Boolean}
*/
var isError = function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(value, 'Error');
};
/* harmony default export */ __webpack_exports__["a"] = (isError);
/***/ }),
/* 85 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);
/**
* 判断是否为有限数
* @return {Boolean}
*/
/* harmony default export */ __webpack_exports__["a"] = (function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__["a" /* default */])(value) && isFinite(value);
});
/***/ }),
/* 86 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var isNull = function (value) {
return value === null;
};
/* harmony default export */ __webpack_exports__["a"] = (isNull);
/***/ }),
/* 87 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);
var isRegExp = function (str) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__["a" /* default */])(str, 'RegExp');
};
/* harmony default export */ __webpack_exports__["a"] = (isRegExp);
/***/ }),
/* 88 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var isUndefined = function (value) {
return value === undefined;
};
/* harmony default export */ __webpack_exports__["a"] = (isUndefined);
/***/ }),
/* 89 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 判断是否HTML元素
* @return {Boolean} 是否HTML元素
*/
var isElement = function (o) {
return o instanceof Element || o instanceof HTMLDocument;
};
/* harmony default export */ __webpack_exports__["a"] = (isElement);
/***/ }),
/* 90 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = requestAnimationFrame;
function requestAnimationFrame(fn) {
var method = window.requestAnimationFrame || window.webkitRequestAnimationFrame || // @ts-ignore
window.mozRequestAnimationFrame || // @ts-ignore
window.msRequestAnimationFrame || function (f) {
return setTimeout(f, 16);
};
return method(fn);
}
;
/***/ }),
/* 91 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = cancelAnimationFrame;
function cancelAnimationFrame(handler) {
var method = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || // @ts-ignore
window.mozCancelAnimationFrame || // @ts-ignore
window.msCancelAnimationFrame || clearTimeout;
method(handler);
}
;
/***/ }),
/* 92 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mix__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);
var augment = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var c = args[0];
for (var i = 1; i < args.length; i++) {
var obj = args[i];
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_function__["a" /* default */])(obj)) {
obj = obj.prototype;
}
Object(__WEBPACK_IMPORTED_MODULE_0__mix__["a" /* default */])(c.prototype, obj);
}
};
/* harmony default export */ __webpack_exports__["a"] = (augment);
/***/ }),
/* 93 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
var clone = function (obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
var rst;
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(obj)) {
rst = [];
for (var i = 0, l = obj.length; i < l; i++) {
if (typeof obj[i] === 'object' && obj[i] != null) {
rst[i] = clone(obj[i]);
} else {
rst[i] = obj[i];
}
}
} else {
rst = {};
for (var k in obj) {
if (typeof obj[k] === 'object' && obj[k] != null) {
rst[k] = clone(obj[k]);
} else {
rst[k] = obj[k];
}
}
}
return rst;
};
/* harmony default export */ __webpack_exports__["a"] = (clone);
/***/ }),
/* 94 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function debounce(func, wait, immediate) {
var timeout;
return function () {
var context = this,
args = arguments;
var later = function () {
timeout = null;
if (!immediate) {
func.apply(context, args);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
func.apply(context, args);
}
};
}
/* harmony default export */ __webpack_exports__["a"] = (debounce);
/***/ }),
/* 95 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(3);
/**
* _.memoize(calColor);
* _.memoize(calColor, (...args) => args[0]);
* @param f
* @param resolver
*/
/* harmony default export */ __webpack_exports__["a"] = (function (f, resolver) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_function__["a" /* default */])(f)) {
throw new TypeError('Expected a function');
}
var memoized = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
} // 使用方法构造 key如果不存在 resolver则直接取第一个参数作为 key
var key = resolver ? resolver.apply(this, args) : args[0];
var cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = f.apply(this, args); // 缓存起来
cache.set(key, result);
return result;
};
memoized.cache = new Map();
return memoized;
});
/***/ }),
/* 96 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_plain_object__ = __webpack_require__(9);
var MAX_MIX_LEVEL = 5;
function _deepMix(dist, src, level, maxLevel) {
level = level || 0;
maxLevel = maxLevel || MAX_MIX_LEVEL;
for (var key in src) {
if (src.hasOwnProperty(key)) {
var value = src[key];
if (value !== null && Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__["a" /* default */])(value)) {
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__["a" /* default */])(dist[key])) {
dist[key] = {};
}
if (level < maxLevel) {
_deepMix(dist[key], value, level + 1, maxLevel);
} else {
dist[key] = src[key];
}
} else if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__["a" /* default */])(value)) {
dist[key] = [];
dist[key] = dist[key].concat(value);
} else if (value !== undefined) {
dist[key] = value;
}
}
}
} // todo 重写
var deepMix = function (rst) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
for (var i = 0; i < args.length; i += 1) {
_deepMix(rst, args[i]);
}
return rst;
};
/* harmony default export */ __webpack_exports__["a"] = (deepMix);
/***/ }),
/* 97 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mix__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);
var extend = function (subclass, superclass, overrides, staticOverrides) {
// 如果只提供父类构造函数,则自动生成子类构造函数
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_function__["a" /* default */])(superclass)) {
overrides = superclass;
superclass = subclass;
subclass = function () {};
}
var create = Object.create ? function (proto, c) {
return Object.create(proto, {
constructor: {
value: c
}
});
} : function (proto, c) {
function Tmp() {}
Tmp.prototype = proto;
var o = new Tmp();
o.constructor = c;
return o;
};
var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype
subclass.prototype = Object(__WEBPACK_IMPORTED_MODULE_0__mix__["a" /* default */])(superObj, subclass.prototype); // 指定子类的prototype
subclass.superclass = create(superclass.prototype, superclass);
Object(__WEBPACK_IMPORTED_MODULE_0__mix__["a" /* default */])(superObj, overrides);
Object(__WEBPACK_IMPORTED_MODULE_0__mix__["a" /* default */])(subclass, staticOverrides);
return subclass;
};
/* harmony default export */ __webpack_exports__["a"] = (extend);
/***/ }),
/* 98 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);
var indexOf = function (arr, obj) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__["a" /* default */])(arr)) {
return -1;
}
var m = Array.prototype.indexOf;
if (m) {
return m.call(arr, obj);
}
var index = -1;
for (var i = 0; i < arr.length; i++) {
if (arr[i] === obj) {
index = i;
break;
}
}
return index;
};
/* harmony default export */ __webpack_exports__["a"] = (indexOf);
/***/ }),
/* 99 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_type__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_prototype__ = __webpack_require__(28);
var hasOwnProperty = Object.prototype.hasOwnProperty;
function isEmpty(value) {
/**
* isEmpty(null) => true
* isEmpty() => true
* isEmpty(true) => true
* isEmpty(1) => true
* isEmpty([1, 2, 3]) => false
* isEmpty('abc') => false
* isEmpty({ a: 1 }) => false
*/
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__["a" /* default */])(value)) {
return true;
}
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__["a" /* default */])(value)) {
return !value.length;
}
var type = Object(__WEBPACK_IMPORTED_MODULE_2__get_type__["a" /* default */])(value);
if (type === 'Map' || type === 'Set') {
return !value.size;
}
if (Object(__WEBPACK_IMPORTED_MODULE_3__is_prototype__["a" /* default */])(value)) {
return !Object.keys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
/* harmony default export */ __webpack_exports__["a"] = (isEmpty);
/***/ }),
/* 100 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_equal__ = __webpack_require__(29);
/**
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [fn] 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
*/
/* harmony default export */ __webpack_exports__["a"] = (function (value, other, fn) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_function__["a" /* default */])(fn)) {
return Object(__WEBPACK_IMPORTED_MODULE_1__is_equal__["a" /* default */])(value, other);
}
return !!fn(value, other);
});
/***/ }),
/* 101 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);
var map = function (arr, func) {
if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__["a" /* default */])(arr)) {
// @ts-ignore
return arr;
}
var result = [];
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(arr, function (value, index) {
result.push(func(value, index));
});
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (map);
/***/ }),
/* 102 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_object__ = __webpack_require__(13);
var identity = function (v) {
return v;
};
/* harmony default export */ __webpack_exports__["a"] = (function (object, func) {
if (func === void 0) {
func = identity;
}
var r = {};
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_object__["a" /* default */])(object) && !Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__["a" /* default */])(object)) {
Object.keys(object).forEach(function (key) {
// @ts-ignore
r[key] = func(object[key], key);
});
}
return r;
});
/***/ }),
/* 103 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_string__ = __webpack_require__(8);
/**
* https://github.com/developit/dlv/blob/master/index.js
* @param obj
* @param key
* @param defaultValue
*/
/* harmony default export */ __webpack_exports__["a"] = (function (obj, key, defaultValue) {
var p = 0;
var keyArr = Object(__WEBPACK_IMPORTED_MODULE_0__is_string__["a" /* default */])(key) ? key.split('.') : key;
while (obj && p < keyArr.length) {
obj = obj[keyArr[p++]];
}
return obj === undefined || p < keyArr.length ? defaultValue : obj;
});
/***/ }),
/* 104 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_number__ = __webpack_require__(5);
/**
* https://github.com/developit/dlv/blob/master/index.js
* @param obj
* @param path
* @param value
*/
/* harmony default export */ __webpack_exports__["a"] = (function (obj, path, value) {
var o = obj;
var keyArr = Object(__WEBPACK_IMPORTED_MODULE_1__is_string__["a" /* default */])(path) ? path.split('.') : path;
keyArr.forEach(function (key, idx) {
// 不是最后一个
if (idx < keyArr.length - 1) {
if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_object__["a" /* default */])(o[key])) {
o[key] = Object(__WEBPACK_IMPORTED_MODULE_2__is_number__["a" /* default */])(keyArr[idx + 1]) ? [] : {};
}
o = o[key];
} else {
o[key] = value;
}
});
return obj;
});
/***/ }),
/* 105 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_plain_object__ = __webpack_require__(9);
var hasOwnProperty = Object.prototype.hasOwnProperty;
/* harmony default export */ __webpack_exports__["a"] = (function (object, keys) {
if (object === null || !Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__["a" /* default */])(object)) {
return {};
}
var result = {};
Object(__WEBPACK_IMPORTED_MODULE_0__each__["a" /* default */])(keys, function (key) {
if (hasOwnProperty.call(object, key)) {
result[key] = object[key];
}
});
return result;
});
/***/ }),
/* 106 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = (function (func, wait, options) {
var timeout, context, args, result;
var previous = 0;
if (!options) options = {};
var later = function () {
previous = options.leading === false ? 0 : Date.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
};
var throttled = function () {
var now = Date.now();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
previous = now;
result = func.apply(context, args);
if (!timeout) context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
throttled.cancel = function () {
clearTimeout(timeout);
previous = 0;
timeout = context = args = null;
};
return throttled;
});
/***/ }),
/* 107 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);
/* harmony default export */ __webpack_exports__["a"] = (function (value) {
return Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__["a" /* default */])(value) ? Array.prototype.slice.call(value) : [];
});
/***/ }),
/* 108 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var map = {};
/* harmony default export */ __webpack_exports__["a"] = (function (prefix) {
prefix = prefix || 'g';
if (!map[prefix]) {
map[prefix] = 1;
} else {
map[prefix] += 1;
}
return prefix + map[prefix];
});
/***/ }),
/* 109 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = (function () {});
/***/ }),
/* 110 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = (function (v) {
return v;
});
/***/ }),
/* 111 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = size;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);
function size(o) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__["a" /* default */])(o)) {
return 0;
}
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__["a" /* default */])(o)) {
return o.length;
}
return Object.keys(o).length;
}
/***/ }),
/* 112 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* k-v 存储
*/
var default_1 =
/** @class */
function () {
function default_1() {
this.map = {};
}
default_1.prototype.has = function (key) {
return this.map[key] !== undefined;
};
default_1.prototype.get = function (key, def) {
var v = this.map[key];
return v === undefined ? def : v;
};
default_1.prototype.set = function (key, value) {
this.map[key] = value;
};
default_1.prototype.clear = function () {
this.map = {};
};
default_1.prototype.delete = function (key) {
delete this.map[key];
};
default_1.prototype.size = function () {
return Object.keys(this.map).length;
};
return default_1;
}();
/* harmony default export */ __webpack_exports__["a"] = (default_1);
/***/ }),
/* 113 */
/***/ (function(module, exports) {
// wrap tree node
function WrappedTree(w, h, y, c) {
if (c === void 0) {
c = [];
}
var me = this; // size
me.w = w || 0;
me.h = h || 0; // position
me.y = y || 0;
me.x = 0; // children
me.c = c || [];
me.cs = c.length; // modified
me.prelim = 0;
me.mod = 0;
me.shift = 0;
me.change = 0; // left/right tree
me.tl = null;
me.tr = null; // extreme left/right tree
me.el = null;
me.er = null; // modified left/right tree
me.msel = 0;
me.mser = 0;
}
WrappedTree.fromNode = function (root, isHorizontal) {
if (!root) return null;
var children = [];
root.children.forEach(function (child) {
children.push(WrappedTree.fromNode(child, isHorizontal));
});
if (isHorizontal) return new WrappedTree(root.height, root.width, root.x, children);
return new WrappedTree(root.width, root.height, root.y, children);
}; // node utils
function moveRight(node, move, isHorizontal) {
if (isHorizontal) {
node.y += move;
} else {
node.x += move;
}
node.children.forEach(function (child) {
moveRight(child, move, isHorizontal);
});
}
function getMin(node, isHorizontal) {
var res = isHorizontal ? node.y : node.x;
node.children.forEach(function (child) {
res = Math.min(getMin(child, isHorizontal), res);
});
return res;
}
function normalize(node, isHorizontal) {
var min = getMin(node, isHorizontal);
moveRight(node, -min, isHorizontal);
}
function convertBack(converted
/* WrappedTree */
, root
/* TreeNode */
, isHorizontal) {
if (isHorizontal) {
root.y = converted.x;
} else {
root.x = converted.x;
}
converted.c.forEach(function (child, i) {
convertBack(child, root.children[i], isHorizontal);
});
}
function layer(node, isHorizontal, d) {
if (d === void 0) {
d = 0;
}
if (isHorizontal) {
node.x = d;
d += node.width;
} else {
node.y = d;
d += node.height;
}
node.children.forEach(function (child) {
layer(child, isHorizontal, d);
});
}
module.exports = function (root, options) {
if (options === void 0) {
options = {};
}
var isHorizontal = options.isHorizontal;
function firstWalk(t) {
if (t.cs === 0) {
setExtremes(t);
return;
}
firstWalk(t.c[0]);
var ih = updateIYL(bottom(t.c[0].el), 0, null);
for (var i = 1; i < t.cs; ++i) {
firstWalk(t.c[i]);
var min = bottom(t.c[i].er);
separate(t, i, ih);
ih = updateIYL(min, i, ih);
}
positionRoot(t);
setExtremes(t);
}
function setExtremes(t) {
if (t.cs === 0) {
t.el = t;
t.er = t;
t.msel = t.mser = 0;
} else {
t.el = t.c[0].el;
t.msel = t.c[0].msel;
t.er = t.c[t.cs - 1].er;
t.mser = t.c[t.cs - 1].mser;
}
}
function separate(t, i, ih) {
var sr = t.c[i - 1];
var mssr = sr.mod;
var cl = t.c[i];
var mscl = cl.mod;
while (sr !== null && cl !== null) {
if (bottom(sr) > ih.low) ih = ih.nxt;
var dist = mssr + sr.prelim + sr.w - (mscl + cl.prelim);
if (dist > 0) {
mscl += dist;
moveSubtree(t, i, ih.index, dist);
}
var sy = bottom(sr);
var cy = bottom(cl);
if (sy <= cy) {
sr = nextRightContour(sr);
if (sr !== null) mssr += sr.mod;
}
if (sy >= cy) {
cl = nextLeftContour(cl);
if (cl !== null) mscl += cl.mod;
}
}
if (!sr && !!cl) {
setLeftThread(t, i, cl, mscl);
} else if (!!sr && !cl) {
setRightThread(t, i, sr, mssr);
}
}
function moveSubtree(t, i, si, dist) {
t.c[i].mod += dist;
t.c[i].msel += dist;
t.c[i].mser += dist;
distributeExtra(t, i, si, dist);
}
function nextLeftContour(t) {
return t.cs === 0 ? t.tl : t.c[0];
}
function nextRightContour(t) {
return t.cs === 0 ? t.tr : t.c[t.cs - 1];
}
function bottom(t) {
return t.y + t.h;
}
function setLeftThread(t, i, cl, modsumcl) {
var li = t.c[0].el;
li.tl = cl;
var diff = modsumcl - cl.mod - t.c[0].msel;
li.mod += diff;
li.prelim -= diff;
t.c[0].el = t.c[i].el;
t.c[0].msel = t.c[i].msel;
}
function setRightThread(t, i, sr, modsumsr) {
var ri = t.c[i].er;
ri.tr = sr;
var diff = modsumsr - sr.mod - t.c[i].mser;
ri.mod += diff;
ri.prelim -= diff;
t.c[i].er = t.c[i - 1].er;
t.c[i].mser = t.c[i - 1].mser;
}
function positionRoot(t) {
t.prelim = (t.c[0].prelim + t.c[0].mod + t.c[t.cs - 1].mod + t.c[t.cs - 1].prelim + t.c[t.cs - 1].w) / 2 - t.w / 2;
}
function secondWalk(t, modsum) {
modsum += t.mod;
t.x = t.prelim + modsum;
addChildSpacing(t);
for (var i = 0; i < t.cs; i++) {
secondWalk(t.c[i], modsum);
}
}
function distributeExtra(t, i, si, dist) {
if (si !== i - 1) {
var nr = i - si;
t.c[si + 1].shift += dist / nr;
t.c[i].shift -= dist / nr;
t.c[i].change -= dist - dist / nr;
}
}
function addChildSpacing(t) {
var d = 0;
var modsumdelta = 0;
for (var i = 0; i < t.cs; i++) {
d += t.c[i].shift;
modsumdelta += d + t.c[i].change;
t.c[i].mod += modsumdelta;
}
}
function updateIYL(low, index, ih) {
while (ih !== null && low >= ih.low) {
ih = ih.nxt;
}
return {
low: low,
index: index,
nxt: ih
};
} // do layout
layer(root, isHorizontal);
var wt = WrappedTree.fromNode(root, isHorizontal);
firstWalk(wt);
secondWalk(wt, 0);
convertBack(wt, root, isHorizontal);
normalize(root, isHorizontal);
return root;
};
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
var TreeLayout = __webpack_require__(11);
var dendrogram = __webpack_require__(115);
var doTreeLayout = __webpack_require__(17);
var util = __webpack_require__(7);
var DendrogramLayout = /*#__PURE__*/function (_TreeLayout) {
_inheritsLoose(DendrogramLayout, _TreeLayout);
function DendrogramLayout() {
return _TreeLayout.apply(this, arguments) || this;
}
var _proto = DendrogramLayout.prototype;
_proto.execute = function execute() {
var me = this;
me.rootNode.width = 0;
return doTreeLayout(me.rootNode, me.options, dendrogram);
};
return DendrogramLayout;
}(TreeLayout);
var DEFAULT_OPTIONS = {};
function dendrogramLayout(root, options) {
options = util.assign({}, DEFAULT_OPTIONS, options);
return new DendrogramLayout(root, options).execute();
}
module.exports = dendrogramLayout;
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
// wrap tree node
// TODO considering size
var util = __webpack_require__(7);
function WrappedTree(height, children) {
if (height === void 0) {
height = 0;
}
if (children === void 0) {
children = [];
}
var me = this;
me.x = me.y = 0;
me.leftChild = me.rightChild = null;
me.height = 0;
me.children = children;
}
var DEFAULT_OPTIONS = {
isHorizontal: true,
nodeSep: 20,
nodeSize: 20,
rankSep: 200,
subTreeSep: 10
};
function convertBack(converted
/* WrappedTree */
, root
/* TreeNode */
, isHorizontal) {
if (isHorizontal) {
root.x = converted.x;
root.y = converted.y;
} else {
root.x = converted.y;
root.y = converted.x;
}
converted.children.forEach(function (child, i) {
convertBack(child, root.children[i], isHorizontal);
});
}
module.exports = function (root, options) {
if (options === void 0) {
options = {};
}
options = util.assign({}, DEFAULT_OPTIONS, options);
var maxDepth = 0;
function wrappedTreeFromNode(n) {
if (!n) return null;
n.width = 0;
if (n.depth && n.depth > maxDepth) {
maxDepth = n.depth; // get the max depth
}
var children = n.children;
var childrenCount = children.length;
var t = new WrappedTree(n.height, []);
children.forEach(function (child, i) {
var childWT = wrappedTreeFromNode(child);
t.children.push(childWT);
if (i === 0) {
// t.leftChild = childWT.leftChild ? childWT.leftChild : childWT
t.leftChild = childWT;
}
if (i === childrenCount - 1) {
// t.rightChild = childWT.rightChild ? childWT.rightChild : childWT
t.rightChild = childWT;
}
});
t.originNode = n;
t.isLeaf = n.isLeaf();
return t;
}
function getDrawingDepth(t) {
if (t.isLeaf || t.children.length === 0) {
t.drawingDepth = maxDepth;
} else {
var depths = t.children.map(function (child) {
return getDrawingDepth(child);
});
var minChildDepth = Math.min.apply(null, depths);
t.drawingDepth = minChildDepth - 1;
}
return t.drawingDepth;
}
var prevLeaf;
function position(t) {
t.x = t.drawingDepth * options.rankSep;
if (t.isLeaf) {
t.y = 0;
if (prevLeaf) {
t.y = prevLeaf.y + prevLeaf.height + options.nodeSep;
if (t.originNode.parent !== prevLeaf.originNode.parent) {
t.y += options.subTreeSep;
}
}
prevLeaf = t;
} else {
t.children.forEach(function (child) {
position(child);
});
t.y = (t.leftChild.y + t.rightChild.y) / 2;
}
} // wrap node
var wt = wrappedTreeFromNode(root); // get depth for drawing
getDrawingDepth(wt); // get position
position(wt); // get x, y
convertBack(wt, root, options.isHorizontal);
return root;
};
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
var TreeLayout = __webpack_require__(11);
var indentedTree = __webpack_require__(117);
var separateTree = __webpack_require__(30);
var util = __webpack_require__(7);
var VALID_DIRECTIONS = ['LR', // left to right
'RL', // right to left
'H' // horizontal
];
var DEFAULT_DIRECTION = VALID_DIRECTIONS[0];
var IndentedLayout = /*#__PURE__*/function (_TreeLayout) {
_inheritsLoose(IndentedLayout, _TreeLayout);
function IndentedLayout() {
return _TreeLayout.apply(this, arguments) || this;
}
var _proto = IndentedLayout.prototype;
_proto.execute = function execute() {
var me = this;
var options = me.options;
var root = me.rootNode;
options.isHorizontal = true; // default indent 20 and sink first children;
var _options$indent = options.indent,
indent = _options$indent === void 0 ? 20 : _options$indent,
_options$dropCap = options.dropCap,
dropCap = _options$dropCap === void 0 ? true : _options$dropCap;
var direction = options.direction || DEFAULT_DIRECTION;
if (direction && VALID_DIRECTIONS.indexOf(direction) === -1) {
throw new TypeError("Invalid direction: " + direction);
}
if (direction === VALID_DIRECTIONS[0]) {
// LR
indentedTree(root, indent, dropCap);
} else if (direction === VALID_DIRECTIONS[1]) {
// RL
indentedTree(root, indent, dropCap);
root.right2left();
} else if (direction === VALID_DIRECTIONS[2]) {
// H
// separate into left and right trees
var _separateTree = separateTree(root, options),
left = _separateTree.left,
right = _separateTree.right;
indentedTree(left, indent, dropCap);
left.right2left();
indentedTree(right, indent, dropCap);
var bbox = left.getBoundingBox();
right.translate(bbox.width, 0);
root.x = right.x - root.width / 2;
}
return root;
};
return IndentedLayout;
}(TreeLayout);
var DEFAULT_OPTIONS = {};
function indentedLayout(root, options) {
options = util.assign({}, DEFAULT_OPTIONS, options);
return new IndentedLayout(root, options).execute();
}
module.exports = indentedLayout;
/***/ }),
/* 117 */
/***/ (function(module, exports) {
function positionNode(node, previousNode, dx, dropCap) {
if (!dropCap) {
try {
if (node.id === node.parent.children[0].id) {
node.x += dx * node.depth;
node.y = previousNode ? previousNode.y : 0;
return;
}
} catch (e) {// skip to normal when a node has no parent
}
}
node.x += dx * node.depth;
node.y = previousNode ? previousNode.y + previousNode.height : 0;
return;
}
module.exports = function (root, indent, dropCap) {
var previousNode = null;
root.eachNode(function (node) {
positionNode(node, previousNode, indent, dropCap);
previousNode = node;
});
};
/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
var TreeLayout = __webpack_require__(11);
var mindmap = __webpack_require__(119);
var doTreeLayout = __webpack_require__(17);
var util = __webpack_require__(7);
var MindmapLayout = /*#__PURE__*/function (_TreeLayout) {
_inheritsLoose(MindmapLayout, _TreeLayout);
function MindmapLayout() {
return _TreeLayout.apply(this, arguments) || this;
}
var _proto = MindmapLayout.prototype;
_proto.execute = function execute() {
var me = this;
return doTreeLayout(me.rootNode, me.options, mindmap);
};
return MindmapLayout;
}(TreeLayout);
var DEFAULT_OPTIONS = {};
function mindmapLayout(root, options) {
options = util.assign({}, DEFAULT_OPTIONS, options);
return new MindmapLayout(root, options).execute();
}
module.exports = mindmapLayout;
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
var util = __webpack_require__(7);
function secondWalk(node, options) {
var totalHeight = 0;
if (!node.children.length) {
totalHeight = node.height;
} else {
node.children.forEach(function (c) {
totalHeight += secondWalk(c, options);
});
}
node._subTreeSep = options.getSubTreeSep(node.data);
node.totalHeight = Math.max(node.height, totalHeight) + 2 * node._subTreeSep;
return node.totalHeight;
}
function thirdWalk(node) {
var children = node.children;
var len = children.length;
if (len) {
children.forEach(function (c) {
thirdWalk(c);
});
var first = children[0];
var last = children[len - 1];
var childrenHeight = last.y - first.y + last.height;
var childrenTotalHeight = 0;
children.forEach(function (child) {
childrenTotalHeight += child.totalHeight;
});
if (childrenHeight > node.height) {
// 当子节点总高度大于父节点高度
node.y = first.y + childrenHeight / 2 - node.height / 2;
} else if (children.length !== 1 || node.height > childrenTotalHeight) {
// 多于一个子节点或者父节点大于所有子节点的总高度
var offset = node.y + (node.height - childrenHeight) / 2 - first.y;
children.forEach(function (c) {
c.translate(0, offset);
});
} else {
// 只有一个子节点
node.y = (first.y + first.height / 2 + last.y + last.height / 2) / 2 - node.height / 2;
}
}
}
var DEFAULT_OPTIONS = {
getSubTreeSep: function getSubTreeSep() {
return 0;
}
};
module.exports = function (root, options) {
if (options === void 0) {
options = {};
}
options = util.assign({}, DEFAULT_OPTIONS, options);
root.parent = {
x: 0,
width: 0,
height: 0,
y: 0
}; // first walk
root.BFTraverse(function (node) {
node.x = node.parent.x + node.parent.width; // simply get x
});
root.parent = null; // second walk
secondWalk(root, options); // assign sub tree totalHeight
// adjusting
// separating nodes
root.startY = 0;
root.y = root.totalHeight / 2 - root.height / 2;
root.eachNode(function (node) {
var children = node.children;
var len = children.length;
if (len) {
var first = children[0];
first.startY = node.startY + node._subTreeSep;
if (len === 1) {
first.y = node.y + node.height / 2 - first.height / 2;
} else {
first.y = first.startY + first.totalHeight / 2 - first.height / 2;
for (var i = 1; i < len; i++) {
var c = children[i];
c.startY = children[i - 1].startY + children[i - 1].totalHeight;
c.y = c.startY + c.totalHeight / 2 - c.height / 2;
}
}
}
}); // third walk
thirdWalk(root);
};
/***/ })
/******/ ]);
});
//# sourceMappingURL=hierarchy.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/augment.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/augment.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mix_1 = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
var augment = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var c = args[0];
for (var i = 1; i < args.length; i++) {
var obj = args[i];
if (is_function_1.default(obj)) {
obj = obj.prototype;
}
mix_1.default(c.prototype, obj);
}
};
exports.default = augment;
//# sourceMappingURL=augment.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/cache.js":
/*!****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/cache.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* k-v 存储
*/
var default_1 = /** @class */ (function () {
function default_1() {
this.map = {};
}
default_1.prototype.has = function (key) {
return this.map[key] !== undefined;
};
default_1.prototype.get = function (key, def) {
var v = this.map[key];
return v === undefined ? def : v;
};
default_1.prototype.set = function (key, value) {
this.map[key] = value;
};
default_1.prototype.clear = function () {
this.map = {};
};
default_1.prototype.delete = function (key) {
delete this.map[key];
};
default_1.prototype.size = function () {
return Object.keys(this.map).length;
};
return default_1;
}());
exports.default = default_1;
//# sourceMappingURL=cache.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clamp.js":
/*!****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/clamp.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var clamp = function (a, min, max) {
if (a < min) {
return min;
}
else if (a > max) {
return max;
}
return a;
};
exports.default = clamp;
//# sourceMappingURL=clamp.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js":
/*!********************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function cancelAnimationFrame(handler) {
var method = window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
// @ts-ignore
window.mozCancelAnimationFrame ||
// @ts-ignore
window.msCancelAnimationFrame ||
clearTimeout;
method(handler);
}
exports.default = cancelAnimationFrame;
;
//# sourceMappingURL=clear-animation-frame.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clone.js":
/*!****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/clone.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var clone = function (obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
var rst;
if (is_array_1.default(obj)) {
rst = [];
for (var i = 0, l = obj.length; i < l; i++) {
if (typeof obj[i] === 'object' && obj[i] != null) {
rst[i] = clone(obj[i]);
}
else {
rst[i] = obj[i];
}
}
}
else {
rst = {};
for (var k in obj) {
if (typeof obj[k] === 'object' && obj[k] != null) {
rst[k] = clone(obj[k]);
}
else {
rst[k] = obj[k];
}
}
}
return rst;
};
exports.default = clone;
//# sourceMappingURL=clone.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/contains.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/contains.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var contains = function (arr, value) {
if (!is_array_like_1.default(arr)) {
return false;
}
return arr.indexOf(value) > -1;
};
exports.default = contains;
//# sourceMappingURL=contains.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/debounce.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/debounce.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function debounce(func, wait, immediate) {
var timeout;
return function () {
var context = this, args = arguments;
var later = function () {
timeout = null;
if (!immediate) {
func.apply(context, args);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
func.apply(context, args);
}
};
}
exports.default = debounce;
//# sourceMappingURL=debounce.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/deep-mix.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/deep-mix.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_plain_object_1 = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-plain-object.js");
var MAX_MIX_LEVEL = 5;
function _deepMix(dist, src, level, maxLevel) {
level = level || 0;
maxLevel = maxLevel || MAX_MIX_LEVEL;
for (var key in src) {
if (src.hasOwnProperty(key)) {
var value = src[key];
if (value !== null && is_plain_object_1.default(value)) {
if (!is_plain_object_1.default(dist[key])) {
dist[key] = {};
}
if (level < maxLevel) {
_deepMix(dist[key], value, level + 1, maxLevel);
}
else {
dist[key] = src[key];
}
}
else if (is_array_1.default(value)) {
dist[key] = [];
dist[key] = dist[key].concat(value);
}
else if (value !== undefined) {
dist[key] = value;
}
}
}
}
// todo 重写
var deepMix = function (rst) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
for (var i = 0; i < args.length; i += 1) {
_deepMix(rst, args[i]);
}
return rst;
};
exports.default = deepMix;
//# sourceMappingURL=deep-mix.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/difference.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/difference.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var filter_1 = __webpack_require__(/*! ./filter */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/filter.js");
var contains_1 = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/contains.js");
/**
* Flattens `array` a single level deep.
*
* @param {Array} arr The array to inspect.
* @param {Array} values The values to exclude.
* @return {Array} Returns the new array of filtered values.
* @example
* difference([2, 1], [2, 3]); // => [1]
*/
var difference = function (arr, values) {
if (values === void 0) { values = []; }
return filter_1.default(arr, function (value) { return !contains_1.default(values, value); });
};
exports.default = difference;
//# sourceMappingURL=difference.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_object_1 = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
function each(elements, func) {
if (!elements) {
return;
}
var rst;
if (is_array_1.default(elements)) {
for (var i = 0, len = elements.length; i < len; i++) {
rst = func(elements[i], i);
if (rst === false) {
break;
}
}
}
else if (is_object_1.default(elements)) {
for (var k in elements) {
if (elements.hasOwnProperty(k)) {
rst = func(elements[k], k);
if (rst === false) {
break;
}
}
}
}
}
exports.default = each;
//# sourceMappingURL=each.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/ends-with.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/ends-with.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_string_1 = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
function endsWith(arr, e) {
return (is_array_1.default(arr) || is_string_1.default(arr)) ? arr[arr.length - 1] === e : false;
}
exports.default = endsWith;
//# sourceMappingURL=ends-with.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/every.js":
/*!****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/every.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 只要有一个不满足条件就返回 false
* @param arr
* @param func
*/
var every = function (arr, func) {
for (var i = 0; i < arr.length; i++) {
if (!func(arr[i], i))
return false;
}
return true;
};
exports.default = every;
//# sourceMappingURL=every.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/extend.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/extend.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mix_1 = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
var extend = function (subclass, superclass, overrides, staticOverrides) {
// 如果只提供父类构造函数,则自动生成子类构造函数
if (!is_function_1.default(superclass)) {
overrides = superclass;
superclass = subclass;
subclass = function () { };
}
var create = Object.create ?
function (proto, c) {
return Object.create(proto, {
constructor: {
value: c
}
});
} :
function (proto, c) {
function Tmp() { }
Tmp.prototype = proto;
var o = new Tmp();
o.constructor = c;
return o;
};
var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype
subclass.prototype = mix_1.default(superObj, subclass.prototype); // 指定子类的prototype
subclass.superclass = create(superclass.prototype, superclass);
mix_1.default(superObj, overrides);
mix_1.default(subclass, staticOverrides);
return subclass;
};
exports.default = extend;
//# sourceMappingURL=extend.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/filter.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/filter.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var filter = function (arr, func) {
if (!is_array_like_1.default(arr)) {
return arr;
}
var result = [];
for (var index = 0; index < arr.length; index++) {
var value = arr[index];
if (func(value, index)) {
result.push(value);
}
}
return result;
};
exports.default = filter;
//# sourceMappingURL=filter.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/find-index.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/find-index.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function findIndex(arr, predicate, fromIndex) {
if (fromIndex === void 0) { fromIndex = 0; }
for (var i = fromIndex; i < arr.length; i++) {
if (predicate(arr[i], i)) {
// 找到终止循环
return i;
}
}
return -1;
}
exports.default = findIndex;
//# sourceMappingURL=find-index.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/find.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/find.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
var is_match_1 = __webpack_require__(/*! ./is-match */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-match.js");
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_plain_object_1 = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-plain-object.js");
function find(arr, predicate) {
if (!is_array_1.default(arr))
return null;
var _predicate;
if (is_function_1.default(predicate)) {
_predicate = predicate;
}
if (is_plain_object_1.default(predicate)) {
_predicate = function (a) { return is_match_1.default(a, predicate); };
}
if (_predicate) {
for (var i = 0; i < arr.length; i += 1) {
if (_predicate(arr[i])) {
return arr[i];
}
}
}
return null;
}
exports.default = find;
//# sourceMappingURL=find.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/first-value.js":
/*!**********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/first-value.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var firstValue = function (data, name) {
var rst = null;
for (var i = 0; i < data.length; i++) {
var obj = data[i];
var value = obj[name];
if (!is_nil_1.default(value)) {
if (is_array_1.default(value)) {
rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云
}
else {
rst = value;
}
break;
}
}
return rst;
};
exports.default = firstValue;
//# sourceMappingURL=first-value.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/fixed-base.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/fixed-base.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fixedBase = function (v, base) {
var str = base.toString();
var index = str.indexOf('.');
if (index === -1) {
return Math.round(v);
}
var length = str.substr(index + 1).length;
if (length > 20) {
length = 20;
}
return parseFloat(v.toFixed(length));
};
exports.default = fixedBase;
//# sourceMappingURL=fixed-base.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/flatten-deep.js":
/*!***********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/flatten-deep.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
/**
* Flattens `array` a single level deep.
*
* @param {Array} arr The array to flatten.
* @param {Array} result The array to return.
* @return {Array} Returns the new flattened array.
* @example
*
* flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]
*/
var flattenDeep = function (arr, result) {
if (result === void 0) { result = []; }
if (!is_array_1.default(arr)) {
result.push(arr);
}
else {
for (var i = 0; i < arr.length; i += 1) {
flattenDeep(arr[i], result);
}
}
return result;
};
exports.default = flattenDeep;
//# sourceMappingURL=flatten-deep.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/flatten.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/flatten.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
/**
* Flattens `array` a single level deep.
*
* @param {Array} arr The array to flatten.
* @return {Array} Returns the new flattened array.
* @example
*
* flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]
*/
var flatten = function (arr) {
if (!is_array_1.default(arr)) {
return [];
}
var rst = [];
for (var i = 0; i < arr.length; i++) {
rst = rst.concat(arr[i]);
}
return rst;
};
exports.default = flatten;
//# sourceMappingURL=flatten.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/for-in.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/for-in.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
exports.default = each_1.default;
//# sourceMappingURL=for-in.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-range.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-range.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var getRange = function (values) {
// 存在 NaN 时min,max 判定会出问题
var filterValues = values.filter(function (v) { return !isNaN(v); });
if (!filterValues.length) { // 如果没有数值则直接返回0
return {
min: 0,
max: 0,
};
}
if (is_array_1.default(values[0])) {
var tmp = [];
for (var i = 0; i < values.length; i++) {
tmp = tmp.concat(values[i]);
}
filterValues = tmp;
}
var max = Math.max.apply(null, filterValues);
var min = Math.min.apply(null, filterValues);
return {
min: min,
max: max,
};
};
exports.default = getRange;
//# sourceMappingURL=get-range.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-type.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-type.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var toString = {}.toString;
var getType = function (value) {
return toString.call(value).replace(/^\[object /, '').replace(/]$/, '');
};
exports.default = getType;
//# sourceMappingURL=get-type.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-wrap-behavior.js":
/*!****************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-wrap-behavior.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 获取封装的事件
* @protected
* @param {Object} obj 对象
* @param {String} action 事件名称
* @return {Function} 返回事件处理函数
*/
function getWrapBehavior(obj, action) {
return obj['_wrap_' + action];
}
exports.default = getWrapBehavior;
//# sourceMappingURL=get-wrap-behavior.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get.js":
/*!**************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/get.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_string_1 = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
/**
* https://github.com/developit/dlv/blob/master/index.js
* @param obj
* @param key
* @param defaultValue
*/
exports.default = (function (obj, key, defaultValue) {
var p = 0;
var keyArr = is_string_1.default(key) ? key.split('.') : key;
while (obj && p < keyArr.length) {
obj = obj[keyArr[p++]];
}
return (obj === undefined || p < keyArr.length) ? defaultValue : obj;
});
//# sourceMappingURL=get.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-by.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-by.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
var hasOwnProperty = Object.prototype.hasOwnProperty;
function groupBy(data, condition) {
if (!condition || !is_array_1.default(data)) {
return {};
}
var result = {};
// 兼容方法和 字符串的写法
var predicate = is_function_1.default(condition) ? condition : function (item) { return item[condition]; };
var key;
for (var i = 0; i < data.length; i++) {
var item = data[i];
key = predicate(item);
if (hasOwnProperty.call(result, key)) {
result[key].push(item);
}
else {
result[key] = [item];
}
}
return result;
}
exports.default = groupBy;
//# sourceMappingURL=group-by.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-to-map.js":
/*!***********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-to-map.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
var group_by_1 = __webpack_require__(/*! ./group-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-by.js");
var groupToMap = function (data, condition) {
if (!condition) {
return {
0: data,
};
}
if (!is_function_1.default(condition)) {
var paramsCondition_1 = is_array_1.default(condition) ? condition : condition.replace(/\s+/g, '').split('*');
condition = function (row) {
var unique = '_'; // 避免出现数字作为Key的情况会进行按照数字的排序
for (var i = 0, l = paramsCondition_1.length; i < l; i++) {
unique += row[paramsCondition_1[i]] && row[paramsCondition_1[i]].toString();
}
return unique;
};
}
var groups = group_by_1.default(data, condition);
return groups;
};
exports.default = groupToMap;
//# sourceMappingURL=group-to-map.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group.js":
/*!****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/group.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var group_to_map_1 = __webpack_require__(/*! ./group-to-map */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-to-map.js");
exports.default = (function (data, condition) {
if (!condition) {
// 没有条件,则自身改成数组
return [data];
}
var groups = group_to_map_1.default(data, condition);
var array = [];
for (var i in groups) {
array.push(groups[i]);
}
return array;
});
//# sourceMappingURL=group.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/has-key.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/has-key.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var has_1 = __webpack_require__(/*! ./has */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/has.js");
exports.default = has_1.default;
//# sourceMappingURL=has-key.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/has-value.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/has-value.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var contains_1 = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/contains.js");
var values_1 = __webpack_require__(/*! ./values */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/values.js");
exports.default = (function (obj, value) { return contains_1.default(values_1.default(obj), value); });
//# sourceMappingURL=has-value.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/has.js":
/*!**************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/has.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (function (obj, key) { return obj.hasOwnProperty(key); });
//# sourceMappingURL=has.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/head.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/head.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
function head(o) {
if (is_array_like_1.default(o)) {
return o[0];
}
return undefined;
}
exports.default = head;
//# sourceMappingURL=head.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/identity.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/identity.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (function (v) { return v; });
//# sourceMappingURL=identity.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index-of.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/index-of.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var indexOf = function (arr, obj) {
if (!is_array_like_1.default(arr)) {
return -1;
}
var m = Array.prototype.indexOf;
if (m) {
return m.call(arr, obj);
}
var index = -1;
for (var i = 0; i < arr.length; i++) {
if (arr[i] === obj) {
index = i;
break;
}
}
return index;
};
exports.default = indexOf;
//# sourceMappingURL=index-of.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js":
/*!****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// array
var contains_1 = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/contains.js");
exports.contains = contains_1.default;
exports.includes = contains_1.default;
var difference_1 = __webpack_require__(/*! ./difference */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/difference.js");
exports.difference = difference_1.default;
var find_1 = __webpack_require__(/*! ./find */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/find.js");
exports.find = find_1.default;
var find_index_1 = __webpack_require__(/*! ./find-index */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/find-index.js");
exports.findIndex = find_index_1.default;
var first_value_1 = __webpack_require__(/*! ./first-value */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/first-value.js");
exports.firstValue = first_value_1.default;
var flatten_1 = __webpack_require__(/*! ./flatten */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/flatten.js");
exports.flatten = flatten_1.default;
var flatten_deep_1 = __webpack_require__(/*! ./flatten-deep */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/flatten-deep.js");
exports.flattenDeep = flatten_deep_1.default;
var get_range_1 = __webpack_require__(/*! ./get-range */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-range.js");
exports.getRange = get_range_1.default;
var pull_1 = __webpack_require__(/*! ./pull */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/pull.js");
exports.pull = pull_1.default;
var pull_at_1 = __webpack_require__(/*! ./pull-at */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/pull-at.js");
exports.pullAt = pull_at_1.default;
var reduce_1 = __webpack_require__(/*! ./reduce */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/reduce.js");
exports.reduce = reduce_1.default;
var remove_1 = __webpack_require__(/*! ./remove */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/remove.js");
exports.remove = remove_1.default;
var sort_by_1 = __webpack_require__(/*! ./sort-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/sort-by.js");
exports.sortBy = sort_by_1.default;
var union_1 = __webpack_require__(/*! ./union */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/union.js");
exports.union = union_1.default;
var uniq_1 = __webpack_require__(/*! ./uniq */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/uniq.js");
exports.uniq = uniq_1.default;
var values_of_key_1 = __webpack_require__(/*! ./values-of-key */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/values-of-key.js");
exports.valuesOfKey = values_of_key_1.default;
var head_1 = __webpack_require__(/*! ./head */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/head.js");
exports.head = head_1.default;
var last_1 = __webpack_require__(/*! ./last */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/last.js");
exports.last = last_1.default;
var starts_with_1 = __webpack_require__(/*! ./starts-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/starts-with.js");
exports.startsWith = starts_with_1.default;
var ends_with_1 = __webpack_require__(/*! ./ends-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/ends-with.js");
exports.endsWith = ends_with_1.default;
var filter_1 = __webpack_require__(/*! ./filter */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/filter.js");
exports.filter = filter_1.default;
var every_1 = __webpack_require__(/*! ./every */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/every.js");
exports.every = every_1.default;
var some_1 = __webpack_require__(/*! ./some */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/some.js");
exports.some = some_1.default;
var group_1 = __webpack_require__(/*! ./group */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group.js");
exports.group = group_1.default;
var group_by_1 = __webpack_require__(/*! ./group-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-by.js");
exports.groupBy = group_by_1.default;
var group_to_map_1 = __webpack_require__(/*! ./group-to-map */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/group-to-map.js");
exports.groupToMap = group_to_map_1.default;
// event
var get_wrap_behavior_1 = __webpack_require__(/*! ./get-wrap-behavior */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-wrap-behavior.js");
exports.getWrapBehavior = get_wrap_behavior_1.default;
var wrap_behavior_1 = __webpack_require__(/*! ./wrap-behavior */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/wrap-behavior.js");
exports.wrapBehavior = wrap_behavior_1.default;
// format
var number2color_1 = __webpack_require__(/*! ./number2color */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/number2color.js");
exports.number2color = number2color_1.default;
var parse_radius_1 = __webpack_require__(/*! ./parse-radius */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/parse-radius.js");
exports.parseRadius = parse_radius_1.default;
// math
var clamp_1 = __webpack_require__(/*! ./clamp */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clamp.js");
exports.clamp = clamp_1.default;
var fixed_base_1 = __webpack_require__(/*! ./fixed-base */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/fixed-base.js");
exports.fixedBase = fixed_base_1.default;
var is_decimal_1 = __webpack_require__(/*! ./is-decimal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-decimal.js");
exports.isDecimal = is_decimal_1.default;
var is_even_1 = __webpack_require__(/*! ./is-even */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-even.js");
exports.isEven = is_even_1.default;
var is_integer_1 = __webpack_require__(/*! ./is-integer */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-integer.js");
exports.isInteger = is_integer_1.default;
var is_negative_1 = __webpack_require__(/*! ./is-negative */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-negative.js");
exports.isNegative = is_negative_1.default;
var is_number_equal_1 = __webpack_require__(/*! ./is-number-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js");
exports.isNumberEqual = is_number_equal_1.default;
var is_odd_1 = __webpack_require__(/*! ./is-odd */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-odd.js");
exports.isOdd = is_odd_1.default;
var is_positive_1 = __webpack_require__(/*! ./is-positive */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-positive.js");
exports.isPositive = is_positive_1.default;
var max_by_1 = __webpack_require__(/*! ./max-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/max-by.js");
exports.maxBy = max_by_1.default;
var min_by_1 = __webpack_require__(/*! ./min-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/min-by.js");
exports.minBy = min_by_1.default;
var mod_1 = __webpack_require__(/*! ./mod */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js");
exports.mod = mod_1.default;
var to_degree_1 = __webpack_require__(/*! ./to-degree */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-degree.js");
exports.toDegree = to_degree_1.default;
var to_integer_1 = __webpack_require__(/*! ./to-integer */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-integer.js");
exports.toInteger = to_integer_1.default;
var to_radian_1 = __webpack_require__(/*! ./to-radian */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js");
exports.toRadian = to_radian_1.default;
// object
var for_in_1 = __webpack_require__(/*! ./for-in */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/for-in.js");
exports.forIn = for_in_1.default;
var has_1 = __webpack_require__(/*! ./has */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/has.js");
exports.has = has_1.default;
var has_key_1 = __webpack_require__(/*! ./has-key */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/has-key.js");
exports.hasKey = has_key_1.default;
var has_value_1 = __webpack_require__(/*! ./has-value */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/has-value.js");
exports.hasValue = has_value_1.default;
var keys_1 = __webpack_require__(/*! ./keys */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/keys.js");
exports.keys = keys_1.default;
var is_match_1 = __webpack_require__(/*! ./is-match */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-match.js");
exports.isMatch = is_match_1.default;
var values_1 = __webpack_require__(/*! ./values */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/values.js");
exports.values = values_1.default;
// string
var lower_case_1 = __webpack_require__(/*! ./lower-case */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/lower-case.js");
exports.lowerCase = lower_case_1.default;
var lower_first_1 = __webpack_require__(/*! ./lower-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/lower-first.js");
exports.lowerFirst = lower_first_1.default;
var substitute_1 = __webpack_require__(/*! ./substitute */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/substitute.js");
exports.substitute = substitute_1.default;
var upper_case_1 = __webpack_require__(/*! ./upper-case */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-case.js");
exports.upperCase = upper_case_1.default;
var upper_first_1 = __webpack_require__(/*! ./upper-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js");
exports.upperFirst = upper_first_1.default;
// type
var get_type_1 = __webpack_require__(/*! ./get-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-type.js");
exports.getType = get_type_1.default;
var is_arguments_1 = __webpack_require__(/*! ./is-arguments */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-arguments.js");
exports.isArguments = is_arguments_1.default;
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
exports.isArray = is_array_1.default;
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
exports.isArrayLike = is_array_like_1.default;
var is_boolean_1 = __webpack_require__(/*! ./is-boolean */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-boolean.js");
exports.isBoolean = is_boolean_1.default;
var is_date_1 = __webpack_require__(/*! ./is-date */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-date.js");
exports.isDate = is_date_1.default;
var is_error_1 = __webpack_require__(/*! ./is-error */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-error.js");
exports.isError = is_error_1.default;
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
exports.isFunction = is_function_1.default;
var is_finite_1 = __webpack_require__(/*! ./is-finite */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-finite.js");
exports.isFinite = is_finite_1.default;
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
exports.isNil = is_nil_1.default;
var is_null_1 = __webpack_require__(/*! ./is-null */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-null.js");
exports.isNull = is_null_1.default;
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
exports.isNumber = is_number_1.default;
var is_object_1 = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
exports.isObject = is_object_1.default;
var is_object_like_1 = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object-like.js");
exports.isObjectLike = is_object_like_1.default;
var is_plain_object_1 = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-plain-object.js");
exports.isPlainObject = is_plain_object_1.default;
var is_prototype_1 = __webpack_require__(/*! ./is-prototype */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-prototype.js");
exports.isPrototype = is_prototype_1.default;
var is_reg_exp_1 = __webpack_require__(/*! ./is-reg-exp */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-reg-exp.js");
exports.isRegExp = is_reg_exp_1.default;
var is_string_1 = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
exports.isString = is_string_1.default;
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
exports.isType = is_type_1.default;
var is_undefined_1 = __webpack_require__(/*! ./is-undefined */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-undefined.js");
exports.isUndefined = is_undefined_1.default;
var is_element_1 = __webpack_require__(/*! ./is-element */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-element.js");
exports.isElement = is_element_1.default;
var request_animation_frame_1 = __webpack_require__(/*! ./request-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js");
exports.requestAnimationFrame = request_animation_frame_1.default;
var clear_animation_frame_1 = __webpack_require__(/*! ./clear-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js");
exports.clearAnimationFrame = clear_animation_frame_1.default;
// other
var augment_1 = __webpack_require__(/*! ./augment */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/augment.js");
exports.augment = augment_1.default;
var clone_1 = __webpack_require__(/*! ./clone */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clone.js");
exports.clone = clone_1.default;
var debounce_1 = __webpack_require__(/*! ./debounce */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/debounce.js");
exports.debounce = debounce_1.default;
var memoize_1 = __webpack_require__(/*! ./memoize */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/memoize.js");
exports.memoize = memoize_1.default;
var deep_mix_1 = __webpack_require__(/*! ./deep-mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/deep-mix.js");
exports.deepMix = deep_mix_1.default;
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
exports.each = each_1.default;
var extend_1 = __webpack_require__(/*! ./extend */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/extend.js");
exports.extend = extend_1.default;
var index_of_1 = __webpack_require__(/*! ./index-of */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index-of.js");
exports.indexOf = index_of_1.default;
var is_empty_1 = __webpack_require__(/*! ./is-empty */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-empty.js");
exports.isEmpty = is_empty_1.default;
var is_equal_1 = __webpack_require__(/*! ./is-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-equal.js");
exports.isEqual = is_equal_1.default;
var is_equal_with_1 = __webpack_require__(/*! ./is-equal-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-equal-with.js");
exports.isEqualWith = is_equal_with_1.default;
var map_1 = __webpack_require__(/*! ./map */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/map.js");
exports.map = map_1.default;
var map_values_1 = __webpack_require__(/*! ./map-values */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/map-values.js");
exports.mapValues = map_values_1.default;
var mix_1 = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js");
exports.mix = mix_1.default;
exports.assign = mix_1.default;
var get_1 = __webpack_require__(/*! ./get */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get.js");
exports.get = get_1.default;
var set_1 = __webpack_require__(/*! ./set */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/set.js");
exports.set = set_1.default;
var pick_1 = __webpack_require__(/*! ./pick */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/pick.js");
exports.pick = pick_1.default;
var throttle_1 = __webpack_require__(/*! ./throttle */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/throttle.js");
exports.throttle = throttle_1.default;
var to_array_1 = __webpack_require__(/*! ./to-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-array.js");
exports.toArray = to_array_1.default;
var to_string_1 = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js");
exports.toString = to_string_1.default;
var unique_id_1 = __webpack_require__(/*! ./unique-id */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/unique-id.js");
exports.uniqueId = unique_id_1.default;
var noop_1 = __webpack_require__(/*! ./noop */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/noop.js");
exports.noop = noop_1.default;
var identity_1 = __webpack_require__(/*! ./identity */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/identity.js");
exports.identity = identity_1.default;
var size_1 = __webpack_require__(/*! ./size */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/size.js");
exports.size = size_1.default;
// 不知道为什么,需要把这个 export不然 ts 会报类型错误
var cache_1 = __webpack_require__(/*! ./cache */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/cache.js");
exports.Cache = cache_1.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-arguments.js":
/*!***********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-arguments.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 是否是参数类型
*
* @param {Object} value 测试的值
* @return {Boolean}
*/
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
var isArguments = function (value) {
return is_type_1.default(value, 'Arguments');
};
exports.default = isArguments;
//# sourceMappingURL=is-arguments.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js":
/*!************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isArrayLike = function (value) {
/**
* isArrayLike([1, 2, 3]) => true
* isArrayLike(document.body.children) => true
* isArrayLike('abc') => true
* isArrayLike(Function) => false
*/
return value !== null && typeof value !== 'function' && isFinite(value.length);
};
exports.default = isArrayLike;
//# sourceMappingURL=is-array-like.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
exports.default = (function (value) {
return Array.isArray ?
Array.isArray(value) :
is_type_1.default(value, 'Array');
});
//# sourceMappingURL=is-array.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-boolean.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-boolean.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 是否是布尔类型
*
* @param {Object} value 测试的值
* @return {Boolean}
*/
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
var isBoolean = function (value) {
return is_type_1.default(value, 'Boolean');
};
exports.default = isBoolean;
//# sourceMappingURL=is-boolean.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-date.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-date.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
var isDate = function (value) {
return is_type_1.default(value, 'Date');
};
exports.default = isDate;
//# sourceMappingURL=is-date.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-decimal.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-decimal.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
var isDecimal = function (num) {
return is_number_1.default(num) && num % 1 !== 0;
};
exports.default = isDecimal;
//# sourceMappingURL=is-decimal.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-element.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-element.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 判断是否HTML元素
* @return {Boolean} 是否HTML元素
*/
var isElement = function (o) {
return o instanceof Element || o instanceof HTMLDocument;
};
exports.default = isElement;
//# sourceMappingURL=is-element.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-empty.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-empty.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var get_type_1 = __webpack_require__(/*! ./get-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/get-type.js");
var is_prototype_1 = __webpack_require__(/*! ./is-prototype */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-prototype.js");
var hasOwnProperty = Object.prototype.hasOwnProperty;
function isEmpty(value) {
/**
* isEmpty(null) => true
* isEmpty() => true
* isEmpty(true) => true
* isEmpty(1) => true
* isEmpty([1, 2, 3]) => false
* isEmpty('abc') => false
* isEmpty({ a: 1 }) => false
*/
if (is_nil_1.default(value)) {
return true;
}
if (is_array_like_1.default(value)) {
return !value.length;
}
var type = get_type_1.default(value);
if (type === 'Map' || type === 'Set') {
return !value.size;
}
if (is_prototype_1.default(value)) {
return !Object.keys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
exports.default = isEmpty;
//# sourceMappingURL=is-empty.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-equal-with.js":
/*!************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-equal-with.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
var is_equal_1 = __webpack_require__(/*! ./is-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-equal.js");
/**
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [fn] 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
*/
exports.default = (function (value, other, fn) {
if (!is_function_1.default(fn)) {
return is_equal_1.default(value, other);
}
return !!fn(value, other);
});
//# sourceMappingURL=is-equal-with.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-equal.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-equal.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_object_like_1 = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object-like.js");
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var is_string_1 = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
var isEqual = function (value, other) {
if (value === other) {
return true;
}
if (!value || !other) {
return false;
}
if (is_string_1.default(value) || is_string_1.default(other)) {
return false;
}
if (is_array_like_1.default(value) || is_array_like_1.default(other)) {
if (value.length !== other.length) {
return false;
}
var rst = true;
for (var i = 0; i < value.length; i++) {
rst = isEqual(value[i], other[i]);
if (!rst) {
break;
}
}
return rst;
}
if (is_object_like_1.default(value) || is_object_like_1.default(other)) {
var valueKeys = Object.keys(value);
var otherKeys = Object.keys(other);
if (valueKeys.length !== otherKeys.length) {
return false;
}
var rst = true;
for (var i = 0; i < valueKeys.length; i++) {
rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);
if (!rst) {
break;
}
}
return rst;
}
return false;
};
exports.default = isEqual;
//# sourceMappingURL=is-equal.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-error.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-error.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 是否是参数类型
*
* @param {Object} value 测试的值
* @return {Boolean}
*/
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
var isError = function (value) {
return is_type_1.default(value, 'Error');
};
exports.default = isError;
//# sourceMappingURL=is-error.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-even.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-even.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
var isEven = function (num) {
return is_number_1.default(num) && num % 2 === 0;
};
exports.default = isEven;
//# sourceMappingURL=is-even.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-finite.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-finite.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 判断是否为有限数
* @return {Boolean}
*/
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
function default_1(value) {
return is_number_1.default(value) && isFinite(value);
}
exports.default = default_1;
//# sourceMappingURL=is-finite.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js":
/*!**********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 是否为函数
* @param {*} fn 对象
* @return {Boolean} 是否函数
*/
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
exports.default = (function (value) {
return is_type_1.default(value, 'Function');
});
//# sourceMappingURL=is-function.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-integer.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-integer.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
var isInteger = Number.isInteger ? Number.isInteger : function (num) {
return is_number_1.default(num) && num % 1 === 0;
};
exports.default = isInteger;
//# sourceMappingURL=is-integer.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-match.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-match.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
var keys_1 = __webpack_require__(/*! ./keys */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/keys.js");
function isMatch(obj, attrs) {
var _keys = keys_1.default(attrs);
var length = _keys.length;
if (is_nil_1.default(obj))
return !length;
for (var i = 0; i < length; i += 1) {
var key = _keys[i];
if (attrs[key] !== obj[key] || !(key in obj)) {
return false;
}
}
return true;
}
exports.default = isMatch;
//# sourceMappingURL=is-match.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-negative.js":
/*!**********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-negative.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
var isNegative = function (num) {
return is_number_1.default(num) && num < 0;
};
exports.default = isNegative;
//# sourceMappingURL=is-negative.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// isFinite,
var isNil = function (value) {
/**
* isNil(null) => true
* isNil() => true
*/
return value === null || value === undefined;
};
exports.default = isNil;
//# sourceMappingURL=is-nil.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-null.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-null.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isNull = function (value) {
return value === null;
};
exports.default = isNull;
//# sourceMappingURL=is-null.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js":
/*!**************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var PRECISION = 0.00001; // numbers less than this is considered as 0
function isNumberEqual(a, b, precision) {
if (precision === void 0) { precision = PRECISION; }
return Math.abs((a - b)) < precision;
}
exports.default = isNumberEqual;
;
//# sourceMappingURL=is-number-equal.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 判断是否数字
* @return {Boolean} 是否数字
*/
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
var isNumber = function (value) {
return is_type_1.default(value, 'Number');
};
exports.default = isNumber;
//# sourceMappingURL=is-number.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object-like.js":
/*!*************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object-like.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isObjectLike = function (value) {
/**
* isObjectLike({}) => true
* isObjectLike([1, 2, 3]) => true
* isObjectLike(Function) => false
* isObjectLike(null) => false
*/
return typeof value === 'object' && value !== null;
};
exports.default = isObjectLike;
//# sourceMappingURL=is-object-like.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (function (value) {
/**
* isObject({}) => true
* isObject([1, 2, 3]) => true
* isObject(Function) => true
* isObject(null) => false
*/
var type = typeof value;
return value !== null && type === 'object' || type === 'function';
});
//# sourceMappingURL=is-object.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-odd.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-odd.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
var isOdd = function (num) {
return is_number_1.default(num) && num % 2 !== 0;
};
exports.default = isOdd;
//# sourceMappingURL=is-odd.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-plain-object.js":
/*!**************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-plain-object.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_object_like_1 = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object-like.js");
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
var isPlainObject = function (value) {
/**
* isObjectLike(new Foo) => false
* isObjectLike([1, 2, 3]) => false
* isObjectLike({ x: 0, y: 0 }) => true
* isObjectLike(Object.create(null)) => true
*/
if (!is_object_like_1.default(value) || !is_type_1.default(value, 'Object')) {
return false;
}
if (Object.getPrototypeOf(value) === null) {
return true;
}
var proto = value;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(value) === proto;
};
exports.default = isPlainObject;
//# sourceMappingURL=is-plain-object.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-positive.js":
/*!**********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-positive.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
var isPositive = function (num) {
return is_number_1.default(num) && num > 0;
};
exports.default = isPositive;
//# sourceMappingURL=is-positive.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-prototype.js":
/*!***********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-prototype.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var objectProto = Object.prototype;
var isPrototype = function (value) {
var Ctor = value && value.constructor;
var proto = (typeof Ctor === 'function' && Ctor.prototype) || objectProto;
return value === proto;
};
exports.default = isPrototype;
//# sourceMappingURL=is-prototype.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-reg-exp.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-reg-exp.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
var isRegExp = function (str) {
return is_type_1.default(str, 'RegExp');
};
exports.default = isRegExp;
//# sourceMappingURL=is-reg-exp.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
exports.default = (function (str) {
return is_type_1.default(str, 'String');
});
//# sourceMappingURL=is-string.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var toString = {}.toString;
var isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };
exports.default = isType;
//# sourceMappingURL=is-type.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-undefined.js":
/*!***********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-undefined.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isUndefined = function (value) {
return value === undefined;
};
exports.default = isUndefined;
//# sourceMappingURL=is-undefined.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/keys.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/keys.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
var keys = Object.keys ? function (obj) { return Object.keys(obj); } : function (obj) {
var result = [];
each_1.default(obj, function (value, key) {
if (!(is_function_1.default(obj) && key === 'prototype')) {
result.push(key);
}
});
return result;
};
exports.default = keys;
//# sourceMappingURL=keys.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/last.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/last.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
function last(o) {
if (is_array_like_1.default(o)) {
var arr = o;
return arr[arr.length - 1];
}
return undefined;
}
exports.default = last;
//# sourceMappingURL=last.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/lower-case.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/lower-case.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var to_string_1 = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js");
var lowerCase = function (str) {
return to_string_1.default(str).toLowerCase();
};
exports.default = lowerCase;
//# sourceMappingURL=lower-case.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/lower-first.js":
/*!**********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/lower-first.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var to_string_1 = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js");
var lowerFirst = function (value) {
var str = to_string_1.default(value);
return str.charAt(0).toLowerCase() + str.substring(1);
};
exports.default = lowerFirst;
//# sourceMappingURL=lower-first.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/map-values.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/map-values.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
var is_object_1 = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
var identity = function (v) { return v; };
exports.default = (function (object, func) {
if (func === void 0) { func = identity; }
var r = {};
if (is_object_1.default(object) && !is_nil_1.default(object)) {
Object.keys(object).forEach(function (key) {
// @ts-ignore
r[key] = func(object[key], key);
});
}
return r;
});
//# sourceMappingURL=map-values.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/map.js":
/*!**************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/map.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var map = function (arr, func) {
if (!is_array_like_1.default(arr)) {
// @ts-ignore
return arr;
}
var result = [];
for (var index = 0; index < arr.length; index++) {
var value = arr[index];
result.push(func(value, index));
}
return result;
};
exports.default = map;
//# sourceMappingURL=map.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/max-by.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/max-by.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
/**
* @param {Array} arr The array to iterate over.
* @param {Function} [fn] The iteratee invoked per element.
* @return {*} Returns the maximum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* maxBy(objects, function(o) { return o.n; });
* // => { 'n': 2 }
*
* maxBy(objects, 'n');
* // => { 'n': 2 }
*/
exports.default = (function (arr, fn) {
if (!is_array_1.default(arr)) {
return undefined;
}
var max = arr[0];
var maxData;
if (is_function_1.default(fn)) {
maxData = fn(arr[0]);
}
else {
maxData = arr[0][fn];
}
var data;
each_1.default(arr, function (val) {
if (is_function_1.default(fn)) {
data = fn(val);
}
else {
data = val[fn];
}
if (data > maxData) {
max = val;
maxData = data;
}
});
return max;
});
//# sourceMappingURL=max-by.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/memoize.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/memoize.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
/**
* _.memoize(calColor);
* _.memoize(calColor, (...args) => args[0]);
* @param f
* @param resolver
*/
exports.default = (function (f, resolver) {
if (!is_function_1.default(f)) {
throw new TypeError('Expected a function');
}
var memoized = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
// 使用方法构造 key如果不存在 resolver则直接取第一个参数作为 key
var key = resolver ? resolver.apply(this, args) : args[0];
var cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = f.apply(this, args);
// 缓存起来
cache.set(key, result);
return result;
};
memoized.cache = new Map();
return memoized;
});
//# sourceMappingURL=memoize.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/min-by.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/min-by.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
/**
* @param {Array} arr The array to iterate over.
* @param {Function} [fn] The iteratee invoked per element.
* @return {*} Returns the minimum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* minBy(objects, function(o) { return o.n; });
* // => { 'n': 1 }
*
* minBy(objects, 'n');
* // => { 'n': 1 }
*/
exports.default = (function (arr, fn) {
if (!is_array_1.default(arr)) {
return undefined;
}
var min = arr[0];
var minData;
if (is_function_1.default(fn)) {
minData = fn(arr[0]);
}
else {
minData = arr[0][fn];
}
var data;
each_1.default(arr, function (val) {
if (is_function_1.default(fn)) {
data = fn(val);
}
else {
data = val[fn];
}
if (data < minData) {
min = val;
minData = data;
}
});
return min;
});
//# sourceMappingURL=min-by.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js":
/*!**************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// FIXME: Mutable param should be forbidden in static lang.
function _mix(dist, obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {
dist[key] = obj[key];
}
}
}
function mix(dist, src1, src2, src3) {
if (src1)
_mix(dist, src1);
if (src2)
_mix(dist, src2);
if (src3)
_mix(dist, src3);
return dist;
}
exports.default = mix;
//# sourceMappingURL=mix.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js":
/*!**************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mod = function (n, m) {
return ((n % m) + m) % m;
};
exports.default = mod;
//# sourceMappingURL=mod.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/noop.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/noop.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (function () { });
//# sourceMappingURL=noop.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/number2color.js":
/*!***********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/number2color.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var numColorCache = {};
function numberToColor(num) {
// 增加缓存
var color = numColorCache[num];
if (!color) {
var str = num.toString(16);
for (var i = str.length; i < 6; i++) {
str = '0' + str;
}
color = '#' + str;
numColorCache[num] = color;
}
return color;
}
exports.default = numberToColor;
//# sourceMappingURL=number2color.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/parse-radius.js":
/*!***********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/parse-radius.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
function parseRadius(radius) {
var r1 = 0, r2 = 0, r3 = 0, r4 = 0;
if (is_array_1.default(radius)) {
if (radius.length === 1) {
r1 = r2 = r3 = r4 = radius[0];
}
else if (radius.length === 2) {
r1 = r3 = radius[0];
r2 = r4 = radius[1];
}
else if (radius.length === 3) {
r1 = radius[0];
r2 = r4 = radius[1];
r3 = radius[2];
}
else {
r1 = radius[0];
r2 = radius[1];
r3 = radius[2];
r4 = radius[3];
}
}
else {
r1 = r2 = r3 = r4 = radius;
}
return {
r1: r1,
r2: r2,
r3: r3,
r4: r4
};
}
exports.default = parseRadius;
//# sourceMappingURL=parse-radius.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/pick.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/pick.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
var is_plain_object_1 = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-plain-object.js");
var hasOwnProperty = Object.prototype.hasOwnProperty;
exports.default = (function (object, keys) {
if (object === null || !is_plain_object_1.default(object)) {
return {};
}
var result = {};
each_1.default(keys, function (key) {
if (hasOwnProperty.call(object, key)) {
result[key] = object[key];
}
});
return result;
});
//# sourceMappingURL=pick.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/pull-at.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/pull-at.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var splice = Array.prototype.splice;
var pullAt = function pullAt(arr, indexes) {
if (!is_array_like_1.default(arr)) {
return [];
}
var length = arr ? indexes.length : 0;
var last = length - 1;
while (length--) {
var previous = void 0;
var index = indexes[length];
if (length === last || index !== previous) {
previous = index;
splice.call(arr, index, 1);
}
}
return arr;
};
exports.default = pullAt;
//# sourceMappingURL=pull-at.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/pull.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/pull.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var arrPrototype = Array.prototype;
var splice = arrPrototype.splice;
var indexOf = arrPrototype.indexOf;
var pull = function (arr) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
for (var i = 0; i < values.length; i++) {
var value = values[i];
var fromIndex = -1;
while ((fromIndex = indexOf.call(arr, value)) > -1) {
splice.call(arr, fromIndex, 1);
}
}
return arr;
};
exports.default = pull;
//# sourceMappingURL=pull.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/reduce.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/reduce.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_plain_object_1 = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-plain-object.js");
var reduce = function (arr, fn, init) {
if (!is_array_1.default(arr) && !is_plain_object_1.default(arr)) {
return arr;
}
var result = init;
each_1.default(arr, function (data, i) {
result = fn(result, data, i);
});
return result;
};
exports.default = reduce;
//# sourceMappingURL=reduce.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/remove.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/remove.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
var pull_at_1 = __webpack_require__(/*! ./pull-at */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/pull-at.js");
var remove = function (arr, predicate) {
/**
* const arr = [1, 2, 3, 4]
* const evens = remove(arr, n => n % 2 == 0)
* console.log(arr) // => [1, 3]
* console.log(evens) // => [2, 4]
*/
var result = [];
if (!is_array_like_1.default(arr)) {
return result;
}
var i = -1;
var indexes = [];
var length = arr.length;
while (++i < length) {
var value = arr[i];
if (predicate(value, i, arr)) {
result.push(value);
indexes.push(i);
}
}
pull_at_1.default(arr, indexes);
return result;
};
exports.default = remove;
//# sourceMappingURL=remove.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js":
/*!**********************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function requestAnimationFrame(fn) {
var method = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
// @ts-ignore
window.mozRequestAnimationFrame ||
// @ts-ignore
window.msRequestAnimationFrame ||
function (f) {
return setTimeout(f, 16);
};
return method(fn);
}
exports.default = requestAnimationFrame;
;
//# sourceMappingURL=request-animation-frame.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/set.js":
/*!**************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/set.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_object_1 = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
var is_string_1 = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
var is_number_1 = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number.js");
/**
* https://github.com/developit/dlv/blob/master/index.js
* @param obj
* @param path
* @param value
*/
exports.default = (function (obj, path, value) {
var o = obj;
var keyArr = is_string_1.default(path) ? path.split('.') : path;
keyArr.forEach(function (key, idx) {
// 不是最后一个
if (idx < keyArr.length - 1) {
if (!is_object_1.default(o[key])) {
o[key] = is_number_1.default(keyArr[idx + 1]) ? [] : {};
}
o = o[key];
}
else {
o[key] = value;
}
});
return obj;
});
//# sourceMappingURL=set.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/size.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/size.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
function size(o) {
if (is_nil_1.default(o)) {
return 0;
}
if (is_array_like_1.default(o)) {
return o.length;
}
return Object.keys(o).length;
}
exports.default = size;
//# sourceMappingURL=size.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/some.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/some.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 只要有一个满足条件就返回 true
* @param arr
* @param func
*/
var some = function (arr, func) {
for (var i = 0; i < arr.length; i++) {
if (func(arr[i], i))
return true;
}
return false;
};
exports.default = some;
//# sourceMappingURL=some.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/sort-by.js":
/*!******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/sort-by.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_string_1 = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
function sortBy(arr, key) {
var comparer;
if (is_function_1.default(key)) {
comparer = function (a, b) { return key(a) - key(b); };
}
else {
var keys_1 = [];
if (is_string_1.default(key)) {
keys_1.push(key);
}
else if (is_array_1.default(key)) {
keys_1 = key;
}
comparer = function (a, b) {
for (var i = 0; i < keys_1.length; i += 1) {
var prop = keys_1[i];
if (a[prop] > b[prop]) {
return 1;
}
if (a[prop] < b[prop]) {
return -1;
}
}
return 0;
};
}
arr.sort(comparer);
return arr;
}
exports.default = sortBy;
//# sourceMappingURL=sort-by.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/starts-with.js":
/*!**********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/starts-with.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_string_1 = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
function startsWith(arr, e) {
return (is_array_1.default(arr) || is_string_1.default(arr)) ? arr[0] === e : false;
}
exports.default = startsWith;
//# sourceMappingURL=starts-with.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/substitute.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/substitute.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function substitute(str, o) {
if (!str || !o) {
return str;
}
return str.replace(/\\?\{([^{}]+)\}/g, function (match, name) {
if (match.charAt(0) === '\\') {
return match.slice(1);
}
return (o[name] === undefined) ? '' : o[name];
});
}
exports.default = substitute;
//# sourceMappingURL=substitute.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/throttle.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/throttle.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (function (func, wait, options) {
var timeout, context, args, result;
var previous = 0;
if (!options)
options = {};
var later = function () {
previous = options.leading === false ? 0 : Date.now();
timeout = null;
result = func.apply(context, args);
if (!timeout)
context = args = null;
};
var throttled = function () {
var now = Date.now();
if (!previous && options.leading === false)
previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
previous = now;
result = func.apply(context, args);
if (!timeout)
context = args = null;
}
else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
throttled.cancel = function () {
clearTimeout(timeout);
previous = 0;
timeout = context = args = null;
};
return throttled;
});
//# sourceMappingURL=throttle.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-array.js":
/*!*******************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-array.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array-like.js");
exports.default = (function (value) {
return is_array_like_1.default(value) ? Array.prototype.slice.call(value) : [];
});
//# sourceMappingURL=to-array.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-degree.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-degree.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var DEGREE = 180 / Math.PI;
var toDegree = function (radian) {
return DEGREE * radian;
};
exports.default = toDegree;
//# sourceMappingURL=to-degree.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-integer.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-integer.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = parseInt;
//# sourceMappingURL=to-integer.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var RADIAN = Math.PI / 180;
var toRadian = function (degree) {
return RADIAN * degree;
};
exports.default = toRadian;
//# sourceMappingURL=to-radian.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
exports.default = (function (value) {
if (is_nil_1.default(value))
return '';
return value.toString();
});
//# sourceMappingURL=to-string.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/union.js":
/*!****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/union.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var uniq_1 = __webpack_require__(/*! ./uniq */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/uniq.js");
var union = function () {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
return uniq_1.default([].concat.apply([], sources));
};
exports.default = union;
//# sourceMappingURL=union.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/uniq.js":
/*!***************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/uniq.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var contains_1 = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/contains.js");
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
var uniq = function (arr) {
var resultArr = [];
each_1.default(arr, function (item) {
if (!contains_1.default(resultArr, item)) {
resultArr.push(item);
}
});
return resultArr;
};
exports.default = uniq;
//# sourceMappingURL=uniq.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/unique-id.js":
/*!********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/unique-id.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var map = {};
exports.default = (function (prefix) {
prefix = prefix || 'g';
if (!map[prefix]) {
map[prefix] = 1;
}
else {
map[prefix] += 1;
}
return prefix + map[prefix];
});
//# sourceMappingURL=unique-id.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-case.js":
/*!*********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-case.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var to_string_1 = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js");
var upperCase = function (str) {
return to_string_1.default(str).toUpperCase();
};
exports.default = upperCase;
//# sourceMappingURL=upper-case.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js":
/*!**********************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var to_string_1 = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js");
var upperFirst = function (value) {
var str = to_string_1.default(value);
return str.charAt(0).toUpperCase() + str.substring(1);
};
exports.default = upperFirst;
//# sourceMappingURL=upper-first.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/values-of-key.js":
/*!************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/values-of-key.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
exports.default = (function (data, name) {
var rst = [];
var tmpMap = {};
for (var i = 0; i < data.length; i++) {
var obj = data[i];
var value = obj[name];
if (!is_nil_1.default(value)) {
// flatten
if (!is_array_1.default(value)) {
value = [value];
}
for (var j = 0; j < value.length; j++) {
var val = value[j];
// unique
if (!tmpMap[val]) {
rst.push(val);
tmpMap[val] = true;
}
}
}
}
return rst;
});
//# sourceMappingURL=values-of-key.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/values.js":
/*!*****************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/values.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var each_1 = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
var is_function_1 = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
// @ts-ignore
var values = Object.values ? function (obj) { return Object.values(obj); } : function (obj) {
var result = [];
each_1.default(obj, function (value, key) {
if (!(is_function_1.default(obj) && key === 'prototype')) {
result.push(value);
}
});
return result;
};
exports.default = values;
//# sourceMappingURL=values.js.map
/***/ }),
/***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/wrap-behavior.js":
/*!************************************************************************!*\
!*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/wrap-behavior.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 封装事件便于使用上下文this,和便于解除事件时使用
* @protected
* @param {Object} obj 对象
* @param {String} action 事件名称
* @return {Function} 返回事件处理函数
*/
function wrapBehavior(obj, action) {
if (obj['_wrap_' + action]) {
return obj['_wrap_' + action];
}
var method = function (e) {
obj[action](e);
};
obj['_wrap_' + action] = method;
return method;
}
exports.default = wrapBehavior;
//# sourceMappingURL=wrap-behavior.js.map
/***/ }),
/***/ "./node_modules/_abs-svg-path@0.1.1@abs-svg-path/index.js":
/*!****************************************************************!*\
!*** ./node_modules/_abs-svg-path@0.1.1@abs-svg-path/index.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = absolutize
/**
* redefine `path` with absolute coordinates
*
* @param {Array} path
* @return {Array}
*/
function absolutize(path){
var startX = 0
var startY = 0
var x = 0
var y = 0
return path.map(function(seg){
seg = seg.slice()
var type = seg[0]
var command = type.toUpperCase()
// is relative
if (type != command) {
seg[0] = command
switch (type) {
case 'a':
seg[6] += x
seg[7] += y
break
case 'v':
seg[1] += y
break
case 'h':
seg[1] += x
break
default:
for (var i = 1; i < seg.length;) {
seg[i++] += x
seg[i++] += y
}
}
}
// update cursor state
switch (command) {
case 'Z':
x = startX
y = startY
break
case 'H':
x = seg[1]
break
case 'V':
y = seg[1]
break
case 'M':
x = startX = seg[1]
y = startY = seg[2]
break
default:
x = seg[seg.length - 2]
y = seg[seg.length - 1]
}
return seg
})
}
/***/ }),
/***/ "./node_modules/_d3-array@1.2.4@d3-array/dist/d3-array.js":
/*!****************************************************************!*\
!*** ./node_modules/_d3-array@1.2.4@d3-array/dist/d3-array.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-array/ v1.2.4 Copyright 2018 Mike Bostock
(function (global, factory) {
true ? factory(exports) :
undefined;
}(this, (function (exports) {
'use strict';
function ascending(a, b) {
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
}
function bisector(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 ascending(f(d), x);
};
}
var ascendingBisect = bisector(ascending);
var bisectRight = ascendingBisect.right;
var bisectLeft = ascendingBisect.left;
function pairs(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];
}
function cross(values0, values1, reduce) {
var n0 = values0.length, n1 = values1.length, values = new Array(n0 * n1), i0, i1, i, value0;
if (reduce == null)
reduce = 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;
}
function descending(a, b) {
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
}
function number(x) {
return x === null ? NaN : +x;
}
function variance(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 = number(values[i]))) {
delta = value - mean;
mean += delta / ++m;
sum += delta * (value - mean);
}
}
}
else {
while (++i < n) {
if (!isNaN(value = number(valueof(values[i], i, values)))) {
delta = value - mean;
mean += delta / ++m;
sum += delta * (value - mean);
}
}
}
if (m > 1)
return sum / (m - 1);
}
function deviation(array, f) {
var v = variance(array, f);
return v ? Math.sqrt(v) : v;
}
function extent(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];
}
var array = Array.prototype;
var slice = array.slice;
var map = array.map;
function constant(x) {
return function () {
return x;
};
}
function identity(x) {
return x;
}
function range(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;
}
var e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
function ticks(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;
}
function sturges(values) {
return Math.ceil(Math.log(values.length) / Math.LN2) + 1;
}
function histogram() {
var value = identity, domain = extent, threshold = sturges;
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 = tickStep(x0, x1, tz);
tz = range(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[bisectRight(tz, x, 0, m)].push(data[i]);
}
}
return bins;
}
histogram.value = function (_) {
return arguments.length ? (value = typeof _ === "function" ? _ : constant(_), histogram) : value;
};
histogram.domain = function (_) {
return arguments.length ? (domain = typeof _ === "function" ? _ : constant([_[0], _[1]]), histogram) : domain;
};
histogram.thresholds = function (_) {
return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), histogram) : threshold;
};
return histogram;
}
function quantile(values, p, valueof) {
if (valueof == null)
valueof = number;
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);
}
function freedmanDiaconis(values, min, max) {
values = map.call(values, number).sort(ascending);
return Math.ceil((max - min) / (2 * (quantile(values, 0.75) - quantile(values, 0.25)) * Math.pow(values.length, -1 / 3)));
}
function scott(values, min, max) {
return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(values.length, -1 / 3)));
}
function max(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;
}
function mean(values, valueof) {
var n = values.length, m = n, i = -1, value, sum = 0;
if (valueof == null) {
while (++i < n) {
if (!isNaN(value = number(values[i])))
sum += value;
else
--m;
}
}
else {
while (++i < n) {
if (!isNaN(value = number(valueof(values[i], i, values))))
sum += value;
else
--m;
}
}
if (m)
return sum / m;
}
function median(values, valueof) {
var n = values.length, i = -1, value, numbers = [];
if (valueof == null) {
while (++i < n) {
if (!isNaN(value = number(values[i]))) {
numbers.push(value);
}
}
}
else {
while (++i < n) {
if (!isNaN(value = number(valueof(values[i], i, values)))) {
numbers.push(value);
}
}
}
return quantile(numbers.sort(ascending), 0.5);
}
function merge(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;
}
function min(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;
}
function permute(array, indexes) {
var i = indexes.length, permutes = new Array(i);
while (i--)
permutes[i] = array[indexes[i]];
return permutes;
}
function scan(values, compare) {
if (!(n = values.length))
return;
var n, i = 0, j = 0, xi, xj = values[j];
if (compare == null)
compare = ascending;
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;
}
function shuffle(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;
}
function sum(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;
}
function transpose(matrix) {
if (!(n = matrix.length))
return [];
for (var i = -1, m = min(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;
}
function zip() {
return transpose(arguments);
}
exports.bisect = bisectRight;
exports.bisectRight = bisectRight;
exports.bisectLeft = bisectLeft;
exports.ascending = ascending;
exports.bisector = bisector;
exports.cross = cross;
exports.descending = descending;
exports.deviation = deviation;
exports.extent = extent;
exports.histogram = histogram;
exports.thresholdFreedmanDiaconis = freedmanDiaconis;
exports.thresholdScott = scott;
exports.thresholdSturges = sturges;
exports.max = max;
exports.mean = mean;
exports.median = median;
exports.merge = merge;
exports.min = min;
exports.pairs = pairs;
exports.permute = permute;
exports.quantile = quantile;
exports.range = range;
exports.scan = scan;
exports.shuffle = shuffle;
exports.sum = sum;
exports.ticks = ticks;
exports.tickIncrement = tickIncrement;
exports.tickStep = tickStep;
exports.transpose = transpose;
exports.variance = variance;
exports.zip = zip;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/_d3-collection@1.0.7@d3-collection/dist/d3-collection.js":
/*!*******************************************************************************!*\
!*** ./node_modules/_d3-collection@1.0.7@d3-collection/dist/d3-collection.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-collection/ v1.0.7 Copyright 2018 Mike Bostock
(function (global, factory) {
true ? factory(exports) :
undefined;
}(this, (function (exports) {
'use strict';
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;
}
function nest() {
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 = map(), 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$$1, depth) {
if (++depth > keys.length)
return map$$1;
var array, sortKey = sortKeys[depth - 1];
if (rollup != null && depth >= keys.length)
array = map$$1.entries();
else
array = [], map$$1.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 map();
}
function setMap(map$$1, key, value) {
map$$1.set(key, value);
}
function Set() { }
var proto = map.prototype;
Set.prototype = set.prototype = {
constructor: Set,
has: proto.has,
add: function (value) {
value += "";
this[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 its 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;
}
function keys(map) {
var keys = [];
for (var key in map)
keys.push(key);
return keys;
}
function values(map) {
var values = [];
for (var key in map)
values.push(map[key]);
return values;
}
function entries(map) {
var entries = [];
for (var key in map)
entries.push({ key: key, value: map[key] });
return entries;
}
exports.nest = nest;
exports.set = set;
exports.map = map;
exports.keys = keys;
exports.values = values;
exports.entries = entries;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/_d3-composite-projections@1.3.2@d3-composite-projections/d3-composite-projections.js":
/*!***********************************************************************************************************!*\
!*** ./node_modules/_d3-composite-projections@1.3.2@d3-composite-projections/d3-composite-projections.js ***!
\***********************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// http://geoexamples.com/d3-composite-projections/ v1.3.2 Copyright 2019 Roger Veciana i Rovira
(function (global, factory) {
true ? factory(exports, __webpack_require__(/*! d3-geo */ "./node_modules/_d3-geo@1.12.1@d3-geo/dist/d3-geo.js"), __webpack_require__(/*! d3-path */ "./node_modules/_d3-path@1.0.9@d3-path/dist/d3-path.js")) :
undefined;
}(this, (function (exports, d3Geo, d3Path) {
'use strict';
var epsilon = 1e-6;
function noop() { }
var x0 = Infinity, y0 = x0, x1 = -x0, y1 = x1;
var boundsStream = {
point: boundsPoint,
lineStart: noop,
lineEnd: noop,
polygonStart: noop,
polygonEnd: noop,
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;
}
function fitExtent(projection, extent, object) {
var w = extent[1][0] - extent[0][0], h = extent[1][1] - extent[0][1], clip = projection.clipExtent && projection.clipExtent();
projection
.scale(150)
.translate([0, 0]);
if (clip != null)
projection.clipExtent(null);
d3Geo.geoStream(object, projection.stream(boundsStream));
var b = boundsStream.result(), 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;
if (clip != null)
projection.clipExtent(clip);
return projection
.scale(k * 150)
.translate([x, y]);
}
function fitSize(projection, size, object) {
return fitExtent(projection, [[0, 0], size], object);
}
// 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
function albersUsa() {
var cache, cacheStream, lower48 = d3Geo.geoAlbers(), lower48Point, alaska = d3Geo.geoConicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338
hawaii = d3Geo.geoConicEqualArea().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 + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])
.stream(pointStream);
hawaiiPoint = hawaii
.translate([x - 0.205 * k, y + 0.212 * k])
.clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])
.stream(pointStream);
return reset();
};
albersUsa.fitExtent = function (extent, object) {
return fitExtent(albersUsa, extent, object);
};
albersUsa.fitSize = function (size, object) {
return fitSize(albersUsa, size, object);
};
function reset() {
cache = cacheStream = null;
return albersUsa;
}
albersUsa.drawCompositionBorders = function (context) {
var hawaii1 = lower48([-102.91, 26.3]);
var hawaii2 = lower48([-104.0, 27.5]);
var hawaii3 = lower48([-108.0, 29.1]);
var hawaii4 = lower48([-110.0, 29.1]);
var alaska1 = lower48([-110.0, 26.7]);
var alaska2 = lower48([-112.8, 27.6]);
var alaska3 = lower48([-114.3, 30.6]);
var alaska4 = lower48([-119.3, 30.1]);
context.moveTo(hawaii1[0], hawaii1[1]);
context.lineTo(hawaii2[0], hawaii2[1]);
context.lineTo(hawaii3[0], hawaii3[1]);
context.lineTo(hawaii4[0], hawaii4[1]);
context.moveTo(alaska1[0], alaska1[1]);
context.lineTo(alaska2[0], alaska2[1]);
context.lineTo(alaska3[0], alaska3[1]);
context.lineTo(alaska4[0], alaska4[1]);
};
albersUsa.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return albersUsa.scale(1070);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$1(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. Also works quite well at 960×600 with scale 1285. 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
function albersUsaTerritories() {
var cache, cacheStream, lower48 = d3Geo.geoAlbers(), lower48Point, alaska = d3Geo.geoConicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338
hawaii = d3Geo.geoConicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007
puertoRico = d3Geo.geoConicEqualArea().rotate([66, 0]).center([0, 18]).parallels([8, 18]), puertoRicoPoint, //Taken from https://bl.ocks.org/mbostock/5629120
samoa = d3Geo.geoEquirectangular().rotate([173, 14]), samoaPoint, // EPSG:4169
guam = d3Geo.geoEquirectangular().rotate([-145, -16.8]), guamPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var puertoRicoBbox = [[-68.3, 19], [-63.9, 17]];
var samoaBbox = [[-171, -14], [-168, -14.8]];
var guamBbox = [[144, 20.8], [146.5, 12.7]];
*/
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) ||
(puertoRicoPoint.point(x, y), point) ||
(samoaPoint.point(x, y), point) ||
(guamPoint.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;
/*
//How are the return values calculated:
console.info("******");
var c0 = puertoRico(puertoRicoBbox[0]);
var x0 = (c0[0] - t[0]) / k;
var y0 = (c0[1] - t[1]) / k;
console.info("p0 puertoRico", x0 + ' - ' + y0);
var c1 = puertoRico(puertoRicoBbox[1]);
var x1 = (c1[0] - t[0]) / k;
var y1 = (c1[1] - t[1]) / k;
console.info("p1 puertoRico", x1 + ' - ' + y1);
c0 = samoa(samoaBbox[0]);
x0 = (c0[0] - t[0]) / k;
y0 = (c0[1] - t[1]) / k;
console.info("p0 samoa", x0 + ' - ' + y0);
c1 = samoa(samoaBbox[1]);
x1 = (c1[0] - t[0]) / k;
y1 = (c1[1] - t[1]) / k;
console.info("p1 samoa", x1 + ' - ' + y1);
c0 = guam(guamBbox[0]);
x0 = (c0[0] - t[0]) / k;
y0 = (c0[1] - t[1]) / k;
console.info("p0 guam", x0 + ' - ' + y0);
c1 = guam(guamBbox[1]);
x1 = (c1[0] - t[0]) / k;
y1 = (c1[1] - t[1]) / k;
console.info("p1 guam", x1 + ' - ' + y1);
*/
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
: y >= 0.2064 && y < 0.2413 && x >= 0.312 && x < 0.385 ? puertoRico
: y >= 0.09 && y < 0.1197 && x >= -0.4243 && x < -0.3232 ? samoa
: y >= -0.0518 && y < 0.0895 && x >= -0.4243 && x < -0.3824 ? guam
: lower48).invert(coordinates);
};
albersUsa.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$1([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream), puertoRico.stream(stream), samoa.stream(stream), guam.stream(stream)]);
};
albersUsa.precision = function (_) {
if (!arguments.length) {
return lower48.precision();
}
lower48.precision(_);
alaska.precision(_);
hawaii.precision(_);
puertoRico.precision(_);
samoa.precision(_);
guam.precision(_);
return reset();
};
albersUsa.scale = function (_) {
if (!arguments.length) {
return lower48.scale();
}
lower48.scale(_);
alaska.scale(_ * 0.35);
hawaii.scale(_);
puertoRico.scale(_);
samoa.scale(_ * 2);
guam.scale(_);
return albersUsa.translate(lower48.translate());
};
albersUsa.translate = function (_) {
if (!arguments.length) {
return lower48.translate();
}
var k = lower48.scale(), x = +_[0], y = +_[1];
/*
var c0 = puertoRico.translate([x + 0.350 * k, y + 0.224 * k])(puertoRicoBbox[0]);
var x0 = (x - c0[0]) / k;
var y0 = (y - c0[1]) / k;
var c1 = puertoRico.translate([x + 0.350 * k, y + 0.224 * k])(puertoRicoBbox[1]);
var x1 = (x - c1[0]) / k;
var y1 = (y - c1[1]) / k;
console.info('puertoRico: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
c0 = samoa.translate([x - 0.492 * k, y + 0.09 * k])(samoaBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = samoa.translate([x - 0.492 * k, y + 0.09 * k])(samoaBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('samoa: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
c0 = guam.translate([x - 0.408 * k, y + 0.018 * k])(guamBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = guam.translate([x - 0.408 * k, y + 0.018 * k])(guamBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('guam: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
*/
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 + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.233 * k - epsilon]])
.stream(pointStream);
hawaiiPoint = hawaii
.translate([x - 0.205 * k, y + 0.212 * k])
.clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.233 * k - epsilon]])
.stream(pointStream);
puertoRicoPoint = puertoRico
.translate([x + 0.350 * k, y + 0.224 * k])
.clipExtent([[x + 0.312 * k + epsilon, y + 0.2064 * k + epsilon], [x + 0.385 * k - epsilon, y + 0.233 * k - epsilon]])
.stream(pointStream);
samoaPoint = samoa
.translate([x - 0.492 * k, y + 0.09 * k])
.clipExtent([[x - 0.4243 * k + epsilon, y + 0.0903 * k + epsilon], [x - 0.3233 * k - epsilon, y + 0.1197 * k - epsilon]])
.stream(pointStream);
guamPoint = guam
.translate([x - 0.408 * k, y + 0.018 * k])
.clipExtent([[x - 0.4244 * k + epsilon, y - 0.0519 * k + epsilon], [x - 0.3824 * k - epsilon, y + 0.0895 * k - epsilon]])
.stream(pointStream);
return reset();
};
albersUsa.fitExtent = function (extent, object) {
return fitExtent(albersUsa, extent, object);
};
albersUsa.fitSize = function (size, object) {
return fitSize(albersUsa, size, object);
};
function reset() {
cache = cacheStream = null;
return albersUsa;
}
albersUsa.drawCompositionBorders = function (context) {
/*
console.info("CLIP EXTENT hawaii: ", hawaii.clipExtent());
console.info("UL BBOX:", lower48.invert([hawaii.clipExtent()[0][0], hawaii.clipExtent()[0][1]]));
console.info("UR BBOX:", lower48.invert([hawaii.clipExtent()[1][0], hawaii.clipExtent()[0][1]]));
console.info("LD BBOX:", lower48.invert([hawaii.clipExtent()[1][0], hawaii.clipExtent()[1][1]]));
console.info("LL BBOX:", lower48.invert([hawaii.clipExtent()[0][0], hawaii.clipExtent()[1][1]]));
console.info("CLIP EXTENT alaska: ", alaska.clipExtent());
console.info("UL BBOX:", lower48.invert([alaska.clipExtent()[0][0], alaska.clipExtent()[0][1]]));
console.info("UR BBOX:", lower48.invert([alaska.clipExtent()[1][0], alaska.clipExtent()[0][1]]));
console.info("LD BBOX:", lower48.invert([alaska.clipExtent()[1][0], alaska.clipExtent()[1][1]]));
console.info("LL BBOX:", lower48.invert([alaska.clipExtent()[0][0], alaska.clipExtent()[1][1]]));
console.info("CLIP EXTENT puertoRico: ", puertoRico.clipExtent());
console.info("UL BBOX:", lower48.invert([puertoRico.clipExtent()[0][0], puertoRico.clipExtent()[0][1]]));
console.info("UR BBOX:", lower48.invert([puertoRico.clipExtent()[1][0], puertoRico.clipExtent()[0][1]]));
console.info("LD BBOX:", lower48.invert([puertoRico.clipExtent()[1][0], puertoRico.clipExtent()[1][1]]));
console.info("LL BBOX:", lower48.invert([puertoRico.clipExtent()[0][0], puertoRico.clipExtent()[1][1]]));
console.info("CLIP EXTENT samoa: ", samoa.clipExtent());
console.info("UL BBOX:", lower48.invert([samoa.clipExtent()[0][0], samoa.clipExtent()[0][1]]));
console.info("UR BBOX:", lower48.invert([samoa.clipExtent()[1][0], samoa.clipExtent()[0][1]]));
console.info("LD BBOX:", lower48.invert([samoa.clipExtent()[1][0], samoa.clipExtent()[1][1]]));
console.info("LL BBOX:", lower48.invert([samoa.clipExtent()[0][0], samoa.clipExtent()[1][1]]));
console.info("CLIP EXTENT guam: ", guam.clipExtent());
console.info("UL BBOX:", lower48.invert([guam.clipExtent()[0][0], guam.clipExtent()[0][1]]));
console.info("UR BBOX:", lower48.invert([guam.clipExtent()[1][0], guam.clipExtent()[0][1]]));
console.info("LD BBOX:", lower48.invert([guam.clipExtent()[1][0], guam.clipExtent()[1][1]]));
console.info("LL BBOX:", lower48.invert([guam.clipExtent()[0][0], guam.clipExtent()[1][1]]));
*/
var ulhawaii = lower48([-110.4641, 28.2805]);
var urhawaii = lower48([-104.0597, 28.9528]);
var ldhawaii = lower48([-103.7049, 25.1031]);
var llhawaii = lower48([-109.8337, 24.4531]);
var ulalaska = lower48([-124.4745, 28.1407]);
var uralaska = lower48([-110.931, 30.8844]);
var ldalaska = lower48([-109.8337, 24.4531]);
var llalaska = lower48([-122.4628, 21.8562]);
var ulpuertoRico = lower48([-76.8579, 25.1544]);
var urpuertoRico = lower48([-72.429, 24.2097]);
var ldpuertoRico = lower48([-72.8265, 22.7056]);
var llpuertoRico = lower48([-77.1852, 23.6392]);
var ulsamoa = lower48([-125.0093, 29.7791]);
var ursamoa = lower48([-118.5193, 31.3262]);
var ldsamoa = lower48([-118.064, 29.6912]);
var llsamoa = lower48([-124.4369, 28.169]);
var ulguam = lower48([-128.1314, 37.4582]);
var urguam = lower48([-125.2132, 38.214]);
var ldguam = lower48([-122.3616, 30.5115]);
var llguam = lower48([-125.0315, 29.8211]);
context.moveTo(ulhawaii[0], ulhawaii[1]);
context.lineTo(urhawaii[0], urhawaii[1]);
context.lineTo(ldhawaii[0], ldhawaii[1]);
context.lineTo(ldhawaii[0], ldhawaii[1]);
context.lineTo(llhawaii[0], llhawaii[1]);
context.closePath();
context.moveTo(ulalaska[0], ulalaska[1]);
context.lineTo(uralaska[0], uralaska[1]);
context.lineTo(ldalaska[0], ldalaska[1]);
context.lineTo(ldalaska[0], ldalaska[1]);
context.lineTo(llalaska[0], llalaska[1]);
context.closePath();
context.moveTo(ulpuertoRico[0], ulpuertoRico[1]);
context.lineTo(urpuertoRico[0], urpuertoRico[1]);
context.lineTo(ldpuertoRico[0], ldpuertoRico[1]);
context.lineTo(ldpuertoRico[0], ldpuertoRico[1]);
context.lineTo(llpuertoRico[0], llpuertoRico[1]);
context.closePath();
context.moveTo(ulsamoa[0], ulsamoa[1]);
context.lineTo(ursamoa[0], ursamoa[1]);
context.lineTo(ldsamoa[0], ldsamoa[1]);
context.lineTo(ldsamoa[0], ldsamoa[1]);
context.lineTo(llsamoa[0], llsamoa[1]);
context.closePath();
context.moveTo(ulguam[0], ulguam[1]);
context.lineTo(urguam[0], urguam[1]);
context.lineTo(ldguam[0], ldguam[1]);
context.lineTo(ldguam[0], ldguam[1]);
context.lineTo(llguam[0], llguam[1]);
context.closePath();
};
albersUsa.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return albersUsa.scale(1070);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$2(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 Spain, configured by default for 960×500.
function conicConformalSpain() {
var cache, cacheStream, iberianPeninsule = d3Geo.geoConicConformal().rotate([5, -38.6]).parallels([0, 60]), iberianPeninsulePoint, canaryIslands = d3Geo.geoConicConformal().rotate([5, -38.6]).parallels([0, 60]), canaryIslandsPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var iberianPeninsuleBbox = [[-11, 46], [4, 35]];
var canaryIslandsBbox = [[-19.0, 28.85], [-12.7, 28.1]];
*/
function conicConformalSpain(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(iberianPeninsulePoint.point(x, y), point) ||
(canaryIslandsPoint.point(x, y), point);
}
conicConformalSpain.invert = function (coordinates) {
var k = iberianPeninsule.scale(), t = iberianPeninsule.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
return (y >= 0.05346 && y < 0.0897 && x >= -0.13388 && x < -0.0322 ? canaryIslands
: iberianPeninsule).invert(coordinates);
};
conicConformalSpain.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$2([iberianPeninsule.stream(cacheStream = stream), canaryIslands.stream(stream)]);
};
conicConformalSpain.precision = function (_) {
if (!arguments.length) {
return iberianPeninsule.precision();
}
iberianPeninsule.precision(_);
canaryIslands.precision(_);
return reset();
};
conicConformalSpain.scale = function (_) {
if (!arguments.length) {
return iberianPeninsule.scale();
}
iberianPeninsule.scale(_);
canaryIslands.scale(_);
return conicConformalSpain.translate(iberianPeninsule.translate());
};
conicConformalSpain.translate = function (_) {
if (!arguments.length) {
return iberianPeninsule.translate();
}
var k = iberianPeninsule.scale(), x = +_[0], y = +_[1];
/*
var c0 = iberianPeninsule(iberianPeninsuleBbox[0]);
var x0 = (x - c0[0]) / k;
var y0 = (y - c0[1]) / k;
var c1 = iberianPeninsule(iberianPeninsuleBbox[1]);
var x1 = (x - c1[0]) / k;
var y1 = (y - c1[1]) / k;
console.info('Iberian Peninsula: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
c0 = canaryIslands.translate([x + 0.1 * k, y - 0.094 * k])(canaryIslandsBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = canaryIslands.translate([x + 0.1 * k, y - 0.094 * k])(canaryIslandsBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('Canry Islands: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
*/
iberianPeninsulePoint = iberianPeninsule
.translate(_)
.clipExtent([[x - 0.06857 * k, y - 0.1288 * k], [x + 0.13249 * k, y + 0.06 * k]])
.stream(pointStream);
canaryIslandsPoint = canaryIslands
.translate([x + 0.1 * k, y - 0.094 * k])
.clipExtent([[x - 0.1331 * k + epsilon, y + 0.053457 * k + epsilon], [x - 0.0354 * k - epsilon, y + 0.08969 * k - epsilon]])
.stream(pointStream);
return reset();
};
conicConformalSpain.fitExtent = function (extent, object) {
return fitExtent(conicConformalSpain, extent, object);
};
conicConformalSpain.fitSize = function (size, object) {
return fitSize(conicConformalSpain, size, object);
};
function reset() {
cache = cacheStream = null;
return conicConformalSpain;
}
conicConformalSpain.drawCompositionBorders = function (context) {
/*
console.info("CLIP EXTENT: ", canaryIslands.clipExtent());
console.info("UL BBOX:", iberianPeninsule.invert([canaryIslands.clipExtent()[0][0], canaryIslands.clipExtent()[0][1]]));
console.info("UR BBOX:", iberianPeninsule.invert([canaryIslands.clipExtent()[1][0], canaryIslands.clipExtent()[0][1]]));
console.info("LD BBOX:", iberianPeninsule.invert([canaryIslands.clipExtent()[1][0], canaryIslands.clipExtent()[1][1]]));
*/
var ulCanaryIslands = iberianPeninsule([-14.0346750, 34.965007]);
var urCanaryIslands = iberianPeninsule([-7.4208899, 35.536988]);
var ldCanaryIslands = iberianPeninsule([-7.3148275, 33.54359]);
context.moveTo(ulCanaryIslands[0], ulCanaryIslands[1]);
context.lineTo(urCanaryIslands[0], urCanaryIslands[1]);
context.lineTo(ldCanaryIslands[0], ldCanaryIslands[1]);
};
conicConformalSpain.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return conicConformalSpain.scale(2700);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$3(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 Portugal, configured by default for 960×500.
function conicConformalPortugal() {
var cache, cacheStream, iberianPeninsule = d3Geo.geoConicConformal().rotate([10, -39.3]).parallels([0, 60]), iberianPeninsulePoint, madeira = d3Geo.geoConicConformal().rotate([17, -32.7]).parallels([0, 60]), madeiraPoint, azores = d3Geo.geoConicConformal().rotate([27.8, -38.6]).parallels([0, 60]), azoresPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var iberianPeninsuleBbox = [[-11, 46], [4, 34]];
var madeiraBbox = [[-17.85, 33.6], [-16, 32.02]];
var azoresBbox = [[-32, 40.529], [-23.98, 35.75]];
*/
function conicConformalPortugal(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(iberianPeninsulePoint.point(x, y), point) ||
(madeiraPoint.point(x, y), point) ||
(azoresPoint.point(x, y), point);
}
conicConformalPortugal.invert = function (coordinates) {
var k = iberianPeninsule.scale(), t = iberianPeninsule.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
/*
//How are the return values calculated:
console.info("******");
var c0 = madeira(madeiraBbox[0]);
var x0 = (c0[0] - t[0]) / k;
var y0 = (c0[1] - t[1]) / k;
console.info("p0 madeira", x0 + ' - ' + y0);
var c1 = madeira(madeiraBbox[1]);
var x1 = (c1[0] - t[0]) / k;
var y1 = (c1[1] - t[1]) / k;
console.info("p1 madeira", x1 + ' - ' + y1);
c0 = azores(azoresBbox[0]);
x0 = (c0[0] - t[0]) / k;
y0 = (c0[1] - t[1]) / k;
console.info("p0 azores", x0 + ' - ' + y0);
c1 = azores(azoresBbox[1]);
x1 = (c1[0] - t[0]) / k;
y1 = (c1[1] - t[1]) / k;
console.info("p1 azores", x1 + ' - ' + y1);
*/
return (y >= 0.0093 && y < 0.03678 && x >= -0.03875 && x < -0.0116 ? madeira
: y >= -0.0412 && y < 0.0091 && x >= -0.07782 && x < -0.01166 ? azores
: iberianPeninsule).invert(coordinates);
};
conicConformalPortugal.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$3([iberianPeninsule.stream(cacheStream = stream), madeira.stream(stream), azores.stream(stream)]);
};
conicConformalPortugal.precision = function (_) {
if (!arguments.length) {
return iberianPeninsule.precision();
}
iberianPeninsule.precision(_);
madeira.precision(_);
azores.precision(_);
return reset();
};
conicConformalPortugal.scale = function (_) {
if (!arguments.length) {
return iberianPeninsule.scale();
}
iberianPeninsule.scale(_);
madeira.scale(_);
azores.scale(_ * 0.6);
return conicConformalPortugal.translate(iberianPeninsule.translate());
};
conicConformalPortugal.translate = function (_) {
if (!arguments.length) {
return iberianPeninsule.translate();
}
var k = iberianPeninsule.scale(), x = +_[0], y = +_[1];
/*
var c0 = iberianPeninsule(iberianPeninsuleBbox[0]);
var x0 = (x - c0[0]) / k;
var y0 = (y - c0[1]) / k;
var c1 = iberianPeninsule(iberianPeninsuleBbox[1]);
var x1 = (x - c1[0]) / k;
var y1 = (y - c1[1]) / k;
console.info('Iberian Peninsula: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k]])');
c0 = madeira.translate([x - 0.0265 * k, y + 0.025 * k])(madeiraBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = madeira.translate([x - 0.0265 * k, y + 0.025 * k])(madeiraBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('Madeira: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
c0 = azores.translate([x - 0.045 * k, y + -0.02 * k])(azoresBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = azores.translate([x - 0.045 * k, y + -0.02 * k])(azoresBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('Azores: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
*/
iberianPeninsulePoint = iberianPeninsule
.translate(_)
.clipExtent([[x - 0.0115 * k, y - 0.1138 * k], [x + 0.2105 * k, y + 0.0673 * k]])
.stream(pointStream);
madeiraPoint = madeira
.translate([x - 0.0265 * k, y + 0.025 * k])
.clipExtent([[x - 0.0388 * k + epsilon, y + 0.0093 * k + epsilon], [x - 0.0116 * k - epsilon, y + 0.0368 * k - epsilon]])
.stream(pointStream);
azoresPoint = azores
.translate([x - 0.045 * k, y + -0.02 * k])
.clipExtent([[x - 0.0778 * k + epsilon, y - 0.0413 * k + epsilon], [x - 0.0117 * k - epsilon, y + 0.0091 * k - epsilon]])
.stream(pointStream);
return reset();
};
conicConformalPortugal.fitExtent = function (extent, object) {
return fitExtent(conicConformalPortugal, extent, object);
};
conicConformalPortugal.fitSize = function (size, object) {
return fitSize(conicConformalPortugal, size, object);
};
function reset() {
cache = cacheStream = null;
return conicConformalPortugal;
}
conicConformalPortugal.drawCompositionBorders = function (context) {
/*
console.info("CLIP EXTENT MADEIRA: ", madeira.clipExtent());
console.info("UL BBOX:", iberianPeninsule.invert([madeira.clipExtent()[0][0], madeira.clipExtent()[0][1]]));
console.info("UR BBOX:", iberianPeninsule.invert([madeira.clipExtent()[1][0], madeira.clipExtent()[0][1]]));
console.info("LD BBOX:", iberianPeninsule.invert([madeira.clipExtent()[1][0], madeira.clipExtent()[1][1]]));
console.info("LL BBOX:", iberianPeninsule.invert([madeira.clipExtent()[0][0], madeira.clipExtent()[1][1]]));
console.info("CLIP EXTENT AZORES: ", azores.clipExtent());
console.info("UL BBOX:", iberianPeninsule.invert([azores.clipExtent()[0][0], azores.clipExtent()[0][1]]));
console.info("UR BBOX:", iberianPeninsule.invert([azores.clipExtent()[1][0], azores.clipExtent()[0][1]]));
console.info("LD BBOX:", iberianPeninsule.invert([azores.clipExtent()[1][0], azores.clipExtent()[1][1]]));
console.info("LL BBOX:", iberianPeninsule.invert([azores.clipExtent()[0][0], azores.clipExtent()[1][1]]));
*/
var ulmadeira = iberianPeninsule([-12.8351, 38.7113]);
var urmadeira = iberianPeninsule([-10.8482, 38.7633]);
var ldmadeira = iberianPeninsule([-10.8181, 37.2072]);
var llmadeira = iberianPeninsule([-12.7345, 37.1573]);
var ulazores = iberianPeninsule([-16.0753, 41.4436]);
var urazores = iberianPeninsule([-10.9168, 41.6861]);
var ldazores = iberianPeninsule([-10.8557, 38.7747]);
var llazores = iberianPeninsule([-15.6728, 38.5505]);
context.moveTo(ulmadeira[0], ulmadeira[1]);
context.lineTo(urmadeira[0], urmadeira[1]);
context.lineTo(ldmadeira[0], ldmadeira[1]);
context.lineTo(ldmadeira[0], ldmadeira[1]);
context.lineTo(llmadeira[0], llmadeira[1]);
context.closePath();
context.moveTo(ulazores[0], ulazores[1]);
context.lineTo(urazores[0], urazores[1]);
context.lineTo(ldazores[0], ldazores[1]);
context.lineTo(ldazores[0], ldazores[1]);
context.lineTo(llazores[0], llazores[1]);
context.closePath();
};
conicConformalPortugal.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return conicConformalPortugal.scale(4200);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$4(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 Ecuador, configured by default for 960×500.
function mercatorEcuador() {
var cache, cacheStream, mainland = d3Geo.geoMercator().rotate([80, 1.5]), mainlandPoint, galapagos = d3Geo.geoMercator().rotate([90.73, 1]), galapagosPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var mainlandBbox = [[-81.5, 2.7], [-70.0, -6.0]];
var galapagosBbox = [[-92.2, 0.58], [-88.8, -1.8]];
*/
function mercatorEcuador(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(mainlandPoint.point(x, y), point) ||
(galapagosPoint.point(x, y), point);
}
mercatorEcuador.invert = function (coordinates) {
var k = mainland.scale(), t = mainland.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
/*
//How are the return values calculated:
var c0 = galapagos(galapagosBbox[0]);
var x0 = (c0[0] - t[0]) / k;
var y0 = (c0[1] - t[1]) / k;
console.info("p0 galapagos", x0 + ' - ' + y0);
var c1 = galapagos(galapagosBbox[1]);
var x1 = (c1[0] - t[0]) / k;
var y1 = (c1[1] - t[1]) / k;
console.info("p1 galapagos", x1 + ' - ' + y1);
*/
return (y >= -0.0676 && y < -0.026 && x >= -0.0857 && x < -0.0263 ? galapagos
: mainland).invert(coordinates);
};
mercatorEcuador.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$4([mainland.stream(cacheStream = stream), galapagos.stream(stream)]);
};
mercatorEcuador.precision = function (_) {
if (!arguments.length) {
return mainland.precision();
}
mainland.precision(_);
galapagos.precision(_);
return reset();
};
mercatorEcuador.scale = function (_) {
if (!arguments.length) {
return mainland.scale();
}
mainland.scale(_);
galapagos.scale(_);
return mercatorEcuador.translate(mainland.translate());
};
mercatorEcuador.translate = function (_) {
if (!arguments.length) {
return mainland.translate();
}
var k = mainland.scale(), x = +_[0], y = +_[1];
/*
var c0 = mainland(mainlandBbox[0]);
var x0 = (x - c0[0]) / k;
var y0 = (y - c0[1]) / k;
var c1 = mainland(mainlandBbox[1]);
var x1 = (x - c1[0]) / k;
var y1 = (y - c1[1]) / k;
console.info('mainland: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k]])');
c0 = galapagos.translate([x - 0.06 * k, y - 0.04 * k])(galapagosBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = galapagos.translate([x - 0.06 * k, y - 0.04 * k])(galapagosBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('galapagos: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');*/
mainlandPoint = mainland
.translate(_)
.clipExtent([[x - 0.0262 * k, y - 0.0734 * k], [x + 0.1741 * k, y + 0.079 * k]])
.stream(pointStream);
galapagosPoint = galapagos
.translate([x - 0.06 * k, y - 0.04 * k])
.clipExtent([[x - 0.0857 * k + epsilon, y - 0.0676 * k + epsilon], [x - 0.0263 * k - epsilon, y - 0.026 * k - epsilon]])
.stream(pointStream);
return reset();
};
mercatorEcuador.fitExtent = function (extent, object) {
return fitExtent(mercatorEcuador, extent, object);
};
mercatorEcuador.fitSize = function (size, object) {
return fitSize(mercatorEcuador, size, object);
};
function reset() {
cache = cacheStream = null;
return mercatorEcuador;
}
mercatorEcuador.drawCompositionBorders = function (context) {
/*
console.info("CLIP EXTENT: ", galapagos.clipExtent());
console.info("UL BBOX:", mainland.invert([galapagos.clipExtent()[0][0], galapagos.clipExtent()[0][1]]));
console.info("UR BBOX:", mainland.invert([galapagos.clipExtent()[1][0], galapagos.clipExtent()[0][1]]));
console.info("LD BBOX:", mainland.invert([galapagos.clipExtent()[1][0], galapagos.clipExtent()[1][1]]));
console.info("LL BBOX:", mainland.invert([galapagos.clipExtent()[0][0], galapagos.clipExtent()[1][1]]));
*/
var ulgalapagos = mainland([-84.9032, 2.3757]);
var urgalapagos = mainland([-81.5047, 2.3708]);
var ldgalapagos = mainland([-81.5063, -0.01]);
var llgalapagos = mainland([-84.9086, -0.005]);
context.moveTo(ulgalapagos[0], ulgalapagos[1]);
context.lineTo(urgalapagos[0], urgalapagos[1]);
context.lineTo(ldgalapagos[0], ldgalapagos[1]);
context.lineTo(llgalapagos[0], llgalapagos[1]);
context.closePath();
};
mercatorEcuador.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return mercatorEcuador.scale(3500);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$5(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 Chile, configured by default for 960×500.
function transverseMercatorChile() {
var cache, cacheStream, mainland = d3Geo.geoTransverseMercator().rotate([72, 37]), mainlandPoint, antarctic = d3Geo.geoStereographic().rotate([72, 0]), antarcticPoint, juanFernandez = d3Geo.geoMercator().rotate([80, 33.5]), juanFernandezPoint, pascua = d3Geo.geoMercator().rotate([110, 25]), pascuaPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var mainlandBbox = [[-75.5, -15.0], [-32, -49.0]];
var antarcticBbox = [[-91.0, -60.0], [-43.0, -90.0]];
var juanFernandezBbox = [[-81.0, -33.0], [-78.5, -34.0]];
var pascuaBbox = [[-110, -26.6], [-108.7, -27.5]];
*/
function transverseMercatorChile(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(mainlandPoint.point(x, y), point) ||
(antarcticPoint.point(x, y), point) ||
(juanFernandezPoint.point(x, y), point) ||
(pascuaPoint.point(x, y), point);
}
transverseMercatorChile.invert = function (coordinates) {
var k = mainland.scale(), t = mainland.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
/*
//How are the return values calculated:
console.info("******");
var c0 = antarctic(antarcticBbox[0]);
var x0 = (c0[0] - t[0]) / k;
var y0 = (c0[1] - t[1]) / k;
console.info("p0 antarctic", x0 + ' - ' + y0);
var c1 = antarctic(antarcticBbox[1]);
var x1 = (c1[0] - t[0]) / k;
var y1 = (c1[1] - t[1]) / k;
console.info("p1 antarctic", x1 + ' - ' + y1);
c0 = juanFernandez(juanFernandezBbox[0]);
x0 = (c0[0] - t[0]) / k;
y0 = (c0[1] - t[1]) / k;
console.info("p0 juanFernandez", x0 + ' - ' + y0);
c1 = juanFernandez(juanFernandezBbox[1]);
x1 = (c1[0] - t[0]) / k;
y1 = (c1[1] - t[1]) / k;
console.info("p1 juanFernandez", x1 + ' - ' + y1);
c0 = pascua(pascuaBbox[0]);
x0 = (c0[0] - t[0]) / k;
y0 = (c0[1] - t[1]) / k;
console.info("p0 pascua", x0 + ' - ' + y0);
c1 = pascua(pascuaBbox[1]);
x1 = (c1[0] - t[0]) / k;
y1 = (c1[1] - t[1]) / k;
console.info("p1 pascua", x1 + ' - ' + y1);
*/
return (y >= 0.2582 && y < 0.32 && x >= -0.1036 && x < -0.087 ? antarctic
: y >= -0.01298 && y < 0.0133 && x >= -0.11396 && x < -0.05944 ? juanFernandez
: y >= 0.01539 && y < 0.03911 && x >= -0.089 && x < -0.0588 ? pascua
: mainland).invert(coordinates);
};
transverseMercatorChile.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$5([mainland.stream(cacheStream = stream), antarctic.stream(stream), juanFernandez.stream(stream), pascua.stream(stream)]);
};
transverseMercatorChile.precision = function (_) {
if (!arguments.length) {
return mainland.precision();
}
mainland.precision(_);
antarctic.precision(_);
juanFernandez.precision(_);
pascua.precision(_);
return reset();
};
transverseMercatorChile.scale = function (_) {
if (!arguments.length) {
return mainland.scale();
}
mainland.scale(_);
antarctic.scale(_ * 0.15);
juanFernandez.scale(_ * 1.5);
pascua.scale(_ * 1.5);
return transverseMercatorChile.translate(mainland.translate());
};
transverseMercatorChile.translate = function (_) {
if (!arguments.length) {
return mainland.translate();
}
var k = mainland.scale(), x = +_[0], y = +_[1];
/*
var c0 = mainland(mainlandBbox[0]);
var x0 = (x - c0[0]) / k;
var y0 = (y - c0[1]) / k;
var c1 = mainland(mainlandBbox[1]);
var x1 = (x - c1[0]) / k;
var y1 = (y - c1[1]) / k;
console.info('Mainland: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k]])');
c0 = antarctic.translate([x - 0.1 * k, y + 0.17 * k])(antarcticBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = antarctic.translate([x - 0.1 * k, y + 0.17 * k])(antarcticBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('antarctic: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('Doesn t work due to -90 latitude!' + '.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
c0 = juanFernandez.translate([x - 0.092 * k, y -0 * k])(juanFernandezBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = juanFernandez.translate([x - 0.092 * k, y -0 * k])(juanFernandezBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('juanFernandez: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
c0 = pascua.translate([x - 0.089 * k, y -0.0265 * k])(pascuaBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = pascua.translate([x - 0.089 * k, y -0.0265 * k])(pascuaBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('pascua: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
*/
mainlandPoint = mainland
.translate(_)
.clipExtent([[x - 0.059 * k, y - 0.3835 * k], [x + 0.4498 * k, y + 0.3375 * k]])
.stream(pointStream);
antarcticPoint = antarctic
.translate([x - 0.087 * k, y + 0.17 * k])
.clipExtent([[x - 0.1166 * k + epsilon, y + 0.2582 * k + epsilon], [x - 0.06 * k - epsilon, y + 0.32 * k - epsilon]])
.stream(pointStream);
juanFernandezPoint = juanFernandez
.translate([x - 0.092 * k, y - 0 * k])
.clipExtent([[x - 0.114 * k + epsilon, y - 0.013 * k + epsilon], [x - 0.0594 * k - epsilon, y + 0.0133 * k - epsilon]])
.stream(pointStream);
pascuaPoint = pascua
.translate([x - 0.089 * k, y - 0.0265 * k])
.clipExtent([[x - 0.089 * k + epsilon, y + 0.0154 * k + epsilon], [x - 0.0588 * k - epsilon, y + 0.0391 * k - epsilon]])
.stream(pointStream);
return reset();
};
transverseMercatorChile.fitExtent = function (extent, object) {
return fitExtent(transverseMercatorChile, extent, object);
};
transverseMercatorChile.fitSize = function (size, object) {
return fitSize(transverseMercatorChile, size, object);
};
function reset() {
cache = cacheStream = null;
return transverseMercatorChile;
}
transverseMercatorChile.drawCompositionBorders = function (context) {
/*
console.info("CLIP EXTENT antarctic: ", antarctic.clipExtent());
console.info("UL BBOX:", mainland.invert([antarctic.clipExtent()[0][0], antarctic.clipExtent()[0][1]]));
console.info("UR BBOX:", mainland.invert([antarctic.clipExtent()[1][0], antarctic.clipExtent()[0][1]]));
console.info("LD BBOX:", mainland.invert([antarctic.clipExtent()[1][0], antarctic.clipExtent()[1][1]]));
console.info("LL BBOX:", mainland.invert([antarctic.clipExtent()[0][0], antarctic.clipExtent()[1][1]]));
console.info("CLIP EXTENT juanFernandez: ", juanFernandez.clipExtent());
console.info("UL BBOX:", mainland.invert([juanFernandez.clipExtent()[0][0], juanFernandez.clipExtent()[0][1]]));
console.info("UR BBOX:", mainland.invert([juanFernandez.clipExtent()[1][0], juanFernandez.clipExtent()[0][1]]));
console.info("LD BBOX:", mainland.invert([juanFernandez.clipExtent()[1][0], juanFernandez.clipExtent()[1][1]]));
console.info("LL BBOX:", mainland.invert([juanFernandez.clipExtent()[0][0], juanFernandez.clipExtent()[1][1]]));
console.info("CLIP EXTENT pascua: ", pascua.clipExtent());
console.info("UL BBOX:", mainland.invert([pascua.clipExtent()[0][0], pascua.clipExtent()[0][1]]));
console.info("UR BBOX:", mainland.invert([pascua.clipExtent()[1][0], pascua.clipExtent()[0][1]]));
console.info("LD BBOX:", mainland.invert([pascua.clipExtent()[1][0], pascua.clipExtent()[1][1]]));
console.info("LL BBOX:", mainland.invert([pascua.clipExtent()[0][0], pascua.clipExtent()[1][1]]));
*/
var ulantarctic = mainland([-82.6999, -51.3043]);
var urantarctic = mainland([-77.5442, -51.6631]);
var ldantarctic = mainland([-78.0254, -55.1860]);
var llantarctic = mainland([-83.6106, -54.7785]);
var uljuanFernandez = mainland([-80.0638, -35.9840]);
var urjuanFernandez = mainland([-76.2153, -36.1811]);
var ldjuanFernandez = mainland([-76.2994, -37.6839]);
var lljuanFernandez = mainland([-80.2231, -37.4757]);
var ulpascua = mainland([-78.442, -37.706]);
var urpascua = mainland([-76.263, -37.8054]);
var ldpascua = mainland([-76.344, -39.1595]);
var llpascua = mainland([-78.5638, -39.0559]);
context.moveTo(ulantarctic[0], ulantarctic[1]);
context.lineTo(urantarctic[0], urantarctic[1]);
context.lineTo(ldantarctic[0], ldantarctic[1]);
context.lineTo(ldantarctic[0], ldantarctic[1]);
context.lineTo(llantarctic[0], llantarctic[1]);
context.closePath();
context.moveTo(uljuanFernandez[0], uljuanFernandez[1]);
context.lineTo(urjuanFernandez[0], urjuanFernandez[1]);
context.lineTo(ldjuanFernandez[0], ldjuanFernandez[1]);
context.lineTo(ldjuanFernandez[0], ldjuanFernandez[1]);
context.lineTo(lljuanFernandez[0], lljuanFernandez[1]);
context.closePath();
context.moveTo(ulpascua[0], ulpascua[1]);
context.lineTo(urpascua[0], urpascua[1]);
context.lineTo(ldpascua[0], ldpascua[1]);
context.lineTo(ldpascua[0], ldpascua[1]);
context.lineTo(llpascua[0], llpascua[1]);
context.closePath();
};
transverseMercatorChile.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return transverseMercatorChile.scale(700);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$6(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 Portugal, configured by default for 960×500.
function conicEquidistantJapan() {
var cache, cacheStream, mainland = d3Geo.geoConicEquidistant().rotate([-136, -22]).parallels([40, 34]), mainlandPoint, //gis.stackexchange.com/a/73135
hokkaido = d3Geo.geoConicEquidistant().rotate([-146, -26]).parallels([40, 34]), hokkaidoPoint, okinawa = d3Geo.geoConicEquidistant().rotate([-126, -19]).parallels([40, 34]), okinawaPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var mainlandBbox = [[126.0, 41.606], [142.97, 29.97]];
var hokkaidoBbox = [[138.7, 45.61], [146.2, 41.2]];
var okinawaBbox = [[122.6, 29.0], [130, 23.7]];
*/
function conicEquidistantJapan(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(mainlandPoint.point(x, y), point) ||
(hokkaidoPoint.point(x, y), point) ||
(okinawaPoint.point(x, y), point);
}
conicEquidistantJapan.invert = function (coordinates) {
var k = mainland.scale(), t = mainland.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
/*
//How are the return values calculated:
console.info("******");
var c0 = hokkaido(hokkaidoBbox[0]);
var x0 = (c0[0] - t[0]) / k;
var y0 = (c0[1] - t[1]) / k;
console.info("p0 hokkaido", x0 + ' - ' + y0);
var c1 = hokkaido(hokkaidoBbox[1]);
var x1 = (c1[0] - t[0]) / k;
var y1 = (c1[1] - t[1]) / k;
console.info("p1 hokkaido", x1 + ' - ' + y1);
c0 = okinawa(okinawaBbox[0]);
x0 = (c0[0] - t[0]) / k;
y0 = (c0[1] - t[1]) / k;
console.info("p0 okinawa", x0 + ' - ' + y0);
c1 = okinawa(okinawaBbox[1]);
x1 = (c1[0] - t[0]) / k;
y1 = (c1[1] - t[1]) / k;
console.info("p1 okinawa", x1 + ' - ' + y1);
*/
return (y >= -0.10925 && y < -0.02701 && x >= -0.135 && x < -0.0397 ? hokkaido
: y >= 0.04713 && y < 0.11138 && x >= -0.03986 && x < 0.051 ? okinawa
: mainland).invert(coordinates);
};
conicEquidistantJapan.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$6([mainland.stream(cacheStream = stream), hokkaido.stream(stream), okinawa.stream(stream)]);
};
conicEquidistantJapan.precision = function (_) {
if (!arguments.length) {
return mainland.precision();
}
mainland.precision(_);
hokkaido.precision(_);
okinawa.precision(_);
return reset();
};
conicEquidistantJapan.scale = function (_) {
if (!arguments.length) {
return mainland.scale();
}
mainland.scale(_);
hokkaido.scale(_);
okinawa.scale(_ * 0.7);
return conicEquidistantJapan.translate(mainland.translate());
};
conicEquidistantJapan.translate = function (_) {
if (!arguments.length) {
return mainland.translate();
}
var k = mainland.scale(), x = +_[0], y = +_[1];
/*
var c0 = mainland(mainlandBbox[0]);
var x0 = (x - c0[0]) / k;
var y0 = (y - c0[1]) / k;
var c1 = mainland(mainlandBbox[1]);
var x1 = (x - c1[0]) / k;
var y1 = (y - c1[1]) / k;
console.info('Main: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k]])');
c0 = hokkaido.translate([x - 0.0425 * k, y - 0.005 * k])(hokkaidoBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = hokkaido.translate([x - 0.0425 * k, y - 0.005 * k])(hokkaidoBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('hokkaido: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
c0 = okinawa.translate([x - 0 * k, y + 0 * k])(okinawaBbox[0]);
x0 = (x - c0[0]) / k;
y0 = (y - c0[1]) / k;
c1 = okinawa.translate([x - 0 * k, y + 0 * k])(okinawaBbox[1]);
x1 = (x - c1[0]) / k;
y1 = (y - c1[1]) / k;
console.info('okinawa: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
console.info('.clipExtent([[x '+
(x0<0?'+ ':'- ') + Math.abs(x0.toFixed(4))+
' * k + epsilon, y '+
(y0<0?'+ ':'- ') + Math.abs(y0.toFixed(4))+
' * k + epsilon],[x '+
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
' * k - epsilon, y '+
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
' * k - epsilon]])');
*/
mainlandPoint = mainland
.translate(_)
.clipExtent([[x - 0.1352 * k, y - 0.1091 * k], [x + 0.117 * k, y + 0.098 * k]])
.stream(pointStream);
hokkaidoPoint = hokkaido
.translate([x - 0.0425 * k, y - 0.005 * k])
.clipExtent([[x - 0.135 * k + epsilon, y - 0.1093 * k + epsilon], [x - 0.0397 * k - epsilon, y - 0.027 * k - epsilon]])
.stream(pointStream);
okinawaPoint = okinawa
.translate(_)
.clipExtent([[x - 0.0399 * k + epsilon, y + 0.0471 * k + epsilon], [x + 0.051 * k - epsilon, y + 0.1114 * k - epsilon]])
.stream(pointStream);
return reset();
};
conicEquidistantJapan.fitExtent = function (extent, object) {
return fitExtent(conicEquidistantJapan, extent, object);
};
conicEquidistantJapan.fitSize = function (size, object) {
return fitSize(conicEquidistantJapan, size, object);
};
function reset() {
cache = cacheStream = null;
return conicEquidistantJapan;
}
conicEquidistantJapan.drawCompositionBorders = function (context) {
/*
console.info("CLIP EXTENT hokkaido: ", hokkaido.clipExtent());
console.info("UL BBOX:", mainland.invert([hokkaido.clipExtent()[0][0], hokkaido.clipExtent()[0][1]]));
console.info("UR BBOX:", mainland.invert([hokkaido.clipExtent()[1][0], hokkaido.clipExtent()[0][1]]));
console.info("LD BBOX:", mainland.invert([hokkaido.clipExtent()[1][0], hokkaido.clipExtent()[1][1]]));
console.info("LL BBOX:", mainland.invert([hokkaido.clipExtent()[0][0], hokkaido.clipExtent()[1][1]]));
*/
var ulhokkaido = mainland([126.01320483689143, 41.621090310215585]);
var urhokkaido = mainland([133.04304387025903, 42.15087523707186]);
var ldhokkaido = mainland([133.3021766080688, 37.43975444725098]);
var llhokkaido = mainland([126.87889168628224, 36.95488945159779]);
var llokinawa = mainland([132.9, 29.8]);
var lmokinawa = mainland([134, 33]);
var lrokinawa = mainland([139.3, 33.2]);
var llrokinawa = mainland([139.16, 30.5]);
context.moveTo(ulhokkaido[0], ulhokkaido[1]);
context.lineTo(urhokkaido[0], urhokkaido[1]);
context.lineTo(ldhokkaido[0], ldhokkaido[1]);
context.lineTo(llhokkaido[0], llhokkaido[1]);
context.closePath();
context.moveTo(llokinawa[0], llokinawa[1]);
context.lineTo(lmokinawa[0], lmokinawa[1]);
context.lineTo(lrokinawa[0], lrokinawa[1]);
context.lineTo(llrokinawa[0], llrokinawa[1]);
};
conicEquidistantJapan.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return conicEquidistantJapan.scale(2200);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$7(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 France, configured by default for 960×500.
function conicConformalFrance() {
var cache, cacheStream, europe = d3Geo.geoConicConformal().rotate([-3, -46.2]).parallels([0, 60]), europePoint, guyane = d3Geo.geoMercator().center([-53.2, 3.9]), guyanePoint, martinique = d3Geo.geoMercator().center([-61.03, 14.67]), martiniquePoint, guadeloupe = d3Geo.geoMercator().center([-61.46, 16.14]), guadeloupePoint, saintBarthelemy = d3Geo.geoMercator().center([-62.85, 17.92]), saintBarthelemyPoint, stPierreMiquelon = d3Geo.geoMercator().center([-56.23, 46.93]), stPierreMiquelonPoint, mayotte = d3Geo.geoMercator().center([45.16, -12.8]), mayottePoint, reunion = d3Geo.geoMercator().center([55.52, -21.13]), reunionPoint, nouvelleCaledonie = d3Geo.geoMercator().center([165.8, -21.07]), nouvelleCaledoniePoint, wallisFutuna = d3Geo.geoMercator().center([-178.1, -14.3]), wallisFutunaPoint, polynesie = d3Geo.geoMercator().center([-150.55, -17.11]), polynesiePoint, polynesie2 = d3Geo.geoMercator().center([-150.55, -17.11]), polynesie2Point, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var europeBbox = [[-6.5, 51], [10, 41]];
var guyaneBbox = [[-54.5, 6.29], [-50.9, 1.48]];
*/
function conicConformalFrance(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(europePoint.point(x, y), point) ||
(guyanePoint.point(x, y), point) ||
(martiniquePoint.point(x, y), point) ||
(guadeloupePoint.point(x, y), point) ||
(saintBarthelemyPoint.point(x, y), point) ||
(stPierreMiquelonPoint.point(x, y), point) ||
(mayottePoint.point(x, y), point) ||
(reunionPoint.point(x, y), point) ||
(nouvelleCaledoniePoint.point(x, y), point) ||
(wallisFutunaPoint.point(x, y), point) ||
(polynesiePoint.point(x, y), point) ||
(polynesie2Point.point(x, y), point);
}
conicConformalFrance.invert = function (coordinates) {
var k = europe.scale(), t = europe.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
return (y >= 0.029 && y < 0.0864 && x >= -0.14 && x < -0.0996 ? guyane
: y >= 0 && y < 0.029 && x >= -0.14 && x < -0.0996 ? martinique
: y >= -0.032 && y < 0 && x >= -0.14 && x < -0.0996 ? guadeloupe
: y >= -0.052 && y < -0.032 && x >= -0.14 && x < -0.0996 ? saintBarthelemy
: y >= -0.076 && y < 0.052 && x >= -0.14 && x < -0.0996 ? stPierreMiquelon
: y >= -0.076 && y < -0.052 && x >= 0.0967 && x < 0.1371 ? mayotte
: y >= -0.052 && y < -0.02 && x >= 0.0967 && x < 0.1371 ? reunion
: y >= -0.02 && y < 0.012 && x >= 0.0967 && x < 0.1371 ? nouvelleCaledonie
: y >= 0.012 && y < 0.033 && x >= 0.0967 && x < 0.1371 ? wallisFutuna
: y >= 0.033 && y < 0.0864 && x >= 0.0967 && x < 0.1371 ? polynesie
: europe).invert(coordinates);
};
conicConformalFrance.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$7([europe.stream(cacheStream = stream), guyane.stream(stream), martinique.stream(stream), guadeloupe.stream(stream), saintBarthelemy.stream(stream), stPierreMiquelon.stream(stream), mayotte.stream(stream), reunion.stream(stream), nouvelleCaledonie.stream(stream), wallisFutuna.stream(stream), polynesie.stream(stream), polynesie2.stream(stream)]);
};
conicConformalFrance.precision = function (_) {
if (!arguments.length) {
return europe.precision();
}
europe.precision(_);
guyane.precision(_);
martinique.precision(_);
guadeloupe.precision(_);
saintBarthelemy.precision(_);
stPierreMiquelon.precision(_);
mayotte.precision(_);
reunion.precision(_);
nouvelleCaledonie.precision(_);
wallisFutuna.precision(_);
polynesie.precision(_);
polynesie2.precision(_);
return reset();
};
conicConformalFrance.scale = function (_) {
if (!arguments.length) {
return europe.scale();
}
europe.scale(_);
guyane.scale(_ * 0.6);
martinique.scale(_ * 1.6);
guadeloupe.scale(_ * 1.4);
saintBarthelemy.scale(_ * 5);
stPierreMiquelon.scale(_ * 1.3);
mayotte.scale(_ * 1.6);
reunion.scale(_ * 1.2);
nouvelleCaledonie.scale(_ * 0.3);
wallisFutuna.scale(_ * 2.7);
polynesie.scale(_ * 0.5);
polynesie2.scale(_ * 0.06);
return conicConformalFrance.translate(europe.translate());
};
conicConformalFrance.translate = function (_) {
if (!arguments.length) {
return europe.translate();
}
var k = europe.scale(), x = +_[0], y = +_[1];
europePoint = europe
.translate(_)
.clipExtent([[x - 0.0996 * k, y - 0.0908 * k], [x + 0.0967 * k, y + 0.0864 * k]])
.stream(pointStream);
guyanePoint = guyane
.translate([x - 0.12 * k, y + 0.0575 * k])
.clipExtent([[x - 0.14 * k + epsilon, y + 0.029 * k + epsilon], [x - 0.0996 * k - epsilon, y + 0.0864 * k - epsilon]])
.stream(pointStream);
martiniquePoint = martinique
.translate([x - 0.12 * k, y + 0.013 * k])
.clipExtent([[x - 0.14 * k + epsilon, y + 0 * k + epsilon], [x - 0.0996 * k - epsilon, y + 0.029 * k - epsilon]])
.stream(pointStream);
guadeloupePoint = guadeloupe
.translate([x - 0.12 * k, y - 0.014 * k])
.clipExtent([[x - 0.14 * k + epsilon, y - 0.032 * k + epsilon], [x - 0.0996 * k - epsilon, y + 0 * k - epsilon]])
.stream(pointStream);
saintBarthelemyPoint = saintBarthelemy
.translate([x - 0.12 * k, y - 0.044 * k])
.clipExtent([[x - 0.14 * k + epsilon, y - 0.052 * k + epsilon], [x - 0.0996 * k - epsilon, y - 0.032 * k - epsilon]])
.stream(pointStream);
stPierreMiquelonPoint = stPierreMiquelon
.translate([x - 0.12 * k, y - 0.065 * k])
.clipExtent([[x - 0.14 * k + epsilon, y - 0.076 * k + epsilon], [x - 0.0996 * k - epsilon, y - 0.052 * k - epsilon]])
.stream(pointStream);
mayottePoint = mayotte
.translate([x + 0.117 * k, y - 0.064 * k])
.clipExtent([[x + 0.0967 * k + epsilon, y - 0.076 * k + epsilon], [x + 0.1371 * k - epsilon, y - 0.052 * k - epsilon]])
.stream(pointStream);
reunionPoint = reunion
.translate([x + 0.116 * k, y - 0.0355 * k])
.clipExtent([[x + 0.0967 * k + epsilon, y - 0.052 * k + epsilon], [x + 0.1371 * k - epsilon, y - 0.02 * k - epsilon]])
.stream(pointStream);
nouvelleCaledoniePoint = nouvelleCaledonie
.translate([x + 0.116 * k, y - 0.0048 * k])
.clipExtent([[x + 0.0967 * k + epsilon, y - 0.02 * k + epsilon], [x + 0.1371 * k - epsilon, y + 0.012 * k - epsilon]])
.stream(pointStream);
wallisFutunaPoint = wallisFutuna
.translate([x + 0.116 * k, y + 0.022 * k])
.clipExtent([[x + 0.0967 * k + epsilon, y + 0.012 * k + epsilon], [x + 0.1371 * k - epsilon, y + 0.033 * k - epsilon]])
.stream(pointStream);
polynesie2Point = polynesie2
.translate([x + 0.11 * k, y + 0.045 * k])
.clipExtent([[x + 0.0967 * k + epsilon, y + 0.033 * k + epsilon], [x + 0.1371 * k - epsilon, y + 0.06 * k - epsilon]])
.stream(pointStream);
polynesiePoint = polynesie
.translate([x + 0.115 * k, y + 0.075 * k])
.clipExtent([[x + 0.0967 * k + epsilon, y + 0.06 * k + epsilon], [x + 0.1371 * k - epsilon, y + 0.0864 * k - epsilon]])
.stream(pointStream);
return reset();
};
conicConformalFrance.fitExtent = function (extent, object) {
return fitExtent(conicConformalFrance, extent, object);
};
conicConformalFrance.fitSize = function (size, object) {
return fitSize(conicConformalFrance, size, object);
};
function reset() {
cache = cacheStream = null;
return conicConformalFrance;
}
conicConformalFrance.drawCompositionBorders = function (context) {
/*
console.log("var ul, ur, ld, ll;");
var projs = [guyane, martinique, guadeloupe, saintBarthelemy, stPierreMiquelon, mayotte, reunion, nouvelleCaledonie, wallisFutuna, polynesie, polynesie2];
for (var i in projs){
var ul = europe.invert([projs[i].clipExtent()[0][0], projs[i].clipExtent()[0][1]]);
var ur = europe.invert([projs[i].clipExtent()[1][0], projs[i].clipExtent()[0][1]]);
var ld = europe.invert([projs[i].clipExtent()[1][0], projs[i].clipExtent()[1][1]]);
var ll = europe.invert([projs[i].clipExtent()[0][0], projs[i].clipExtent()[1][1]]);
console.log("ul = europe(["+ul+"]);");
console.log("ur = europe(["+ur+"]);");
console.log("ld = europe(["+ld+"]);");
console.log("ll = europe(["+ll+"]);");
console.log("context.moveTo(ul[0], ul[1]);");
console.log("context.lineTo(ur[0], ur[1]);");
console.log("context.lineTo(ld[0], ld[1]);");
console.log("context.lineTo(ll[0], ll[1]);");
console.log("context.closePath();");
}*/
var ul, ur, ld, ll;
ul = europe([-7.938886725111036, 43.7219460918835]);
ur = europe([-4.832080896458295, 44.12930268549372]);
ld = europe([-4.205299743793263, 40.98096346967365]);
ll = europe([-7.071796453126152, 40.610037319181444]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([-8.42751373617692, 45.32889452553031]);
ur = europe([-5.18599305777107, 45.7566442062976]);
ld = europe([-4.832080905154431, 44.129302726751426]);
ll = europe([-7.938886737126192, 43.72194613263854]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([-9.012656899657046, 47.127733821030176]);
ur = europe([-5.6105244772793155, 47.579777861410626]);
ld = europe([-5.185993067168585, 45.756644248170346]);
ll = europe([-8.427513749141811, 45.32889456686326]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([-9.405747558985553, 48.26506375557457]);
ur = europe([-5.896175018439575, 48.733352850851624]);
ld = europe([-5.610524487556043, 47.57977790393761]);
ll = europe([-9.012656913808351, 47.127733862971255]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([-9.908436061346974, 49.642448789505856]);
ur = europe([-6.262026716233124, 50.131426841787174]);
ld = europe([-5.896175029331232, 48.73335289377258]);
ll = europe([-9.40574757396393, 48.26506379787767]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([11.996907706504462, 50.16039028163579]);
ur = europe([15.649907879773343, 49.68279246765253]);
ld = europe([15.156712840526632, 48.30371557625831]);
ll = europe([11.64122661754411, 48.761078240546816]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([11.641226606955788, 48.7610781975889]);
ur = europe([15.156712825832164, 48.30371553390465]);
ld = europe([14.549932166241172, 46.4866532486199]);
ll = europe([11.204443787952183, 46.91899233914248]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([11.204443778297161, 46.918992296823646]);
ur = europe([14.549932152815039, 46.486653206856396]);
ld = europe([13.994409796764009, 44.695833444323256]);
ll = europe([10.805306599253848, 45.105133870684924]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([10.805306590412085, 45.10513382903308]);
ur = europe([13.99440978444733, 44.695833403183606]);
ld = europe([13.654633799024392, 43.53552468558152]);
ll = europe([10.561516803980956, 43.930671459798624]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([10.561516795617383, 43.93067141859757]);
ur = europe([13.654633787361952, 43.5355246448671]);
ld = europe([12.867691604239901, 40.640701985019405]);
ll = europe([9.997809515987688, 41.00288343254471]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([10.8, 42.4]);
ur = europe([12.8, 42.13]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
};
conicConformalFrance.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return conicConformalFrance.scale(2700);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$8(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 Portugal, configured by default for 960×500.
function conicConformalEurope() {
var cache, cacheStream, europe = d3Geo.geoConicConformal().rotate([-10, -53]).parallels([0, 60]), europePoint, guadeloupe = d3Geo.geoMercator().center([-61.46, 16.14]), guadeloupePoint, guyane = d3Geo.geoMercator().center([-53.2, 3.9]), guyanePoint, azores = d3Geo.geoConicConformal().rotate([27.8, -38.9]).parallels([0, 60]), azoresPoint, azores2 = d3Geo.geoConicConformal().rotate([25.43, -37.398]).parallels([0, 60]), azores2Point, azores3 = d3Geo.geoConicConformal().rotate([31.17, -39.539]).parallels([0, 60]), azores3Point, madeira = d3Geo.geoConicConformal().rotate([17, -32.7]).parallels([0, 60]), madeiraPoint, canaryIslands = d3Geo.geoConicConformal().rotate([16, -28.5]).parallels([0, 60]), canaryIslandsPoint, martinique = d3Geo.geoMercator().center([-61.03, 14.67]), martiniquePoint, mayotte = d3Geo.geoMercator().center([45.16, -12.8]), mayottePoint, reunion = d3Geo.geoMercator().center([55.52, -21.13]), reunionPoint, malta = d3Geo.geoConicConformal().rotate([-14.4, -35.95]).parallels([0, 60]), maltaPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
/*
var europeBbox = [[-6.5, 51], [10, 41]];
var guyaneBbox = [[-54.5, 6.29], [-50.9, 1.48]];
*/
function conicConformalEurope(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(europePoint.point(x, y), point) ||
(guyanePoint.point(x, y), point) ||
(martiniquePoint.point(x, y), point) ||
(guadeloupePoint.point(x, y), point) ||
(canaryIslandsPoint.point(x, y), point) ||
(madeiraPoint.point(x, y), point) ||
(mayottePoint.point(x, y), point) ||
(reunionPoint.point(x, y), point) ||
(maltaPoint.point(x, y), point) ||
(azoresPoint.point(x, y), point) ||
(azores2Point.point(x, y), point) ||
(azores3Point.point(x, y), point);
}
conicConformalEurope.invert = function (coordinates) {
var k = europe.scale(), t = europe.translate(), x = (coordinates[0] - (t[0] + 0.08 * k)) / k, y = (coordinates[1] - t[1]) / k;
return (y >= -0.31 && y < -0.24 && x >= 0.14 && x < 0.24 ? guadeloupe
: y >= -0.24 && y < -0.17 && x >= 0.14 && x < 0.24 ? guyane
: y >= -0.17 && y < -0.12 && x >= 0.21 && x < 0.24 ? azores2
: y >= -0.17 && y < -0.14 && x >= 0.14 && x < 0.165 ? azores3
: y >= -0.17 && y < -0.1 && x >= 0.14 && x < 0.24 ? azores
: y >= -0.1 && y < -0.03 && x >= 0.14 && x < 0.24 ? madeira
: y >= -0.03 && y < 0.04 && x >= 0.14 && x < 0.24 ? canaryIslands
: y >= -0.31 && y < -0.24 && x >= 0.24 && x < 0.34 ? martinique
: y >= -0.24 && y < -0.17 && x >= 0.24 && x < 0.34 ? mayotte
: y >= -0.17 && y < -0.1 && x >= 0.24 && x < 0.34 ? reunion
: y >= -0.1 && y < -0.03 && x >= 0.24 && x < 0.34 ? malta
: europe).invert(coordinates);
};
conicConformalEurope.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$8([europe.stream(cacheStream = stream), guyane.stream(stream), martinique.stream(stream), guadeloupe.stream(stream), canaryIslands.stream(stream), madeira.stream(stream), mayotte.stream(stream), reunion.stream(stream), malta.stream(stream), azores.stream(stream), azores2.stream(stream), azores3.stream(stream)]);
};
conicConformalEurope.precision = function (_) {
if (!arguments.length) {
return europe.precision();
}
europe.precision(_);
guyane.precision(_);
martinique.precision(_);
guadeloupe.precision(_);
canaryIslands.precision(_);
madeira.precision(_);
mayotte.precision(_);
reunion.precision(_);
malta.precision(_);
azores.precision(_);
azores2.precision(_);
azores3.precision(_);
return reset();
};
conicConformalEurope.scale = function (_) {
if (!arguments.length) {
return europe.scale();
}
europe.scale(_);
guadeloupe.scale(_ * 3);
guyane.scale(_ * 0.8);
martinique.scale(_ * 3.5);
reunion.scale(_ * 2.7);
azores.scale(_ * 2);
azores2.scale(_ * 2);
azores3.scale(_ * 2);
madeira.scale(_ * 3);
canaryIslands.scale(_);
mayotte.scale(_ * 5.5);
malta.scale(_ * 6);
return conicConformalEurope.translate(europe.translate());
};
conicConformalEurope.translate = function (_) {
if (!arguments.length) {
return europe.translate();
}
var k = europe.scale(), x = +_[0], y = +_[1];
europePoint = europe
.translate([x - 0.08 * k, y])
.clipExtent([[x - 0.51 * k, y - 0.33 * k], [x + 0.5 * k, y + 0.33 * k]])
.stream(pointStream);
guadeloupePoint = guadeloupe
.translate([x + 0.19 * k, y - 0.275 * k])
.clipExtent([[x + 0.14 * k + epsilon, y - 0.31 * k + epsilon], [x + 0.24 * k - epsilon, y - 0.24 * k - epsilon]])
.stream(pointStream);
guyanePoint = guyane
.translate([x + 0.19 * k, y - 0.205 * k])
.clipExtent([[x + 0.14 * k + epsilon, y - 0.24 * k + epsilon], [x + 0.24 * k - epsilon, y - 0.17 * k - epsilon]])
.stream(pointStream);
azoresPoint = azores
.translate([x + 0.19 * k, y - 0.135 * k])
.clipExtent([[x + 0.14 * k + epsilon, y - 0.17 * k + epsilon], [x + 0.24 * k - epsilon, y - 0.1 * k - epsilon]])
.stream(pointStream);
azores2Point = azores2
.translate([x + 0.225 * k, y - 0.147 * k])
.clipExtent([[x + 0.21 * k + epsilon, y - 0.17 * k + epsilon], [x + 0.24 * k - epsilon, y - 0.12 * k - epsilon]])
.stream(pointStream);
azores3Point = azores3
.translate([x + 0.153 * k, y - 0.15 * k])
.clipExtent([[x + 0.14 * k + epsilon, y - 0.17 * k + epsilon], [x + 0.165 * k - epsilon, y - 0.14 * k - epsilon]])
.stream(pointStream);
madeiraPoint = madeira
.translate([x + 0.19 * k, y - 0.065 * k])
.clipExtent([[x + 0.14 * k + epsilon, y - 0.1 * k + epsilon], [x + 0.24 * k - epsilon, y - 0.03 * k - epsilon]])
.stream(pointStream);
canaryIslandsPoint = canaryIslands
.translate([x + 0.19 * k, y + 0.005 * k])
.clipExtent([[x + 0.14 * k + epsilon, y - 0.03 * k + epsilon], [x + 0.24 * k - epsilon, y + 0.04 * k - epsilon]])
.stream(pointStream);
martiniquePoint = martinique
.translate([x + 0.29 * k, y - 0.275 * k])
.clipExtent([[x + 0.24 * k + epsilon, y - 0.31 * k + epsilon], [x + 0.34 * k - epsilon, y - 0.24 * k - epsilon]])
.stream(pointStream);
mayottePoint = mayotte
.translate([x + 0.29 * k, y - 0.205 * k])
.clipExtent([[x + 0.24 * k + epsilon, y - 0.24 * k + epsilon], [x + 0.34 * k - epsilon, y - 0.17 * k - epsilon]])
.stream(pointStream);
reunionPoint = reunion
.translate([x + 0.29 * k, y - 0.135 * k])
.clipExtent([[x + 0.24 * k + epsilon, y - 0.17 * k + epsilon], [x + 0.34 * k - epsilon, y - 0.1 * k - epsilon]])
.stream(pointStream);
maltaPoint = malta
.translate([x + 0.29 * k, y - 0.065 * k])
.clipExtent([[x + 0.24 * k + epsilon, y - 0.1 * k + epsilon], [x + 0.34 * k - epsilon, y - 0.03 * k - epsilon]])
.stream(pointStream);
return reset();
};
conicConformalEurope.fitExtent = function (extent, object) {
return fitExtent(conicConformalEurope, extent, object);
};
conicConformalEurope.fitSize = function (size, object) {
return fitSize(conicConformalEurope, size, object);
};
function reset() {
cache = cacheStream = null;
return conicConformalEurope;
}
conicConformalEurope.drawCompositionBorders = function (context) {
/*
console.log("var ul, ur, ld, ll;");
var projs = [guyane, martinique, guadeloupe, canaryIslands, madeira, mayotte, reunion, malta, azores, azores2, azores3];
for (var i in projs){
var ul = europe.invert([projs[i].clipExtent()[0][0], projs[i].clipExtent()[0][1]]);
var ur = europe.invert([projs[i].clipExtent()[1][0], projs[i].clipExtent()[0][1]]);
var ld = europe.invert([projs[i].clipExtent()[1][0], projs[i].clipExtent()[1][1]]);
var ll = europe.invert([projs[i].clipExtent()[0][0], projs[i].clipExtent()[1][1]]);
console.log("ul = europe(["+ul+"]);");
console.log("ur = europe(["+ur+"]);");
console.log("ld = europe(["+ld+"]);");
console.log("ll = europe(["+ll+"]);");
console.log("context.moveTo(ul[0], ul[1]);");
console.log("context.lineTo(ur[0], ur[1]);");
console.log("context.lineTo(ld[0], ld[1]);");
console.log("context.lineTo(ll[0], ll[1]);");
console.log("context.closePath();");
}*/
var ul, ur, ld, ll;
ul = europe([42.45755610828648, 63.343658547914934]);
ur = europe([52.65837266667029, 59.35045080290929]);
ld = europe([47.19754502247785, 56.12653496548117]);
ll = europe([37.673034273363044, 59.61638268506111]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([59.41110754003403, 62.35069727399336]);
ur = europe([66.75050228640794, 57.11797303636038]);
ld = europe([60.236065725110436, 54.63331433818992]);
ll = europe([52.65837313153311, 59.350450804599355]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([48.81091130080243, 66.93353402634641]);
ur = europe([59.41110730654679, 62.35069740653086]);
ld = europe([52.6583728974441, 59.3504509222445]);
ll = europe([42.45755631675751, 63.34365868805821]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([31.054198418446475, 52.1080673766184]);
ur = europe([39.09869284884117, 49.400700047190554]);
ld = europe([36.0580811499175, 46.02944174908498]);
ll = europe([28.690508588835726, 48.433126979386415]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([33.977877745912025, 55.849945501331]);
ur = europe([42.75328432167726, 52.78455122462353]);
ld = europe([39.09869297540224, 49.400700176148625]);
ll = europe([31.05419851807008, 52.10806751810923]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([52.658372900759296, 59.35045068526415]);
ur = europe([60.23606549583304, 54.63331423800264]);
ld = europe([54.6756370953122, 51.892298789399455]);
ll = europe([47.19754524788189, 56.126534861222794]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([47.19754506082455, 56.126534735591456]);
ur = europe([54.675636900123514, 51.892298681337095]);
ld = europe([49.94448648951486, 48.98775484983285]);
ll = europe([42.75328468716108, 52.78455126060818]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([42.75328453416769, 52.78455113209101]);
ur = europe([49.94448632339758, 48.98775473706457]);
ld = europe([45.912339990394315, 45.99361784987003]);
ll = europe([39.09869317356607, 49.40070009378711]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([37.673034114296634, 59.61638254183119]);
ur = europe([47.197544835420544, 56.126534839849846]);
ld = europe([42.75328447467064, 52.78455135314068]);
ll = europe([33.977877870363905, 55.849945644671145]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([44.56748486446032, 57.26489367845818]);
ld = europe([43.9335791193588, 53.746540942601726]);
ll = europe([43, 56]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = europe([37.673034114296634, 59.61638254183119]);
ur = europe([40.25902691953466, 58.83002044222639]);
ld = europe([38.458270492742024, 57.26232178028002]);
ll = europe([35.97754948030156, 58.00266637992386]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
};
conicConformalEurope.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return conicConformalEurope.scale(750);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$9(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 Malaysia, configured by default for 960×500.
function mercatorMalaysia() {
var cache, cacheStream, peninsular = d3Geo.geoMercator().center([105.25, 4.00]), peninsularPoint, borneo = d3Geo.geoMercator().center([118.65, 2.86]), borneoPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
function mercatorMalaysia(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(peninsularPoint.point(x, y), point) ||
(borneoPoint.point(x, y), point);
}
mercatorMalaysia.invert = function (coordinates) {
var k = peninsular.scale(), t = peninsular.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
return (y >= -0.0521 && y < 0.0229 && x >= -0.0111 && x < 0.1000 ? borneo
: peninsular).invert(coordinates);
};
mercatorMalaysia.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$9([peninsular.stream(cacheStream = stream), borneo.stream(stream)]);
};
mercatorMalaysia.precision = function (_) {
if (!arguments.length) {
return peninsular.precision();
}
peninsular.precision(_);
borneo.precision(_);
return reset();
};
mercatorMalaysia.scale = function (_) {
if (!arguments.length) {
return peninsular.scale();
}
peninsular.scale(_);
borneo.scale(_ * 0.615);
return mercatorMalaysia.translate(peninsular.translate());
};
mercatorMalaysia.translate = function (_) {
if (!arguments.length) {
return peninsular.translate();
}
var k = peninsular.scale(), x = +_[0], y = +_[1];
peninsularPoint = peninsular
.translate(_)
.clipExtent([[x - 0.1100 * k, y - 0.0521 * k], [x - 0.0111 * k, y + 0.0521 * k]])
.stream(pointStream);
borneoPoint = borneo
.translate([x + 0.09000 * k, y - 0.00 * k])
.clipExtent([[x - 0.0111 * k + epsilon, y - 0.0521 * k + epsilon], [x + 0.1000 * k - epsilon, y + 0.024 * k - epsilon]])
.stream(pointStream);
return reset();
};
mercatorMalaysia.fitExtent = function (extent, object) {
return fitExtent(mercatorMalaysia, extent, object);
};
mercatorMalaysia.fitSize = function (size, object) {
return fitSize(mercatorMalaysia, size, object);
};
function reset() {
cache = cacheStream = null;
return mercatorMalaysia;
}
mercatorMalaysia.drawCompositionBorders = function (context) {
var llbor = peninsular([106.3214, 2.0228]);
var lmbor = peninsular([105.1843, 2.3761]);
var lrbor = peninsular([104.2151, 3.3618]);
var llrbor = peninsular([104.2150, 4.5651]);
context.moveTo(llbor[0], llbor[1]);
context.lineTo(lmbor[0], lmbor[1]);
context.lineTo(lrbor[0], lrbor[1]);
context.lineTo(llrbor[0], llrbor[1]);
};
mercatorMalaysia.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return mercatorMalaysia.scale(4800);
}
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex$a(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 Equatorial Guinea, configured by default for 960×500.
function mercatorEquatorialGuinea() {
var cache, cacheStream, continent = d3Geo.geoMercator().rotate([-9.5, -1.5]), continentPoint, bioko = d3Geo.geoMercator().rotate([-8.6, -3.5]), biokoPoint, annobon = d3Geo.geoMercator().rotate([-5.6, 1.45]), annobonPoint, point, pointStream = { point: function (x, y) { point = [x, y]; } };
function mercatorEquatorialGuinea(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(continentPoint.point(x, y), point) ||
(biokoPoint.point(x, y), point) ||
(annobonPoint.point(x, y), point);
}
mercatorEquatorialGuinea.invert = function (coordinates) {
var k = continent.scale(), t = continent.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
return (y >= -0.02 && y < 0 && x >= -0.038 && x < -0.005 ? bioko
: y >= 0 && y < 0.02 && x >= -0.038 && x < -0.005 ? annobon
: continent).invert(coordinates);
};
mercatorEquatorialGuinea.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = multiplex$a([continent.stream(cacheStream = stream), bioko.stream(stream), annobon.stream(stream)]);
};
mercatorEquatorialGuinea.precision = function (_) {
if (!arguments.length) {
return continent.precision();
}
continent.precision(_);
bioko.precision(_);
annobon.precision(_);
return reset();
};
mercatorEquatorialGuinea.scale = function (_) {
if (!arguments.length) {
return continent.scale();
}
continent.scale(_);
bioko.scale(_ * 1.5);
annobon.scale(_ * 4);
return mercatorEquatorialGuinea.translate(continent.translate());
};
mercatorEquatorialGuinea.translate = function (_) {
if (!arguments.length) {
return continent.translate();
}
var k = continent.scale(), x = +_[0], y = +_[1];
continentPoint = continent
.translate(_)
.clipExtent([[x - 0.005 * k, y - 0.02 * k], [x + 0.038 * k, y + 0.02 * k]])
.stream(pointStream);
biokoPoint = bioko
.translate([x - 0.025 * k, y - 0.01 * k])
.clipExtent([[x - 0.038 * k + epsilon, y - 0.02 * k + epsilon], [x - 0.005 * k - epsilon, y + 0 * k - epsilon]])
.stream(pointStream);
annobonPoint = annobon
.translate([x - 0.025 * k, y + 0.01 * k])
.clipExtent([[x - 0.038 * k + epsilon, y - 0 * k + epsilon], [x - 0.005 * k - epsilon, y + 0.02 * k - epsilon]])
.stream(pointStream);
return reset();
};
mercatorEquatorialGuinea.fitExtent = function (extent, object) {
return fitExtent(mercatorEquatorialGuinea, extent, object);
};
mercatorEquatorialGuinea.fitSize = function (size, object) {
return fitSize(mercatorEquatorialGuinea, size, object);
};
function reset() {
cache = cacheStream = null;
return mercatorEquatorialGuinea;
}
mercatorEquatorialGuinea.drawCompositionBorders = function (context) {
/*
console.log("var ul, ur, ld, ll;");
var projs = [continent, bioko, annobon];
for (var i in projs){
var ul = continent.invert([projs[i].clipExtent()[0][0], projs[i].clipExtent()[0][1]]);
var ur = continent.invert([projs[i].clipExtent()[1][0], projs[i].clipExtent()[0][1]]);
var ld = continent.invert([projs[i].clipExtent()[1][0], projs[i].clipExtent()[1][1]]);
var ll = continent.invert([projs[i].clipExtent()[0][0], projs[i].clipExtent()[1][1]]);
console.log("ul = continent(["+ul+"]);");
console.log("ur = continent(["+ur+"]);");
console.log("ld = continent(["+ld+"]);");
console.log("ll = continent(["+ll+"]);");
console.log("context.moveTo(ul[0], ul[1]);");
console.log("context.lineTo(ur[0], ur[1]);");
console.log("context.lineTo(ld[0], ld[1]);");
console.log("context.lineTo(ll[0], ll[1]);");
console.log("context.closePath();");
}*/
var ul, ur, ld, ll;
ul = continent([9.21327272751682, 2.645820439454123]);
ur = continent([11.679126293239872, 2.644755519268689]);
ld = continent([11.676845389029227, 0.35307824637606433]);
ll = continent([9.213572917774014, 0.35414205204417754]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = continent([7.320873711543669, 2.64475551449975]);
ur = continent([9.213272722738658, 2.645820434679803]);
ld = continent([9.213422896480349, 1.4999812505283054]);
ll = continent([7.322014760520787, 1.4989168878985566]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
ul = continent([7.3220147605302905, 1.4989168783492766]);
ur = continent([9.213422896481598, 1.499981240979021]);
ld = continent([9.213572912999604, 0.354142056817247]);
ll = continent([7.323154615739809, 0.353078251154504]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
};
mercatorEquatorialGuinea.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return mercatorEquatorialGuinea.scale(12000);
}
function multiplex$b(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();
}
};
}
function albersUk() {
var cache, cacheStream, main = d3Geo.geoAlbers()
.rotate([4.4, 0.8])
.center([0, 55.4])
.parallels([50, 60]), mainPoint, shetland = d3Geo.geoAlbers()
.rotate([4.4, 0.8])
.center([0, 55.4])
.parallels([50, 60]), shetlandPoint, point, pointStream = {
point: function (x, y) {
point = [x, y];
}
};
function albersUk(coordinates) {
var x = coordinates[0], y = coordinates[1];
return ((point = null),
(mainPoint.point(x, y), point) || (shetlandPoint.point(x, y), point));
}
albersUk.invert = function (coordinates) {
var k = main.scale(), t = main.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
return (y >= -0.089 && y < 0.06 && x >= 0.029 && x < 0.046
? shetland
: main).invert(coordinates);
};
albersUk.stream = function (stream) {
return cache && cacheStream === stream
? cache
: (cache = multiplex$b([
main.stream((cacheStream = stream)),
shetland.stream(stream)
]));
};
albersUk.precision = function (_) {
if (!arguments.length)
return main.precision();
main.precision(_), shetland.precision(_);
return reset();
};
albersUk.scale = function (_) {
if (!arguments.length)
return main.scale();
main.scale(_), shetland.scale(_);
return albersUk.translate(main.translate());
};
albersUk.translate = function (_) {
if (!arguments.length)
return main.translate();
var k = main.scale(), x = +_[0], y = +_[1];
mainPoint = main
.translate(_)
.clipExtent([
[x - 0.065 * k, y - 0.089 * k],
[x + 0.075 * k, y + 0.089 * k]
])
.stream(pointStream);
shetlandPoint = shetland
.translate([x + 0.01 * k, y + 0.025 * k])
.clipExtent([
[x + 0.029 * k + epsilon, y - 0.089 * k + epsilon],
[x + 0.046 * k - epsilon, y - 0.06 * k - epsilon]
])
.stream(pointStream);
return reset();
};
albersUk.fitExtent = function (extent, object) {
return fitExtent(albersUk, extent, object);
};
albersUk.fitSize = function (size, object) {
return fitSize(albersUk, size, object);
};
function reset() {
cache = cacheStream = null;
return albersUk;
}
albersUk.drawCompositionBorders = function (context) {
/*var ul = main.invert([
shetland.clipExtent()[0][0],
shetland.clipExtent()[0][1]
]);
var ur = main.invert([
shetland.clipExtent()[1][0],
shetland.clipExtent()[0][1]
]);
var ld = main.invert([
shetland.clipExtent()[1][0],
shetland.clipExtent()[1][1]
]);
var ll = main.invert([
shetland.clipExtent()[0][0],
shetland.clipExtent()[1][1]
]);
console.log("ul = main([" + ul + "]);");
console.log("ur = main([" + ur + "]);");
console.log("ld = main([" + ld + "]);");
console.log("ll = main([" + ll + "]);");
console.log("context.moveTo(ul[0], ul[1]);");
console.log("context.lineTo(ur[0], ur[1]);");
console.log("context.lineTo(ld[0], ld[1]);");
console.log("context.lineTo(ll[0], ll[1]);");
console.log("context.closePath();");*/
var ul, ur, ld, ll;
ul = main([-1.113205870242365, 59.64920050773357]);
ur = main([0.807899092399606, 59.59085836472269]);
ld = main([0.5778611961420386, 57.93467822832577]);
ll = main([-1.25867782078448, 57.99029450085142]);
context.moveTo(ul[0], ul[1]);
context.lineTo(ur[0], ur[1]);
context.lineTo(ld[0], ld[1]);
context.lineTo(ll[0], ll[1]);
context.closePath();
};
albersUk.getCompositionBorders = function () {
var context = d3Path.path();
this.drawCompositionBorders(context);
return context.toString();
};
return albersUk.scale(2800);
}
exports.geoAlbersUk = albersUk;
exports.geoAlbersUsa = albersUsa;
exports.geoAlbersUsaTerritories = albersUsaTerritories;
exports.geoConicConformalEurope = conicConformalEurope;
exports.geoConicConformalFrance = conicConformalFrance;
exports.geoConicConformalPortugal = conicConformalPortugal;
exports.geoConicConformalSpain = conicConformalSpain;
exports.geoConicEquidistantJapan = conicEquidistantJapan;
exports.geoMercatorEcuador = mercatorEcuador;
exports.geoMercatorEquatorialGuinea = mercatorEquatorialGuinea;
exports.geoMercatorMalaysia = mercatorMalaysia;
exports.geoTransverseMercatorChile = transverseMercatorChile;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/_d3-dsv@1.2.0@d3-dsv/dist/d3-dsv.js":
/*!**********************************************************!*\
!*** ./node_modules/_d3-dsv@1.2.0@d3-dsv/dist/d3-dsv.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-dsv/ v1.2.0 Copyright 2019 Mike Bostock
(function (global, factory) {
true ? factory(exports) :
undefined;
}(this, function (exports) {
'use strict';
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()) + "-" + 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"
: "");
}
function dsv(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
};
}
var csv = dsv(",");
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;
var tsv = dsv("\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;
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();
exports.autoType = autoType;
exports.csvFormat = csvFormat;
exports.csvFormatBody = csvFormatBody;
exports.csvFormatRow = csvFormatRow;
exports.csvFormatRows = csvFormatRows;
exports.csvFormatValue = csvFormatValue;
exports.csvParse = csvParse;
exports.csvParseRows = csvParseRows;
exports.dsvFormat = dsv;
exports.tsvFormat = tsvFormat;
exports.tsvFormatBody = tsvFormatBody;
exports.tsvFormatRow = tsvFormatRow;
exports.tsvFormatRows = tsvFormatRows;
exports.tsvFormatValue = tsvFormatValue;
exports.tsvParse = tsvParse;
exports.tsvParseRows = tsvParseRows;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/***/ "./node_modules/_d3-geo-projection@2.1.2@d3-geo-projection/build/d3-geo-projection.js":
/*!********************************************************************************************!*\
!*** ./node_modules/_d3-geo-projection@2.1.2@d3-geo-projection/build/d3-geo-projection.js ***!
\********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-geo-projection/ Version 2.1.2. Copyright 2017 Mike Bostock.
(function (global, factory) {
true ? factory(exports, __webpack_require__(/*! d3-geo */ "./node_modules/_d3-geo@1.12.1@d3-geo/dist/d3-geo.js"), __webpack_require__(/*! d3-array */ "./node_modules/_d3-array@1.2.4@d3-array/dist/d3-array.js")) :
undefined;
}(this, (function (exports, d3Geo, d3Array) {
'use strict';
var abs = Math.abs;
var atan = Math.atan;
var atan2 = Math.atan2;
var cos = Math.cos;
var exp = Math.exp;
var floor = Math.floor;
var log = Math.log;
var max = Math.max;
var min = Math.min;
var pow = Math.pow;
var round = Math.round;
var sign = Math.sign || function (x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
var sin = Math.sin;
var tan = Math.tan;
var epsilon = 1e-6;
var epsilon2 = 1e-12;
var pi = Math.PI;
var halfPi = pi / 2;
var quarterPi = pi / 4;
var sqrt1_2 = Math.SQRT1_2;
var sqrt2 = sqrt(2);
var sqrtPi = sqrt(pi);
var tau = pi * 2;
var degrees = 180 / pi;
var radians = pi / 180;
function sinci(x) {
return x ? x / Math.sin(x) : 1;
}
function asin(x) {
return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);
}
function acos(x) {
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
}
function sqrt(x) {
return x > 0 ? Math.sqrt(x) : 0;
}
function tanh(x) {
x = exp(2 * x);
return (x - 1) / (x + 1);
}
function sinh(x) {
return (exp(x) - exp(-x)) / 2;
}
function cosh(x) {
return (exp(x) + exp(-x)) / 2;
}
function arsinh(x) {
return log(x + sqrt(x * x + 1));
}
function arcosh(x) {
return log(x + sqrt(x * x - 1));
}
function airyRaw(beta) {
var tanBeta_2 = tan(beta / 2), b = 2 * log(cos(beta / 2)) / (tanBeta_2 * tanBeta_2);
function forward(x, y) {
var cosx = cos(x), cosy = cos(y), siny = sin(y), cosz = cosy * cosx, k = -((1 - cosz ? log((1 + cosz) / 2) / (1 - cosz) : -0.5) + b / (1 + cosz));
return [k * cosy * sin(x), k * siny];
}
forward.invert = function (x, y) {
var r = sqrt(x * x + y * y), z = -beta / 2, i = 50, delta;
if (!r)
return [0, 0];
do {
var z_2 = z / 2, cosz_2 = cos(z_2), sinz_2 = sin(z_2), tanz_2 = tan(z_2), lnsecz_2 = log(1 / cosz_2);
z -= delta = (2 / tanz_2 * lnsecz_2 - b * tanz_2 - r) / (-lnsecz_2 / (sinz_2 * sinz_2) + 1 - b / (2 * cosz_2 * cosz_2));
} while (abs(delta) > epsilon && --i > 0);
var sinz = sin(z);
return [atan2(x * sinz, r * cos(z)), asin(y * sinz / r)];
};
return forward;
}
var airy = function () {
var beta = halfPi, m = d3Geo.geoProjectionMutator(airyRaw), p = m(beta);
p.radius = function (_) {
return arguments.length ? m(beta = _ * radians) : beta * degrees;
};
return p
.scale(179.976)
.clipAngle(147);
};
function aitoffRaw(x, y) {
var cosy = cos(y), sincia = sinci(acos(cosy * cos(x /= 2)));
return [2 * cosy * sin(x) * sincia, sin(y) * sincia];
}
// Abort if [x, y] is not within an ellipse centered at [0, 0] with
// semi-major axis pi and semi-minor axis pi/2.
aitoffRaw.invert = function (x, y) {
if (x * x + 4 * y * y > pi * pi + epsilon)
return;
var x1 = x, y1 = y, i = 25;
do {
var sinx = sin(x1), sinx_2 = sin(x1 / 2), cosx_2 = cos(x1 / 2), siny = sin(y1), cosy = cos(y1), sin_2y = sin(2 * y1), sin2y = siny * siny, cos2y = cosy * cosy, sin2x_2 = sinx_2 * sinx_2, c = 1 - cos2y * cosx_2 * cosx_2, e = c ? acos(cosy * cosx_2) * sqrt(f = 1 / c) : f = 0, f, fx = 2 * e * cosy * sinx_2 - x, fy = e * siny - y, dxdx = f * (cos2y * sin2x_2 + e * cosy * cosx_2 * sin2y), dxdy = f * (0.5 * sinx * sin_2y - e * 2 * siny * sinx_2), dydx = f * 0.25 * (sin_2y * sinx_2 - e * siny * cos2y * sinx), dydy = f * (sin2y * cosx_2 + e * sin2x_2 * cosy), z = dxdy * dydx - dydy * dxdx;
if (!z)
break;
var dx = (fy * dxdy - fx * dydy) / z, dy = (fx * dydx - fy * dxdx) / z;
x1 -= dx, y1 -= dy;
} while ((abs(dx) > epsilon || abs(dy) > epsilon) && --i > 0);
return [x1, y1];
};
var aitoff = function () {
return d3Geo.geoProjection(aitoffRaw)
.scale(152.63);
};
function armadilloRaw(phi0) {
var sinPhi0 = sin(phi0), cosPhi0 = cos(phi0), sPhi0 = phi0 >= 0 ? 1 : -1, tanPhi0 = tan(sPhi0 * phi0), k = (1 + sinPhi0 - cosPhi0) / 2;
function forward(lambda, phi) {
var cosPhi = cos(phi), cosLambda = cos(lambda /= 2);
return [
(1 + cosPhi) * sin(lambda),
(sPhi0 * phi > -atan2(cosLambda, tanPhi0) - 1e-3 ? 0 : -sPhi0 * 10) + k + sin(phi) * cosPhi0 - (1 + cosPhi) * sinPhi0 * cosLambda // TODO D3 core should allow null or [NaN, NaN] to be returned.
];
}
forward.invert = function (x, y) {
var lambda = 0, phi = 0, i = 50;
do {
var cosLambda = cos(lambda), sinLambda = sin(lambda), cosPhi = cos(phi), sinPhi = sin(phi), A = 1 + cosPhi, fx = A * sinLambda - x, fy = k + sinPhi * cosPhi0 - A * sinPhi0 * cosLambda - y, dxdLambda = A * cosLambda / 2, dxdPhi = -sinLambda * sinPhi, dydLambda = sinPhi0 * A * sinLambda / 2, dydPhi = cosPhi0 * cosPhi + sinPhi0 * cosLambda * sinPhi, denominator = dxdPhi * dydLambda - dydPhi * dxdLambda, dLambda = (fy * dxdPhi - fx * dydPhi) / denominator / 2, dPhi = (fx * dydLambda - fy * dxdLambda) / denominator;
lambda -= dLambda, phi -= dPhi;
} while ((abs(dLambda) > epsilon || abs(dPhi) > epsilon) && --i > 0);
return sPhi0 * phi > -atan2(cos(lambda), tanPhi0) - 1e-3 ? [lambda * 2, phi] : null;
};
return forward;
}
var armadillo = function () {
var phi0 = 20 * radians, sPhi0 = phi0 >= 0 ? 1 : -1, tanPhi0 = tan(sPhi0 * phi0), m = d3Geo.geoProjectionMutator(armadilloRaw), p = m(phi0), stream_ = p.stream;
p.parallel = function (_) {
if (!arguments.length)
return phi0 * degrees;
tanPhi0 = tan((sPhi0 = (phi0 = _ * radians) >= 0 ? 1 : -1) * phi0);
return m(phi0);
};
p.stream = function (stream) {
var rotate = p.rotate(), rotateStream = stream_(stream), sphereStream = (p.rotate([0, 0]), stream_(stream));
p.rotate(rotate);
rotateStream.sphere = function () {
sphereStream.polygonStart(), sphereStream.lineStart();
for (var lambda = sPhi0 * -180; sPhi0 * lambda < 180; lambda += sPhi0 * 90)
sphereStream.point(lambda, sPhi0 * 90);
while (sPhi0 * (lambda -= phi0) >= -180) { // TODO precision?
sphereStream.point(lambda, sPhi0 * -atan2(cos(lambda * radians / 2), tanPhi0) * degrees);
}
sphereStream.lineEnd(), sphereStream.polygonEnd();
};
return rotateStream;
};
return p
.scale(218.695)
.center([0, 28.0974]);
};
function augustRaw(lambda, phi) {
var tanPhi = tan(phi / 2), k = sqrt(1 - tanPhi * tanPhi), c = 1 + k * cos(lambda /= 2), x = sin(lambda) * k / c, y = tanPhi / c, x2 = x * x, y2 = y * y;
return [
4 / 3 * x * (3 + x2 - 3 * y2),
4 / 3 * y * (3 + 3 * x2 - y2)
];
}
augustRaw.invert = function (x, y) {
x *= 3 / 8, y *= 3 / 8;
if (!x && abs(y) > 1)
return null;
var x2 = x * x, y2 = y * y, s = 1 + x2 + y2, sin3Eta = sqrt((s - sqrt(s * s - 4 * y * y)) / 2), eta = asin(sin3Eta) / 3, xi = sin3Eta ? arcosh(abs(y / sin3Eta)) / 3 : arsinh(abs(x)) / 3, cosEta = cos(eta), coshXi = cosh(xi), d = coshXi * coshXi - cosEta * cosEta;
return [
sign(x) * 2 * atan2(sinh(xi) * cosEta, 0.25 - d),
sign(y) * 2 * atan2(coshXi * sin(eta), 0.25 + d)
];
};
var august = function () {
return d3Geo.geoProjection(augustRaw)
.scale(66.1603);
};
var sqrt8 = sqrt(8);
var phi0 = log(1 + sqrt2);
function bakerRaw(lambda, phi) {
var phi0 = abs(phi);
return phi0 < quarterPi
? [lambda, log(tan(quarterPi + phi / 2))]
: [lambda * cos(phi0) * (2 * sqrt2 - 1 / sin(phi0)), sign(phi) * (2 * sqrt2 * (phi0 - quarterPi) - log(tan(phi0 / 2)))];
}
bakerRaw.invert = function (x, y) {
if ((y0 = abs(y)) < phi0)
return [x, 2 * atan(exp(y)) - halfPi];
var phi = quarterPi, i = 25, delta, y0;
do {
var cosPhi_2 = cos(phi / 2), tanPhi_2 = tan(phi / 2);
phi -= delta = (sqrt8 * (phi - quarterPi) - log(tanPhi_2) - y0) / (sqrt8 - cosPhi_2 * cosPhi_2 / (2 * tanPhi_2));
} while (abs(delta) > epsilon2 && --i > 0);
return [x / (cos(phi) * (sqrt8 - 1 / sin(phi))), sign(y) * phi];
};
var baker = function () {
return d3Geo.geoProjection(bakerRaw)
.scale(112.314);
};
function berghausRaw(lobes) {
var k = 2 * pi / lobes;
function forward(lambda, phi) {
var p = d3Geo.geoAzimuthalEquidistantRaw(lambda, phi);
if (abs(lambda) > halfPi) { // back hemisphere
var theta = atan2(p[1], p[0]), r = sqrt(p[0] * p[0] + p[1] * p[1]), theta0 = k * round((theta - halfPi) / k) + halfPi, alpha = atan2(sin(theta -= theta0), 2 - cos(theta)); // angle relative to lobe end
theta = theta0 + asin(pi / r * sin(alpha)) - alpha;
p[0] = r * cos(theta);
p[1] = r * sin(theta);
}
return p;
}
forward.invert = function (x, y) {
var r = sqrt(x * x + y * y);
if (r > halfPi) {
var theta = atan2(y, x), theta0 = k * round((theta - halfPi) / k) + halfPi, s = theta > theta0 ? -1 : 1, A = r * cos(theta0 - theta), cotAlpha = 1 / tan(s * acos((A - pi) / sqrt(pi * (pi - 2 * A) + r * r)));
theta = theta0 + 2 * atan((cotAlpha + s * sqrt(cotAlpha * cotAlpha - 3)) / 3);
x = r * cos(theta), y = r * sin(theta);
}
return d3Geo.geoAzimuthalEquidistantRaw.invert(x, y);
};
return forward;
}
var berghaus = function () {
var lobes = 5, m = d3Geo.geoProjectionMutator(berghausRaw), p = m(lobes), projectionStream = p.stream, epsilon$$1 = 1e-2, cr = -cos(epsilon$$1 * radians), sr = sin(epsilon$$1 * radians);
p.lobes = function (_) {
return arguments.length ? m(lobes = +_) : lobes;
};
p.stream = function (stream) {
var rotate = p.rotate(), rotateStream = projectionStream(stream), sphereStream = (p.rotate([0, 0]), projectionStream(stream));
p.rotate(rotate);
rotateStream.sphere = function () {
sphereStream.polygonStart(), sphereStream.lineStart();
for (var i = 0, delta = 360 / lobes, delta0 = 2 * pi / lobes, phi = 90 - 180 / lobes, phi0 = halfPi; i < lobes; ++i, phi -= delta, phi0 -= delta0) {
sphereStream.point(atan2(sr * cos(phi0), cr) * degrees, asin(sr * sin(phi0)) * degrees);
if (phi < -90) {
sphereStream.point(-90, -180 - phi - epsilon$$1);
sphereStream.point(-90, -180 - phi + epsilon$$1);
}
else {
sphereStream.point(90, phi + epsilon$$1);
sphereStream.point(90, phi - epsilon$$1);
}
}
sphereStream.lineEnd(), sphereStream.polygonEnd();
};
return rotateStream;
};
return p
.scale(87.8076)
.center([0, 17.1875])
.clipAngle(180 - 1e-3);
};
function mollweideBromleyTheta(cp, phi) {
var cpsinPhi = cp * sin(phi), i = 30, delta;
do
phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi));
while (abs(delta) > epsilon && --i > 0);
return phi / 2;
}
function mollweideBromleyRaw(cx, cy, cp) {
function forward(lambda, phi) {
return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)];
}
forward.invert = function (x, y) {
return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)];
};
return forward;
}
var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi);
var mollweide = function () {
return d3Geo.geoProjection(mollweideRaw)
.scale(169.529);
};
var k = 2.00276;
var w = 1.11072;
function boggsRaw(lambda, phi) {
var theta = mollweideBromleyTheta(pi, phi);
return [k * lambda / (1 / cos(phi) + w / cos(theta)), (phi + sqrt2 * sin(theta)) / k];
}
boggsRaw.invert = function (x, y) {
var ky = k * y, theta = y < 0 ? -quarterPi : quarterPi, i = 25, delta, phi;
do {
phi = ky - sqrt2 * sin(theta);
theta -= delta = (sin(2 * theta) + 2 * theta - pi * sin(phi)) / (2 * cos(2 * theta) + 2 + pi * cos(phi) * sqrt2 * cos(theta));
} while (abs(delta) > epsilon && --i > 0);
phi = ky - sqrt2 * sin(theta);
return [x * (1 / cos(phi) + w / cos(theta)) / k, phi];
};
var boggs = function () {
return d3Geo.geoProjection(boggsRaw)
.scale(160.857);
};
var parallel1 = function (projectAt) {
var phi0 = 0, m = d3Geo.geoProjectionMutator(projectAt), p = m(phi0);
p.parallel = function (_) {
return arguments.length ? m(phi0 = _ * radians) : phi0 * degrees;
};
return p;
};
function sinusoidalRaw(lambda, phi) {
return [lambda * cos(phi), phi];
}
sinusoidalRaw.invert = function (x, y) {
return [x / cos(y), y];
};
var sinusoidal = function () {
return d3Geo.geoProjection(sinusoidalRaw)
.scale(152.63);
};
function bonneRaw(phi0) {
if (!phi0)
return sinusoidalRaw;
var cotPhi0 = 1 / tan(phi0);
function forward(lambda, phi) {
var rho = cotPhi0 + phi0 - phi, e = rho ? lambda * cos(phi) / rho : rho;
return [rho * sin(e), cotPhi0 - rho * cos(e)];
}
forward.invert = function (x, y) {
var rho = sqrt(x * x + (y = cotPhi0 - y) * y), phi = cotPhi0 + phi0 - rho;
return [rho / cos(phi) * atan2(x, y), phi];
};
return forward;
}
var bonne = function () {
return parallel1(bonneRaw)
.scale(123.082)
.center([0, 26.1441])
.parallel(45);
};
function bottomleyRaw(sinPsi) {
function forward(lambda, phi) {
var rho = halfPi - phi, eta = rho ? lambda * sinPsi * sin(rho) / rho : rho;
return [rho * sin(eta) / sinPsi, halfPi - rho * cos(eta)];
}
forward.invert = function (x, y) {
var x1 = x * sinPsi, y1 = halfPi - y, rho = sqrt(x1 * x1 + y1 * y1), eta = atan2(x1, y1);
return [(rho ? rho / sin(rho) : 1) * eta / sinPsi, halfPi - rho];
};
return forward;
}
var bottomley = function () {
var sinPsi = 0.5, m = d3Geo.geoProjectionMutator(bottomleyRaw), p = m(sinPsi);
p.fraction = function (_) {
return arguments.length ? m(sinPsi = +_) : sinPsi;
};
return p
.scale(158.837);
};
var bromleyRaw = mollweideBromleyRaw(1, 4 / pi, pi);
var bromley = function () {
return d3Geo.geoProjection(bromleyRaw)
.scale(152.63);
};
// Azimuthal distance.
function distance(dPhi, c1, s1, c2, s2, dLambda) {
var cosdLambda = cos(dLambda), r;
if (abs(dPhi) > 1 || abs(dLambda) > 1) {
r = acos(s1 * s2 + c1 * c2 * cosdLambda);
}
else {
var sindPhi = sin(dPhi / 2), sindLambda = sin(dLambda / 2);
r = 2 * asin(sqrt(sindPhi * sindPhi + c1 * c2 * sindLambda * sindLambda));
}
return abs(r) > epsilon ? [r, atan2(c2 * sin(dLambda), c1 * s2 - s1 * c2 * cosdLambda)] : [0, 0];
}
// Angle opposite a, and contained between sides of lengths b and c.
function angle(b, c, a) {
return acos((b * b + c * c - a * a) / (2 * b * c));
}
// Normalize longitude.
function longitude(lambda) {
return lambda - 2 * pi * floor((lambda + pi) / (2 * pi));
}
function chamberlinRaw(p0, p1, p2) {
var points = [
[p0[0], p0[1], sin(p0[1]), cos(p0[1])],
[p1[0], p1[1], sin(p1[1]), cos(p1[1])],
[p2[0], p2[1], sin(p2[1]), cos(p2[1])]
];
for (var a = points[2], b, i = 0; i < 3; ++i, a = b) {
b = points[i];
a.v = distance(b[1] - a[1], a[3], a[2], b[3], b[2], b[0] - a[0]);
a.point = [0, 0];
}
var beta0 = angle(points[0].v[0], points[2].v[0], points[1].v[0]), beta1 = angle(points[0].v[0], points[1].v[0], points[2].v[0]), beta2 = pi - beta0;
points[2].point[1] = 0;
points[0].point[0] = -(points[1].point[0] = points[0].v[0] / 2);
var mean = [
points[2].point[0] = points[0].point[0] + points[2].v[0] * cos(beta0),
2 * (points[0].point[1] = points[1].point[1] = points[2].v[0] * sin(beta0))
];
function forward(lambda, phi) {
var sinPhi = sin(phi), cosPhi = cos(phi), v = new Array(3), i;
// Compute distance and azimuth from control points.
for (i = 0; i < 3; ++i) {
var p = points[i];
v[i] = distance(phi - p[1], p[3], p[2], cosPhi, sinPhi, lambda - p[0]);
if (!v[i][0])
return p.point;
v[i][1] = longitude(v[i][1] - p.v[1]);
}
// Arithmetic mean of interception points.
var point = mean.slice();
for (i = 0; i < 3; ++i) {
var j = i == 2 ? 0 : i + 1;
var a = angle(points[i].v[0], v[i][0], v[j][0]);
if (v[i][1] < 0)
a = -a;
if (!i) {
point[0] += v[i][0] * cos(a);
point[1] -= v[i][0] * sin(a);
}
else if (i == 1) {
a = beta1 - a;
point[0] -= v[i][0] * cos(a);
point[1] -= v[i][0] * sin(a);
}
else {
a = beta2 - a;
point[0] += v[i][0] * cos(a);
point[1] += v[i][0] * sin(a);
}
}
point[0] /= 3, point[1] /= 3;
return point;
}
return forward;
}
function pointRadians(p) {
return p[0] *= radians, p[1] *= radians, p;
}
function chamberlinAfrica() {
return chamberlin([0, 22], [45, 22], [22.5, -22])
.scale(380)
.center([22.5, 2]);
}
function chamberlin(p0, p1, p2) {
var c = d3Geo.geoCentroid({ type: "MultiPoint", coordinates: [p0, p1, p2] }), R = [-c[0], -c[1]], r = d3Geo.geoRotation(R), p = d3Geo.geoProjection(chamberlinRaw(pointRadians(r(p0)), pointRadians(r(p1)), pointRadians(r(p2)))).rotate(R), center = p.center;
delete p.rotate;
p.center = function (_) {
return arguments.length ? center(r(_)) : r.invert(center());
};
return p
.clipAngle(90);
}
function collignonRaw(lambda, phi) {
var alpha = sqrt(1 - sin(phi));
return [(2 / sqrtPi) * lambda * alpha, sqrtPi * (1 - alpha)];
}
collignonRaw.invert = function (x, y) {
var lambda = (lambda = y / sqrtPi - 1) * lambda;
return [lambda > 0 ? x * sqrt(pi / lambda) / 2 : 0, asin(1 - lambda)];
};
var collignon = function () {
return d3Geo.geoProjection(collignonRaw)
.scale(95.6464)
.center([0, 30]);
};
function craigRaw(phi0) {
var tanPhi0 = tan(phi0);
function forward(lambda, phi) {
return [lambda, (lambda ? lambda / sin(lambda) : 1) * (sin(phi) * cos(lambda) - tanPhi0 * cos(phi))];
}
forward.invert = tanPhi0 ? function (x, y) {
if (x)
y *= sin(x) / x;
var cosLambda = cos(x);
return [x, 2 * atan2(sqrt(cosLambda * cosLambda + tanPhi0 * tanPhi0 - y * y) - cosLambda, tanPhi0 - y)];
} : function (x, y) {
return [x, asin(x ? y * tan(x) / x : y)];
};
return forward;
}
var craig = function () {
return parallel1(craigRaw)
.scale(249.828)
.clipAngle(90);
};
var sqrt3 = sqrt(3);
function crasterRaw(lambda, phi) {
return [sqrt3 * lambda * (2 * cos(2 * phi / 3) - 1) / sqrtPi, sqrt3 * sqrtPi * sin(phi / 3)];
}
crasterRaw.invert = function (x, y) {
var phi = 3 * asin(y / (sqrt3 * sqrtPi));
return [sqrtPi * x / (sqrt3 * (2 * cos(2 * phi / 3) - 1)), phi];
};
var craster = function () {
return d3Geo.geoProjection(crasterRaw)
.scale(156.19);
};
function cylindricalEqualAreaRaw(phi0) {
var cosPhi0 = cos(phi0);
function forward(lambda, phi) {
return [lambda * cosPhi0, sin(phi) / cosPhi0];
}
forward.invert = function (x, y) {
return [x / cosPhi0, asin(y * cosPhi0)];
};
return forward;
}
var cylindricalEqualArea = function () {
return parallel1(cylindricalEqualAreaRaw)
.parallel(38.58) // acos(sqrt(width / height / pi)) * radians
.scale(195.044); // width / (sqrt(width / height / pi) * 2 * pi)
};
function cylindricalStereographicRaw(phi0) {
var cosPhi0 = cos(phi0);
function forward(lambda, phi) {
return [lambda * cosPhi0, (1 + cosPhi0) * tan(phi / 2)];
}
forward.invert = function (x, y) {
return [x / cosPhi0, atan(y / (1 + cosPhi0)) * 2];
};
return forward;
}
var cylindricalStereographic = function () {
return parallel1(cylindricalStereographicRaw)
.scale(124.75);
};
function eckert1Raw(lambda, phi) {
var alpha = sqrt(8 / (3 * pi));
return [
alpha * lambda * (1 - abs(phi) / pi),
alpha * phi
];
}
eckert1Raw.invert = function (x, y) {
var alpha = sqrt(8 / (3 * pi)), phi = y / alpha;
return [
x / (alpha * (1 - abs(phi) / pi)),
phi
];
};
var eckert1 = function () {
return d3Geo.geoProjection(eckert1Raw)
.scale(165.664);
};
function eckert2Raw(lambda, phi) {
var alpha = sqrt(4 - 3 * sin(abs(phi)));
return [
2 / sqrt(6 * pi) * lambda * alpha,
sign(phi) * sqrt(2 * pi / 3) * (2 - alpha)
];
}
eckert2Raw.invert = function (x, y) {
var alpha = 2 - abs(y) / sqrt(2 * pi / 3);
return [
x * sqrt(6 * pi) / (2 * alpha),
sign(y) * asin((4 - alpha * alpha) / 3)
];
};
var eckert2 = function () {
return d3Geo.geoProjection(eckert2Raw)
.scale(165.664);
};
function eckert3Raw(lambda, phi) {
var k = sqrt(pi * (4 + pi));
return [
2 / k * lambda * (1 + sqrt(1 - 4 * phi * phi / (pi * pi))),
4 / k * phi
];
}
eckert3Raw.invert = function (x, y) {
var k = sqrt(pi * (4 + pi)) / 2;
return [
x * k / (1 + sqrt(1 - y * y * (4 + pi) / (4 * pi))),
y * k / 2
];
};
var eckert3 = function () {
return d3Geo.geoProjection(eckert3Raw)
.scale(180.739);
};
function eckert4Raw(lambda, phi) {
var k = (2 + halfPi) * sin(phi);
phi /= 2;
for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) {
var cosPhi = cos(phi);
phi -= delta = (phi + sin(phi) * (cosPhi + 2) - k) / (2 * cosPhi * (1 + cosPhi));
}
return [
2 / sqrt(pi * (4 + pi)) * lambda * (1 + cos(phi)),
2 * sqrt(pi / (4 + pi)) * sin(phi)
];
}
eckert4Raw.invert = function (x, y) {
var A = y * sqrt((4 + pi) / pi) / 2, k = asin(A), c = cos(k);
return [
x / (2 / sqrt(pi * (4 + pi)) * (1 + c)),
asin((k + A * (c + 2)) / (2 + halfPi))
];
};
var eckert4 = function () {
return d3Geo.geoProjection(eckert4Raw)
.scale(180.739);
};
function eckert5Raw(lambda, phi) {
return [
lambda * (1 + cos(phi)) / sqrt(2 + pi),
2 * phi / sqrt(2 + pi)
];
}
eckert5Raw.invert = function (x, y) {
var k = sqrt(2 + pi), phi = y * k / 2;
return [
k * x / (1 + cos(phi)),
phi
];
};
var eckert5 = function () {
return d3Geo.geoProjection(eckert5Raw)
.scale(173.044);
};
function eckert6Raw(lambda, phi) {
var k = (1 + halfPi) * sin(phi);
for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) {
phi -= delta = (phi + sin(phi) - k) / (1 + cos(phi));
}
k = sqrt(2 + pi);
return [
lambda * (1 + cos(phi)) / k,
2 * phi / k
];
}
eckert6Raw.invert = function (x, y) {
var j = 1 + halfPi, k = sqrt(j / 2);
return [
x * 2 * k / (1 + cos(y *= k)),
asin((y + sin(y)) / j)
];
};
var eckert6 = function () {
return d3Geo.geoProjection(eckert6Raw)
.scale(173.044);
};
var eisenlohrK = 3 + 2 * sqrt2;
function eisenlohrRaw(lambda, phi) {
var s0 = sin(lambda /= 2), c0 = cos(lambda), k = sqrt(cos(phi)), c1 = cos(phi /= 2), t = sin(phi) / (c1 + sqrt2 * c0 * k), c = sqrt(2 / (1 + t * t)), v = sqrt((sqrt2 * c1 + (c0 + s0) * k) / (sqrt2 * c1 + (c0 - s0) * k));
return [
eisenlohrK * (c * (v - 1 / v) - 2 * log(v)),
eisenlohrK * (c * t * (v + 1 / v) - 2 * atan(t))
];
}
eisenlohrRaw.invert = function (x, y) {
if (!(p = augustRaw.invert(x / 1.2, y * 1.065)))
return null;
var lambda = p[0], phi = p[1], i = 20, p;
x /= eisenlohrK, y /= eisenlohrK;
do {
var _0 = lambda / 2, _1 = phi / 2, s0 = sin(_0), c0 = cos(_0), s1 = sin(_1), c1 = cos(_1), cos1 = cos(phi), k = sqrt(cos1), t = s1 / (c1 + sqrt2 * c0 * k), t2 = t * t, c = sqrt(2 / (1 + t2)), v0 = (sqrt2 * c1 + (c0 + s0) * k), v1 = (sqrt2 * c1 + (c0 - s0) * k), v2 = v0 / v1, v = sqrt(v2), vm1v = v - 1 / v, vp1v = v + 1 / v, fx = c * vm1v - 2 * log(v) - x, fy = c * t * vp1v - 2 * atan(t) - y, deltatDeltaLambda = s1 && sqrt1_2 * k * s0 * t2 / s1, deltatDeltaPhi = (sqrt2 * c0 * c1 + k) / (2 * (c1 + sqrt2 * c0 * k) * (c1 + sqrt2 * c0 * k) * k), deltacDeltat = -0.5 * t * c * c * c, deltacDeltaLambda = deltacDeltat * deltatDeltaLambda, deltacDeltaPhi = deltacDeltat * deltatDeltaPhi, A = (A = 2 * c1 + sqrt2 * k * (c0 - s0)) * A * v, deltavDeltaLambda = (sqrt2 * c0 * c1 * k + cos1) / A, deltavDeltaPhi = -(sqrt2 * s0 * s1) / (k * A), deltaxDeltaLambda = vm1v * deltacDeltaLambda - 2 * deltavDeltaLambda / v + c * (deltavDeltaLambda + deltavDeltaLambda / v2), deltaxDeltaPhi = vm1v * deltacDeltaPhi - 2 * deltavDeltaPhi / v + c * (deltavDeltaPhi + deltavDeltaPhi / v2), deltayDeltaLambda = t * vp1v * deltacDeltaLambda - 2 * deltatDeltaLambda / (1 + t2) + c * vp1v * deltatDeltaLambda + c * t * (deltavDeltaLambda - deltavDeltaLambda / v2), deltayDeltaPhi = t * vp1v * deltacDeltaPhi - 2 * deltatDeltaPhi / (1 + t2) + c * vp1v * deltatDeltaPhi + c * t * (deltavDeltaPhi - deltavDeltaPhi / v2), denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda;
if (!denominator)
break;
var deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator, deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator;
lambda -= deltaLambda;
phi = max(-halfPi, min(halfPi, phi - deltaPhi));
} while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0);
return abs(abs(phi) - halfPi) < epsilon ? [0, phi] : i && [lambda, phi];
};
var eisenlohr = function () {
return d3Geo.geoProjection(eisenlohrRaw)
.scale(62.5271);
};
var faheyK = cos(35 * radians);
function faheyRaw(lambda, phi) {
var t = tan(phi / 2);
return [lambda * faheyK * sqrt(1 - t * t), (1 + faheyK) * t];
}
faheyRaw.invert = function (x, y) {
var t = y / (1 + faheyK);
return [x && x / (faheyK * sqrt(1 - t * t)), 2 * atan(t)];
};
var fahey = function () {
return d3Geo.geoProjection(faheyRaw)
.scale(137.152);
};
function foucautRaw(lambda, phi) {
var k = phi / 2, cosk = cos(k);
return [2 * lambda / sqrtPi * cos(phi) * cosk * cosk, sqrtPi * tan(k)];
}
foucautRaw.invert = function (x, y) {
var k = atan(y / sqrtPi), cosk = cos(k), phi = 2 * k;
return [x * sqrtPi / 2 / (cos(phi) * cosk * cosk), phi];
};
var foucaut = function () {
return d3Geo.geoProjection(foucautRaw)
.scale(135.264);
};
function gilbertForward(point) {
return [point[0] / 2, asin(tan(point[1] / 2 * radians)) * degrees];
}
function gilbertInvert(point) {
return [point[0] * 2, 2 * atan(sin(point[1] * radians)) * degrees];
}
var gilbert = function (projectionType) {
if (projectionType == null)
projectionType = d3Geo.geoOrthographic;
var projection = projectionType(), equirectangular = d3Geo.geoEquirectangular().scale(degrees).precision(0).clipAngle(null).translate([0, 0]); // antimeridian cutting
function gilbert(point) {
return projection(gilbertForward(point));
}
if (projection.invert)
gilbert.invert = function (point) {
return gilbertInvert(projection.invert(point));
};
gilbert.stream = function (stream) {
var s1 = projection.stream(stream), s0 = equirectangular.stream({
point: function (lambda, phi) { s1.point(lambda / 2, asin(tan(-phi / 2 * radians)) * degrees); },
lineStart: function () { s1.lineStart(); },
lineEnd: function () { s1.lineEnd(); },
polygonStart: function () { s1.polygonStart(); },
polygonEnd: function () { s1.polygonEnd(); }
});
s0.sphere = s1.sphere;
return s0;
};
function property(name) {
gilbert[name] = function (_) {
return arguments.length ? (projection[name](_), gilbert) : projection[name]();
};
}
gilbert.rotate = function (_) {
return arguments.length ? (equirectangular.rotate(_), gilbert) : equirectangular.rotate();
};
gilbert.center = function (_) {
return arguments.length ? (projection.center(gilbertForward(_)), gilbert) : gilbertInvert(projection.center());
};
property("clipAngle");
property("clipExtent");
property("scale");
property("translate");
property("precision");
return gilbert
.scale(249.5);
};
function gingeryRaw(rho, n) {
var k = 2 * pi / n, rho2 = rho * rho;
function forward(lambda, phi) {
var p = d3Geo.geoAzimuthalEquidistantRaw(lambda, phi), x = p[0], y = p[1], r2 = x * x + y * y;
if (r2 > rho2) {
var r = sqrt(r2), theta = atan2(y, x), theta0 = k * round(theta / k), alpha = theta - theta0, rhoCosAlpha = rho * cos(alpha), k_ = (rho * sin(alpha) - alpha * sin(rhoCosAlpha)) / (halfPi - rhoCosAlpha), s_ = gingeryLength(alpha, k_), e = (pi - rho) / gingeryIntegrate(s_, rhoCosAlpha, pi);
x = r;
var i = 50, delta;
do {
x -= delta = (rho + gingeryIntegrate(s_, rhoCosAlpha, x) * e - r) / (s_(x) * e);
} while (abs(delta) > epsilon && --i > 0);
y = alpha * sin(x);
if (x < halfPi)
y -= k_ * (x - halfPi);
var s = sin(theta0), c = cos(theta0);
p[0] = x * c - y * s;
p[1] = x * s + y * c;
}
return p;
}
forward.invert = function (x, y) {
var r2 = x * x + y * y;
if (r2 > rho2) {
var r = sqrt(r2), theta = atan2(y, x), theta0 = k * round(theta / k), dTheta = theta - theta0;
x = r * cos(dTheta);
y = r * sin(dTheta);
var x_halfPi = x - halfPi, sinx = sin(x), alpha = y / sinx, delta = x < halfPi ? Infinity : 0, i = 10;
while (true) {
var rhosinAlpha = rho * sin(alpha), rhoCosAlpha = rho * cos(alpha), sinRhoCosAlpha = sin(rhoCosAlpha), halfPi_RhoCosAlpha = halfPi - rhoCosAlpha, k_ = (rhosinAlpha - alpha * sinRhoCosAlpha) / halfPi_RhoCosAlpha, s_ = gingeryLength(alpha, k_);
if (abs(delta) < epsilon2 || !--i)
break;
alpha -= delta = (alpha * sinx - k_ * x_halfPi - y) / (sinx - x_halfPi * 2 * (halfPi_RhoCosAlpha * (rhoCosAlpha + alpha * rhosinAlpha * cos(rhoCosAlpha) - sinRhoCosAlpha) -
rhosinAlpha * (rhosinAlpha - alpha * sinRhoCosAlpha)) / (halfPi_RhoCosAlpha * halfPi_RhoCosAlpha));
}
r = rho + gingeryIntegrate(s_, rhoCosAlpha, x) * (pi - rho) / gingeryIntegrate(s_, rhoCosAlpha, pi);
theta = theta0 + alpha;
x = r * cos(theta);
y = r * sin(theta);
}
return d3Geo.geoAzimuthalEquidistantRaw.invert(x, y);
};
return forward;
}
function gingeryLength(alpha, k) {
return function (x) {
var y_ = alpha * cos(x);
if (x < halfPi)
y_ -= k;
return sqrt(1 + y_ * y_);
};
}
// Numerical integration: trapezoidal rule.
function gingeryIntegrate(f, a, b) {
var n = 50, h = (b - a) / n, s = f(a) + f(b);
for (var i = 1, x = a; i < n; ++i)
s += 2 * f(x += h);
return s * 0.5 * h;
}
var gingery = function () {
var n = 6, rho = 30 * radians, cRho = cos(rho), sRho = sin(rho), m = d3Geo.geoProjectionMutator(gingeryRaw), p = m(rho, n), stream_ = p.stream, epsilon$$1 = 1e-2, cr = -cos(epsilon$$1 * radians), sr = sin(epsilon$$1 * radians);
p.radius = function (_) {
if (!arguments.length)
return rho * degrees;
cRho = cos(rho = _ * radians);
sRho = sin(rho);
return m(rho, n);
};
p.lobes = function (_) {
if (!arguments.length)
return n;
return m(rho, n = +_);
};
p.stream = function (stream) {
var rotate = p.rotate(), rotateStream = stream_(stream), sphereStream = (p.rotate([0, 0]), stream_(stream));
p.rotate(rotate);
rotateStream.sphere = function () {
sphereStream.polygonStart(), sphereStream.lineStart();
for (var i = 0, delta = 2 * pi / n, phi = 0; i < n; ++i, phi -= delta) {
sphereStream.point(atan2(sr * cos(phi), cr) * degrees, asin(sr * sin(phi)) * degrees);
sphereStream.point(atan2(sRho * cos(phi - delta / 2), cRho) * degrees, asin(sRho * sin(phi - delta / 2)) * degrees);
}
sphereStream.lineEnd(), sphereStream.polygonEnd();
};
return rotateStream;
};
return p
.rotate([90, -40])
.scale(91.7095)
.clipAngle(180 - 1e-3);
};
var ginzburgPolyconicRaw = function (a, b, c, d, e, f, g, h) {
if (arguments.length < 8)
h = 0;
function forward(lambda, phi) {
if (!phi)
return [a * lambda / pi, 0];
var phi2 = phi * phi, xB = a + phi2 * (b + phi2 * (c + phi2 * d)), yB = phi * (e - 1 + phi2 * (f - h + phi2 * g)), m = (xB * xB + yB * yB) / (2 * yB), alpha = lambda * asin(xB / m) / pi;
return [m * sin(alpha), phi * (1 + phi2 * h) + m * (1 - cos(alpha))];
}
forward.invert = function (x, y) {
var lambda = pi * x / a, phi = y, deltaLambda, deltaPhi, i = 50;
do {
var phi2 = phi * phi, xB = a + phi2 * (b + phi2 * (c + phi2 * d)), yB = phi * (e - 1 + phi2 * (f - h + phi2 * g)), p = xB * xB + yB * yB, q = 2 * yB, m = p / q, m2 = m * m, dAlphadLambda = asin(xB / m) / pi, alpha = lambda * dAlphadLambda, xB2 = xB * xB, dxBdPhi = (2 * b + phi2 * (4 * c + phi2 * 6 * d)) * phi, dyBdPhi = e + phi2 * (3 * f + phi2 * 5 * g), dpdPhi = 2 * (xB * dxBdPhi + yB * (dyBdPhi - 1)), dqdPhi = 2 * (dyBdPhi - 1), dmdPhi = (dpdPhi * q - p * dqdPhi) / (q * q), cosAlpha = cos(alpha), sinAlpha = sin(alpha), mcosAlpha = m * cosAlpha, msinAlpha = m * sinAlpha, dAlphadPhi = ((lambda / pi) * (1 / sqrt(1 - xB2 / m2)) * (dxBdPhi * m - xB * dmdPhi)) / m2, fx = msinAlpha - x, fy = phi * (1 + phi2 * h) + m - mcosAlpha - y, deltaxDeltaPhi = dmdPhi * sinAlpha + mcosAlpha * dAlphadPhi, deltaxDeltaLambda = mcosAlpha * dAlphadLambda, deltayDeltaPhi = 1 + dmdPhi - (dmdPhi * cosAlpha - msinAlpha * dAlphadPhi), deltayDeltaLambda = msinAlpha * dAlphadLambda, denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda;
if (!denominator)
break;
lambda -= deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator;
phi -= deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator;
} while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0);
return [lambda, phi];
};
return forward;
};
var ginzburg4Raw = ginzburgPolyconicRaw(2.8284, -1.6988, 0.75432, -0.18071, 1.76003, -0.38914, 0.042555);
var ginzburg4 = function () {
return d3Geo.geoProjection(ginzburg4Raw)
.scale(149.995);
};
var ginzburg5Raw = ginzburgPolyconicRaw(2.583819, -0.835827, 0.170354, -0.038094, 1.543313, -0.411435, 0.082742);
var ginzburg5 = function () {
return d3Geo.geoProjection(ginzburg5Raw)
.scale(153.93);
};
var ginzburg6Raw = ginzburgPolyconicRaw(5 / 6 * pi, -0.62636, -0.0344, 0, 1.3493, -0.05524, 0, 0.045);
var ginzburg6 = function () {
return d3Geo.geoProjection(ginzburg6Raw)
.scale(130.945);
};
function ginzburg8Raw(lambda, phi) {
var lambda2 = lambda * lambda, phi2 = phi * phi;
return [
lambda * (1 - 0.162388 * phi2) * (0.87 - 0.000952426 * lambda2 * lambda2),
phi * (1 + phi2 / 12)
];
}
ginzburg8Raw.invert = function (x, y) {
var lambda = x, phi = y, i = 50, delta;
do {
var phi2 = phi * phi;
phi -= delta = (phi * (1 + phi2 / 12) - y) / (1 + phi2 / 4);
} while (abs(delta) > epsilon && --i > 0);
i = 50;
x /= 1 - 0.162388 * phi2;
do {
var lambda4 = (lambda4 = lambda * lambda) * lambda4;
lambda -= delta = (lambda * (0.87 - 0.000952426 * lambda4) - x) / (0.87 - 0.00476213 * lambda4);
} while (abs(delta) > epsilon && --i > 0);
return [lambda, phi];
};
var ginzburg8 = function () {
return d3Geo.geoProjection(ginzburg8Raw)
.scale(131.747);
};
var ginzburg9Raw = ginzburgPolyconicRaw(2.6516, -0.76534, 0.19123, -0.047094, 1.36289, -0.13965, 0.031762);
var ginzburg9 = function () {
return d3Geo.geoProjection(ginzburg9Raw)
.scale(131.087);
};
var squareRaw = function (project) {
var dx = project(halfPi, 0)[0] - project(-halfPi, 0)[0];
function projectSquare(lambda, phi) {
var s = lambda > 0 ? -0.5 : 0.5, point = project(lambda + s * pi, phi);
point[0] -= s * dx;
return point;
}
if (project.invert)
projectSquare.invert = function (x, y) {
var s = x > 0 ? -0.5 : 0.5, location = project.invert(x + s * dx, y), lambda = location[0] - s * pi;
if (lambda < -pi)
lambda += 2 * pi;
else if (lambda > pi)
lambda -= 2 * pi;
location[0] = lambda;
return location;
};
return projectSquare;
};
function gringortenRaw(lambda, phi) {
var sLambda = sign(lambda), sPhi = sign(phi), cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(sPhi * phi);
lambda = abs(atan2(y, z));
phi = asin(x);
if (abs(lambda - halfPi) > epsilon)
lambda %= halfPi;
var point = gringortenHexadecant(lambda > pi / 4 ? halfPi - lambda : lambda, phi);
if (lambda > pi / 4)
z = point[0], point[0] = -point[1], point[1] = -z;
return (point[0] *= sLambda, point[1] *= -sPhi, point);
}
gringortenRaw.invert = function (x, y) {
if (abs(x) > 1)
x = sign(x) * 2 - x;
if (abs(y) > 1)
y = sign(y) * 2 - y;
var sx = sign(x), sy = sign(y), x0 = -sx * x, y0 = -sy * y, t = y0 / x0 < 1, p = gringortenHexadecantInvert(t ? y0 : x0, t ? x0 : y0), lambda = p[0], phi = p[1], cosPhi = cos(phi);
if (t)
lambda = -halfPi - lambda;
return [sx * (atan2(sin(lambda) * cosPhi, -sin(phi)) + pi), sy * asin(cos(lambda) * cosPhi)];
};
function gringortenHexadecant(lambda, phi) {
if (phi === halfPi)
return [0, 0];
var sinPhi = sin(phi), r = sinPhi * sinPhi, r2 = r * r, j = 1 + r2, k = 1 + 3 * r2, q = 1 - r2, z = asin(1 / sqrt(j)), v = q + r * j * z, p2 = (1 - sinPhi) / v, p = sqrt(p2), a2 = p2 * j, a = sqrt(a2), h = p * q, x, i;
if (lambda === 0)
return [0, -(h + r * a)];
var cosPhi = cos(phi), secPhi = 1 / cosPhi, drdPhi = 2 * sinPhi * cosPhi, dvdPhi = (-3 * r + z * k) * drdPhi, dp2dPhi = (-v * cosPhi - (1 - sinPhi) * dvdPhi) / (v * v), dpdPhi = (0.5 * dp2dPhi) / p, dhdPhi = q * dpdPhi - 2 * r * p * drdPhi, dra2dPhi = r * j * dp2dPhi + p2 * k * drdPhi, mu = -secPhi * drdPhi, nu = -secPhi * dra2dPhi, zeta = -2 * secPhi * dhdPhi, lambda1 = 4 * lambda / pi, delta;
// Slower but accurate bisection method.
if (lambda > 0.222 * pi || phi < pi / 4 && lambda > 0.175 * pi) {
x = (h + r * sqrt(a2 * (1 + r2) - h * h)) / (1 + r2);
if (lambda > pi / 4)
return [x, x];
var x1 = x, x0 = 0.5 * x;
x = 0.5 * (x0 + x1), i = 50;
do {
var g = sqrt(a2 - x * x), f = (x * (zeta + mu * g) + nu * asin(x / a)) - lambda1;
if (!f)
break;
if (f < 0)
x0 = x;
else
x1 = x;
x = 0.5 * (x0 + x1);
} while (abs(x1 - x0) > epsilon && --i > 0);
}
// Newton-Raphson.
else {
x = epsilon, i = 25;
do {
var x2 = x * x, g2 = sqrt(a2 - x2), zetaMug = zeta + mu * g2, f2 = x * zetaMug + nu * asin(x / a) - lambda1, df = zetaMug + (nu - mu * x2) / g2;
x -= delta = g2 ? f2 / df : 0;
} while (abs(delta) > epsilon && --i > 0);
}
return [x, -h - r * sqrt(a2 - x * x)];
}
function gringortenHexadecantInvert(x, y) {
var x0 = 0, x1 = 1, r = 0.5, i = 50;
while (true) {
var r2 = r * r, sinPhi = sqrt(r), z = asin(1 / sqrt(1 + r2)), v = (1 - r2) + r * (1 + r2) * z, p2 = (1 - sinPhi) / v, p = sqrt(p2), a2 = p2 * (1 + r2), h = p * (1 - r2), g2 = a2 - x * x, g = sqrt(g2), y0 = y + h + r * g;
if (abs(x1 - x0) < epsilon2 || --i === 0 || y0 === 0)
break;
if (y0 > 0)
x0 = r;
else
x1 = r;
r = 0.5 * (x0 + x1);
}
if (!i)
return null;
var phi = asin(sinPhi), cosPhi = cos(phi), secPhi = 1 / cosPhi, drdPhi = 2 * sinPhi * cosPhi, dvdPhi = (-3 * r + z * (1 + 3 * r2)) * drdPhi, dp2dPhi = (-v * cosPhi - (1 - sinPhi) * dvdPhi) / (v * v), dpdPhi = 0.5 * dp2dPhi / p, dhdPhi = (1 - r2) * dpdPhi - 2 * r * p * drdPhi, zeta = -2 * secPhi * dhdPhi, mu = -secPhi * drdPhi, nu = -secPhi * (r * (1 + r2) * dp2dPhi + p2 * (1 + 3 * r2) * drdPhi);
return [pi / 4 * (x * (zeta + mu * g) + nu * asin(x / sqrt(a2))), phi];
}
var gringorten = function () {
return d3Geo.geoProjection(squareRaw(gringortenRaw))
.scale(239.75);
};
// Returns [sn, cn, dn](u + iv|m).
function ellipticJi(u, v, m) {
var a, b, c;
if (!u) {
b = ellipticJ(v, 1 - m);
return [
[0, b[0] / b[1]],
[1 / b[1], 0],
[b[2] / b[1], 0]
];
}
a = ellipticJ(u, m);
if (!v)
return [[a[0], 0], [a[1], 0], [a[2], 0]];
b = ellipticJ(v, 1 - m);
c = b[1] * b[1] + m * a[0] * a[0] * b[0] * b[0];
return [
[a[0] * b[2] / c, a[1] * a[2] * b[0] * b[1] / c],
[a[1] * b[1] / c, -a[0] * a[2] * b[0] * b[2] / c],
[a[2] * b[1] * b[2] / c, -m * a[0] * a[1] * b[0] / c]
];
}
// Returns [sn, cn, dn, ph](u|m).
function ellipticJ(u, m) {
var ai, b, phi, t, twon;
if (m < epsilon) {
t = sin(u);
b = cos(u);
ai = m * (u - t * b) / 4;
return [
t - ai * b,
b + ai * t,
1 - m * t * t / 2,
u - ai
];
}
if (m >= 1 - epsilon) {
ai = (1 - m) / 4;
b = cosh(u);
t = tanh(u);
phi = 1 / b;
twon = b * sinh(u);
return [
t + ai * (twon - u) / (b * b),
phi - ai * t * phi * (twon - u),
phi + ai * t * phi * (twon + u),
2 * atan(exp(u)) - halfPi + ai * (twon - u) / b
];
}
var a = [1, 0, 0, 0, 0, 0, 0, 0, 0], c = [sqrt(m), 0, 0, 0, 0, 0, 0, 0, 0], i = 0;
b = sqrt(1 - m);
twon = 1;
while (abs(c[i] / a[i]) > epsilon && i < 8) {
ai = a[i++];
c[i] = (ai - b) / 2;
a[i] = (ai + b) / 2;
b = sqrt(ai * b);
twon *= 2;
}
phi = twon * a[i] * u;
do {
t = c[i] * sin(b = phi) / a[i];
phi = (asin(t) + phi) / 2;
} while (--i);
return [sin(phi), t = cos(phi), t / cos(phi - b), phi];
}
// Calculate F(phi+iPsi|m).
// See Abramowitz and Stegun, 17.4.11.
function ellipticFi(phi, psi, m) {
var r = abs(phi), i = abs(psi), sinhPsi = sinh(i);
if (r) {
var cscPhi = 1 / sin(r), cotPhi2 = 1 / (tan(r) * tan(r)), b = -(cotPhi2 + m * (sinhPsi * sinhPsi * cscPhi * cscPhi) - 1 + m), c = (m - 1) * cotPhi2, cotLambda2 = (-b + sqrt(b * b - 4 * c)) / 2;
return [
ellipticF(atan(1 / sqrt(cotLambda2)), m) * sign(phi),
ellipticF(atan(sqrt((cotLambda2 / cotPhi2 - 1) / m)), 1 - m) * sign(psi)
];
}
return [
0,
ellipticF(atan(sinhPsi), 1 - m) * sign(psi)
];
}
// Calculate F(phi|m) where m = k² = sin²α.
// See Abramowitz and Stegun, 17.6.7.
function ellipticF(phi, m) {
if (!m)
return phi;
if (m === 1)
return log(tan(phi / 2 + quarterPi));
var a = 1, b = sqrt(1 - m), c = sqrt(m);
for (var i = 0; abs(c) > epsilon; i++) {
if (phi % pi) {
var dPhi = atan(b * tan(phi) / a);
if (dPhi < 0)
dPhi += pi;
phi += dPhi + ~~(phi / pi) * pi;
}
else
phi += phi;
c = (a + b) / 2;
b = sqrt(a * b);
c = ((a = c) - b) / 2;
}
return phi / (pow(2, i) * a);
}
function guyouRaw(lambda, phi) {
var k_ = (sqrt2 - 1) / (sqrt2 + 1), k = sqrt(1 - k_ * k_), K = ellipticF(halfPi, k * k), f = -1, psi = log(tan(pi / 4 + abs(phi) / 2)), r = exp(f * psi) / sqrt(k_), at = guyouComplexAtan(r * cos(f * lambda), r * sin(f * lambda)), t = ellipticFi(at[0], at[1], k * k);
return [-t[1], (phi >= 0 ? 1 : -1) * (0.5 * K - t[0])];
}
function guyouComplexAtan(x, y) {
var x2 = x * x, y_1 = y + 1, t = 1 - x2 - y * y;
return [
0.5 * ((x >= 0 ? halfPi : -halfPi) - atan2(t, 2 * x)),
-0.25 * log(t * t + 4 * x2) + 0.5 * log(y_1 * y_1 + x2)
];
}
function guyouComplexDivide(a, b) {
var denominator = b[0] * b[0] + b[1] * b[1];
return [
(a[0] * b[0] + a[1] * b[1]) / denominator,
(a[1] * b[0] - a[0] * b[1]) / denominator
];
}
guyouRaw.invert = function (x, y) {
var k_ = (sqrt2 - 1) / (sqrt2 + 1), k = sqrt(1 - k_ * k_), K = ellipticF(halfPi, k * k), f = -1, j = ellipticJi(0.5 * K - y, -x, k * k), tn = guyouComplexDivide(j[0], j[1]), lambda = atan2(tn[1], tn[0]) / f;
return [
lambda,
2 * atan(exp(0.5 / f * log(k_ * tn[0] * tn[0] + k_ * tn[1] * tn[1]))) - halfPi
];
};
var guyou = function () {
return d3Geo.geoProjection(squareRaw(guyouRaw))
.scale(151.496);
};
function hammerRaw(A, B) {
if (arguments.length < 2)
B = A;
if (B === 1)
return d3Geo.geoAzimuthalEqualAreaRaw;
if (B === Infinity)
return hammerQuarticAuthalicRaw;
function forward(lambda, phi) {
var coordinates = d3Geo.geoAzimuthalEqualAreaRaw(lambda / B, phi);
coordinates[0] *= A;
return coordinates;
}
forward.invert = function (x, y) {
var coordinates = d3Geo.geoAzimuthalEqualAreaRaw.invert(x / A, y);
coordinates[0] *= B;
return coordinates;
};
return forward;
}
function hammerQuarticAuthalicRaw(lambda, phi) {
return [
lambda * cos(phi) / cos(phi /= 2),
2 * sin(phi)
];
}
hammerQuarticAuthalicRaw.invert = function (x, y) {
var phi = 2 * asin(y / 2);
return [
x * cos(phi / 2) / cos(phi),
phi
];
};
var hammer = function () {
var B = 2, m = d3Geo.geoProjectionMutator(hammerRaw), p = m(B);
p.coefficient = function (_) {
if (!arguments.length)
return B;
return m(B = +_);
};
return p
.scale(169.529);
};
function hammerRetroazimuthalRaw(phi0) {
var sinPhi0 = sin(phi0), cosPhi0 = cos(phi0), rotate = hammerRetroazimuthalRotation(phi0);
rotate.invert = hammerRetroazimuthalRotation(-phi0);
function forward(lambda, phi) {
var p = rotate(lambda, phi);
lambda = p[0], phi = p[1];
var sinPhi = sin(phi), cosPhi = cos(phi), cosLambda = cos(lambda), z = acos(sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosLambda), sinz = sin(z), K = abs(sinz) > epsilon ? z / sinz : 1;
return [
K * cosPhi0 * sin(lambda),
(abs(lambda) > halfPi ? K : -K) // rotate for back hemisphere
* (sinPhi0 * cosPhi - cosPhi0 * sinPhi * cosLambda)
];
}
forward.invert = function (x, y) {
var rho = sqrt(x * x + y * y), sinz = -sin(rho), cosz = cos(rho), a = rho * cosz, b = -y * sinz, c = rho * sinPhi0, d = sqrt(a * a + b * b - c * c), phi = atan2(a * c + b * d, b * c - a * d), lambda = (rho > halfPi ? -1 : 1) * atan2(x * sinz, rho * cos(phi) * cosz + y * sin(phi) * sinz);
return rotate.invert(lambda, phi);
};
return forward;
}
// Latitudinal rotation by phi0.
// Temporary hack until D3 supports arbitrary small-circle clipping origins.
function hammerRetroazimuthalRotation(phi0) {
var sinPhi0 = sin(phi0), cosPhi0 = cos(phi0);
return function (lambda, phi) {
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi);
return [
atan2(y, x * cosPhi0 - z * sinPhi0),
asin(z * cosPhi0 + x * sinPhi0)
];
};
}
var hammerRetroazimuthal = function () {
var phi0 = 0, m = d3Geo.geoProjectionMutator(hammerRetroazimuthalRaw), p = m(phi0), rotate_ = p.rotate, stream_ = p.stream, circle = d3Geo.geoCircle();
p.parallel = function (_) {
if (!arguments.length)
return phi0 * degrees;
var r = p.rotate();
return m(phi0 = _ * radians).rotate(r);
};
// Temporary hack; see hammerRetroazimuthalRotation.
p.rotate = function (_) {
if (!arguments.length)
return (_ = rotate_.call(p), _[1] += phi0 * degrees, _);
rotate_.call(p, [_[0], _[1] - phi0 * degrees]);
circle.center([-_[0], -_[1]]);
return p;
};
p.stream = function (stream) {
stream = stream_(stream);
stream.sphere = function () {
stream.polygonStart();
var epsilon$$1 = 1e-2, ring = circle.radius(90 - epsilon$$1)().coordinates[0], n = ring.length - 1, i = -1, p;
stream.lineStart();
while (++i < n)
stream.point((p = ring[i])[0], p[1]);
stream.lineEnd();
ring = circle.radius(90 + epsilon$$1)().coordinates[0];
n = ring.length - 1;
stream.lineStart();
while (--i >= 0)
stream.point((p = ring[i])[0], p[1]);
stream.lineEnd();
stream.polygonEnd();
};
return stream;
};
return p
.scale(79.4187)
.parallel(45)
.clipAngle(180 - 1e-3);
};
var healpixParallel = 41 + 48 / 36 + 37 / 3600;
var healpixLambert = cylindricalEqualAreaRaw(0);
function healpixRaw(H) {
var phi0 = healpixParallel * radians, dx = collignonRaw(pi, phi0)[0] - collignonRaw(-pi, phi0)[0], y0 = healpixLambert(0, phi0)[1], y1 = collignonRaw(0, phi0)[1], dy1 = sqrtPi - y1, k = tau / H, w = 4 / tau, h = y0 + (dy1 * dy1 * 4) / tau;
function forward(lambda, phi) {
var point, phi2 = abs(phi);
if (phi2 > phi0) {
var i = min(H - 1, max(0, floor((lambda + pi) / k)));
lambda += pi * (H - 1) / H - i * k;
point = collignonRaw(lambda, phi2);
point[0] = point[0] * tau / dx - tau * (H - 1) / (2 * H) + i * tau / H;
point[1] = y0 + (point[1] - y1) * 4 * dy1 / tau;
if (phi < 0)
point[1] = -point[1];
}
else {
point = healpixLambert(lambda, phi);
}
point[0] *= w, point[1] /= h;
return point;
}
forward.invert = function (x, y) {
x /= w, y *= h;
var y2 = abs(y);
if (y2 > y0) {
var i = min(H - 1, max(0, floor((x + pi) / k)));
x = (x + pi * (H - 1) / H - i * k) * dx / tau;
var point = collignonRaw.invert(x, 0.25 * (y2 - y0) * tau / dy1 + y1);
point[0] -= pi * (H - 1) / H - i * k;
if (y < 0)
point[1] = -point[1];
return point;
}
return healpixLambert.invert(x, y);
};
return forward;
}
function sphere(step) {
return {
type: "Polygon",
coordinates: [
d3Array.range(-180, 180 + step / 2, step).map(function (x, i) { return [x, i & 1 ? 90 - 1e-6 : healpixParallel]; })
.concat(d3Array.range(180, -180 - step / 2, -step).map(function (x, i) { return [x, i & 1 ? -90 + 1e-6 : -healpixParallel]; }))
]
};
}
var healpix = function () {
var H = 4, m = d3Geo.geoProjectionMutator(healpixRaw), p = m(H), stream_ = p.stream;
p.lobes = function (_) {
return arguments.length ? m(H = +_) : H;
};
p.stream = function (stream) {
var rotate = p.rotate(), rotateStream = stream_(stream), sphereStream = (p.rotate([0, 0]), stream_(stream));
p.rotate(rotate);
rotateStream.sphere = function () { d3Geo.geoStream(sphere(180 / H), sphereStream); };
return rotateStream;
};
return p
.scale(239.75);
};
function hillRaw(K) {
var L = 1 + K, sinBt = sin(1 / L), Bt = asin(sinBt), A = 2 * sqrt(pi / (B = pi + 4 * Bt * L)), B, rho0 = 0.5 * A * (L + sqrt(K * (2 + K))), K2 = K * K, L2 = L * L;
function forward(lambda, phi) {
var t = 1 - sin(phi), rho, omega;
if (t && t < 2) {
var theta = halfPi - phi, i = 25, delta;
do {
var sinTheta = sin(theta), cosTheta = cos(theta), Bt_Bt1 = Bt + atan2(sinTheta, L - cosTheta), C = 1 + L2 - 2 * L * cosTheta;
theta -= delta = (theta - K2 * Bt - L * sinTheta + C * Bt_Bt1 - 0.5 * t * B) / (2 * L * sinTheta * Bt_Bt1);
} while (abs(delta) > epsilon2 && --i > 0);
rho = A * sqrt(C);
omega = lambda * Bt_Bt1 / pi;
}
else {
rho = A * (K + t);
omega = lambda * Bt / pi;
}
return [
rho * sin(omega),
rho0 - rho * cos(omega)
];
}
forward.invert = function (x, y) {
var rho2 = x * x + (y -= rho0) * y, cosTheta = (1 + L2 - rho2 / (A * A)) / (2 * L), theta = acos(cosTheta), sinTheta = sin(theta), Bt_Bt1 = Bt + atan2(sinTheta, L - cosTheta);
return [
asin(x / sqrt(rho2)) * pi / Bt_Bt1,
asin(1 - 2 * (theta - K2 * Bt - L * sinTheta + (1 + L2 - 2 * L * cosTheta) * Bt_Bt1) / B)
];
};
return forward;
}
var hill = function () {
var K = 1, m = d3Geo.geoProjectionMutator(hillRaw), p = m(K);
p.ratio = function (_) {
return arguments.length ? m(K = +_) : K;
};
return p
.scale(167.774)
.center([0, 18.67]);
};
var sinuMollweidePhi = 0.7109889596207567;
var sinuMollweideY = 0.0528035274542;
function sinuMollweideRaw(lambda, phi) {
return phi > -sinuMollweidePhi
? (lambda = mollweideRaw(lambda, phi), lambda[1] += sinuMollweideY, lambda)
: sinusoidalRaw(lambda, phi);
}
sinuMollweideRaw.invert = function (x, y) {
return y > -sinuMollweidePhi
? mollweideRaw.invert(x, y - sinuMollweideY)
: sinusoidalRaw.invert(x, y);
};
var sinuMollweide = function () {
return d3Geo.geoProjection(sinuMollweideRaw)
.rotate([-20, -55])
.scale(164.263)
.center([0, -5.4036]);
};
function homolosineRaw(lambda, phi) {
return abs(phi) > sinuMollweidePhi
? (lambda = mollweideRaw(lambda, phi), lambda[1] -= phi > 0 ? sinuMollweideY : -sinuMollweideY, lambda)
: sinusoidalRaw(lambda, phi);
}
homolosineRaw.invert = function (x, y) {
return abs(y) > sinuMollweidePhi
? mollweideRaw.invert(x, y + (y > 0 ? sinuMollweideY : -sinuMollweideY))
: sinusoidalRaw.invert(x, y);
};
var homolosine = function () {
return d3Geo.geoProjection(homolosineRaw)
.scale(152.63);
};
function pointEqual(a, b) {
return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;
}
function interpolateLine(coordinates, m) {
var i = -1, n = coordinates.length, p0 = coordinates[0], p1, dx, dy, resampled = [];
while (++i < n) {
p1 = coordinates[i];
dx = (p1[0] - p0[0]) / m;
dy = (p1[1] - p0[1]) / m;
for (var j = 0; j < m; ++j)
resampled.push([p0[0] + j * dx, p0[1] + j * dy]);
p0 = p1;
}
resampled.push(p1);
return resampled;
}
function interpolateSphere(lobes) {
var coordinates = [], lobe, lambda0, phi0, phi1, lambda2, phi2, i, n = lobes[0].length;
// Northern Hemisphere
for (i = 0; i < n; ++i) {
lobe = lobes[0][i];
lambda0 = lobe[0][0], phi0 = lobe[0][1], phi1 = lobe[1][1];
lambda2 = lobe[2][0], phi2 = lobe[2][1];
coordinates.push(interpolateLine([
[lambda0 + epsilon, phi0 + epsilon],
[lambda0 + epsilon, phi1 - epsilon],
[lambda2 - epsilon, phi1 - epsilon],
[lambda2 - epsilon, phi2 + epsilon]
], 30));
}
// Southern Hemisphere
for (i = lobes[1].length - 1; i >= 0; --i) {
lobe = lobes[1][i];
lambda0 = lobe[0][0], phi0 = lobe[0][1], phi1 = lobe[1][1];
lambda2 = lobe[2][0], phi2 = lobe[2][1];
coordinates.push(interpolateLine([
[lambda2 - epsilon, phi2 - epsilon],
[lambda2 - epsilon, phi1 + epsilon],
[lambda0 + epsilon, phi1 + epsilon],
[lambda0 + epsilon, phi0 - epsilon]
], 30));
}
return {
type: "Polygon",
coordinates: [d3Array.merge(coordinates)]
};
}
var interrupt = function (project, lobes) {
var sphere = interpolateSphere(lobes);
lobes = lobes.map(function (lobe) {
return lobe.map(function (l) {
return [
[l[0][0] * radians, l[0][1] * radians],
[l[1][0] * radians, l[1][1] * radians],
[l[2][0] * radians, l[2][1] * radians]
];
});
});
var bounds = lobes.map(function (lobe) {
return lobe.map(function (l) {
var x0 = project(l[0][0], l[0][1])[0], x1 = project(l[2][0], l[2][1])[0], y0 = project(l[1][0], l[0][1])[1], y1 = project(l[1][0], l[1][1])[1], t;
if (y0 > y1)
t = y0, y0 = y1, y1 = t;
return [[x0, y0], [x1, y1]];
});
});
function forward(lambda, phi) {
var sign$$1 = phi < 0 ? -1 : +1, lobe = lobes[+(phi < 0)];
for (var i = 0, n = lobe.length - 1; i < n && lambda > lobe[i][2][0]; ++i)
;
var p = project(lambda - lobe[i][1][0], phi);
p[0] += project(lobe[i][1][0], sign$$1 * phi > sign$$1 * lobe[i][0][1] ? lobe[i][0][1] : phi)[0];
return p;
}
// Assumes mutually exclusive bounding boxes for lobes.
if (project.invert)
forward.invert = function (x, y) {
var bound = bounds[+(y < 0)], lobe = lobes[+(y < 0)];
for (var i = 0, n = bound.length; i < n; ++i) {
var b = bound[i];
if (b[0][0] <= x && x < b[1][0] && b[0][1] <= y && y < b[1][1]) {
var p = project.invert(x - project(lobe[i][1][0], 0)[0], y);
p[0] += lobe[i][1][0];
return pointEqual(forward(p[0], p[1]), [x, y]) ? p : null;
}
}
};
var p = d3Geo.geoProjection(forward), stream_ = p.stream;
p.stream = function (stream) {
var rotate = p.rotate(), rotateStream = stream_(stream), sphereStream = (p.rotate([0, 0]), stream_(stream));
p.rotate(rotate);
rotateStream.sphere = function () { d3Geo.geoStream(sphere, sphereStream); };
return rotateStream;
};
return p;
};
var lobes = [[
[[-180, 0], [-100, 90], [-40, 0]],
[[-40, 0], [30, 90], [180, 0]]
], [
[[-180, 0], [-160, -90], [-100, 0]],
[[-100, 0], [-60, -90], [-20, 0]],
[[-20, 0], [20, -90], [80, 0]],
[[80, 0], [140, -90], [180, 0]]
]];
var boggs$1 = function () {
return interrupt(boggsRaw, lobes)
.scale(160.857);
};
var lobes$1 = [[
[[-180, 0], [-100, 90], [-40, 0]],
[[-40, 0], [30, 90], [180, 0]]
], [
[[-180, 0], [-160, -90], [-100, 0]],
[[-100, 0], [-60, -90], [-20, 0]],
[[-20, 0], [20, -90], [80, 0]],
[[80, 0], [140, -90], [180, 0]]
]];
var homolosine$1 = function () {
return interrupt(homolosineRaw, lobes$1)
.scale(152.63);
};
var lobes$2 = [[
[[-180, 0], [-100, 90], [-40, 0]],
[[-40, 0], [30, 90], [180, 0]]
], [
[[-180, 0], [-160, -90], [-100, 0]],
[[-100, 0], [-60, -90], [-20, 0]],
[[-20, 0], [20, -90], [80, 0]],
[[80, 0], [140, -90], [180, 0]]
]];
var mollweide$1 = function () {
return interrupt(mollweideRaw, lobes$2)
.scale(169.529);
};
var lobes$3 = [[
[[-180, 0], [-90, 90], [0, 0]],
[[0, 0], [90, 90], [180, 0]]
], [
[[-180, 0], [-90, -90], [0, 0]],
[[0, 0], [90, -90], [180, 0]]
]];
var mollweideHemispheres = function () {
return interrupt(mollweideRaw, lobes$3)
.scale(169.529)
.rotate([20, 0]);
};
var lobes$4 = [[
[[-180, 35], [-30, 90], [0, 35]],
[[0, 35], [30, 90], [180, 35]]
], [
[[-180, -10], [-102, -90], [-65, -10]],
[[-65, -10], [5, -90], [77, -10]],
[[77, -10], [103, -90], [180, -10]]
]];
var sinuMollweide$1 = function () {
return interrupt(sinuMollweideRaw, lobes$4)
.rotate([-20, -55])
.scale(164.263)
.center([0, -5.4036]);
};
var lobes$5 = [[
[[-180, 0], [-110, 90], [-40, 0]],
[[-40, 0], [0, 90], [40, 0]],
[[40, 0], [110, 90], [180, 0]]
], [
[[-180, 0], [-110, -90], [-40, 0]],
[[-40, 0], [0, -90], [40, 0]],
[[40, 0], [110, -90], [180, 0]]
]];
var sinusoidal$1 = function () {
return interrupt(sinusoidalRaw, lobes$5)
.scale(152.63)
.rotate([-20, 0]);
};
function kavrayskiy7Raw(lambda, phi) {
return [3 / tau * lambda * sqrt(pi * pi / 3 - phi * phi), phi];
}
kavrayskiy7Raw.invert = function (x, y) {
return [tau / 3 * x / sqrt(pi * pi / 3 - y * y), y];
};
var kavrayskiy7 = function () {
return d3Geo.geoProjection(kavrayskiy7Raw)
.scale(158.837);
};
function lagrangeRaw(n) {
function forward(lambda, phi) {
if (abs(abs(phi) - halfPi) < epsilon)
return [0, phi < 0 ? -2 : 2];
var sinPhi = sin(phi), v = pow((1 + sinPhi) / (1 - sinPhi), n / 2), c = 0.5 * (v + 1 / v) + cos(lambda *= n);
return [
2 * sin(lambda) / c,
(v - 1 / v) / c
];
}
forward.invert = function (x, y) {
var y0 = abs(y);
if (abs(y0 - 2) < epsilon)
return x ? null : [0, sign(y) * halfPi];
if (y0 > 2)
return null;
x /= 2, y /= 2;
var x2 = x * x, y2 = y * y, t = 2 * y / (1 + x2 + y2); // tanh(nPhi)
t = pow((1 + t) / (1 - t), 1 / n);
return [
atan2(2 * x, 1 - x2 - y2) / n,
asin((t - 1) / (t + 1))
];
};
return forward;
}
var lagrange = function () {
var n = 0.5, m = d3Geo.geoProjectionMutator(lagrangeRaw), p = m(n);
p.spacing = function (_) {
return arguments.length ? m(n = +_) : n;
};
return p
.scale(124.75);
};
var pi_sqrt2 = pi / sqrt2;
function larriveeRaw(lambda, phi) {
return [
lambda * (1 + sqrt(cos(phi))) / 2,
phi / (cos(phi / 2) * cos(lambda / 6))
];
}
larriveeRaw.invert = function (x, y) {
var x0 = abs(x), y0 = abs(y), lambda = epsilon, phi = halfPi;
if (y0 < pi_sqrt2)
phi *= y0 / pi_sqrt2;
else
lambda += 6 * acos(pi_sqrt2 / y0);
for (var i = 0; i < 25; i++) {
var sinPhi = sin(phi), sqrtcosPhi = sqrt(cos(phi)), sinPhi_2 = sin(phi / 2), cosPhi_2 = cos(phi / 2), sinLambda_6 = sin(lambda / 6), cosLambda_6 = cos(lambda / 6), f0 = 0.5 * lambda * (1 + sqrtcosPhi) - x0, f1 = phi / (cosPhi_2 * cosLambda_6) - y0, df0dPhi = sqrtcosPhi ? -0.25 * lambda * sinPhi / sqrtcosPhi : 0, df0dLambda = 0.5 * (1 + sqrtcosPhi), df1dPhi = (1 + 0.5 * phi * sinPhi_2 / cosPhi_2) / (cosPhi_2 * cosLambda_6), df1dLambda = (phi / cosPhi_2) * (sinLambda_6 / 6) / (cosLambda_6 * cosLambda_6), denom = df0dPhi * df1dLambda - df1dPhi * df0dLambda, dPhi = (f0 * df1dLambda - f1 * df0dLambda) / denom, dLambda = (f1 * df0dPhi - f0 * df1dPhi) / denom;
phi -= dPhi;
lambda -= dLambda;
if (abs(dPhi) < epsilon && abs(dLambda) < epsilon)
break;
}
return [x < 0 ? -lambda : lambda, y < 0 ? -phi : phi];
};
var larrivee = function () {
return d3Geo.geoProjection(larriveeRaw)
.scale(97.2672);
};
function laskowskiRaw(lambda, phi) {
var lambda2 = lambda * lambda, phi2 = phi * phi;
return [
lambda * (0.975534 + phi2 * (-0.119161 + lambda2 * -0.0143059 + phi2 * -0.0547009)),
phi * (1.00384 + lambda2 * (0.0802894 + phi2 * -0.02855 + lambda2 * 0.000199025) + phi2 * (0.0998909 + phi2 * -0.0491032))
];
}
laskowskiRaw.invert = function (x, y) {
var lambda = sign(x) * pi, phi = y / 2, i = 50;
do {
var lambda2 = lambda * lambda, phi2 = phi * phi, lambdaPhi = lambda * phi, fx = lambda * (0.975534 + phi2 * (-0.119161 + lambda2 * -0.0143059 + phi2 * -0.0547009)) - x, fy = phi * (1.00384 + lambda2 * (0.0802894 + phi2 * -0.02855 + lambda2 * 0.000199025) + phi2 * (0.0998909 + phi2 * -0.0491032)) - y, deltaxDeltaLambda = 0.975534 - phi2 * (0.119161 + 3 * lambda2 * 0.0143059 + phi2 * 0.0547009), deltaxDeltaPhi = -lambdaPhi * (2 * 0.119161 + 4 * 0.0547009 * phi2 + 2 * 0.0143059 * lambda2), deltayDeltaLambda = lambdaPhi * (2 * 0.0802894 + 4 * 0.000199025 * lambda2 + 2 * -0.02855 * phi2), deltayDeltaPhi = 1.00384 + lambda2 * (0.0802894 + 0.000199025 * lambda2) + phi2 * (3 * (0.0998909 - 0.02855 * lambda2) - 5 * 0.0491032 * phi2), denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda, deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator, deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator;
lambda -= deltaLambda, phi -= deltaPhi;
} while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0);
return i && [lambda, phi];
};
var laskowski = function () {
return d3Geo.geoProjection(laskowskiRaw)
.scale(139.98);
};
function littrowRaw(lambda, phi) {
return [
sin(lambda) / cos(phi),
tan(phi) * cos(lambda)
];
}
littrowRaw.invert = function (x, y) {
var x2 = x * x, y2 = y * y, y2_1 = y2 + 1, cosPhi = x
? sqrt1_2 * sqrt((y2_1 - sqrt(x2 * x2 + 2 * x2 * (y2 - 1) + y2_1 * y2_1)) / x2 + 1)
: 1 / sqrt(y2_1);
return [
asin(x * cosPhi),
sign(y) * acos(cosPhi)
];
};
var littrow = function () {
return d3Geo.geoProjection(littrowRaw)
.scale(144.049)
.clipAngle(90 - 1e-3);
};
function loximuthalRaw(phi0) {
var cosPhi0 = cos(phi0), tanPhi0 = tan(quarterPi + phi0 / 2);
function forward(lambda, phi) {
var y = phi - phi0, x = abs(y) < epsilon ? lambda * cosPhi0
: abs(x = quarterPi + phi / 2) < epsilon || abs(abs(x) - halfPi) < epsilon
? 0 : lambda * y / log(tan(x) / tanPhi0);
return [x, y];
}
forward.invert = function (x, y) {
var lambda, phi = y + phi0;
return [
abs(y) < epsilon ? x / cosPhi0
: (abs(lambda = quarterPi + phi / 2) < epsilon || abs(abs(lambda) - halfPi) < epsilon) ? 0
: x * log(tan(lambda) / tanPhi0) / y,
phi
];
};
return forward;
}
var loximuthal = function () {
return parallel1(loximuthalRaw)
.parallel(40)
.scale(158.837);
};
function millerRaw(lambda, phi) {
return [lambda, 1.25 * log(tan(quarterPi + 0.4 * phi))];
}
millerRaw.invert = function (x, y) {
return [x, 2.5 * atan(exp(0.8 * y)) - 0.625 * pi];
};
var miller = function () {
return d3Geo.geoProjection(millerRaw)
.scale(108.318);
};
function modifiedStereographicRaw(C) {
var m = C.length - 1;
function forward(lambda, phi) {
var cosPhi = cos(phi), k = 2 / (1 + cosPhi * cos(lambda)), zr = k * cosPhi * sin(lambda), zi = k * sin(phi), i = m, w = C[i], ar = w[0], ai = w[1], t;
while (--i >= 0) {
w = C[i];
ar = w[0] + zr * (t = ar) - zi * ai;
ai = w[1] + zr * ai + zi * t;
}
ar = zr * (t = ar) - zi * ai;
ai = zr * ai + zi * t;
return [ar, ai];
}
forward.invert = function (x, y) {
var i = 20, zr = x, zi = y;
do {
var j = m, w = C[j], ar = w[0], ai = w[1], br = 0, bi = 0, t;
while (--j >= 0) {
w = C[j];
br = ar + zr * (t = br) - zi * bi;
bi = ai + zr * bi + zi * t;
ar = w[0] + zr * (t = ar) - zi * ai;
ai = w[1] + zr * ai + zi * t;
}
br = ar + zr * (t = br) - zi * bi;
bi = ai + zr * bi + zi * t;
ar = zr * (t = ar) - zi * ai - x;
ai = zr * ai + zi * t - y;
var denominator = br * br + bi * bi, deltar, deltai;
zr -= deltar = (ar * br + ai * bi) / denominator;
zi -= deltai = (ai * br - ar * bi) / denominator;
} while (abs(deltar) + abs(deltai) > epsilon * epsilon && --i > 0);
if (i) {
var rho = sqrt(zr * zr + zi * zi), c = 2 * atan(rho * 0.5), sinc = sin(c);
return [atan2(zr * sinc, rho * cos(c)), rho ? asin(zi * sinc / rho) : 0];
}
};
return forward;
}
var alaska = [[0.9972523, 0], [0.0052513, -0.0041175], [0.0074606, 0.0048125], [-0.0153783, -0.1968253], [0.0636871, -0.1408027], [0.3660976, -0.2937382]];
var gs48 = [[0.98879, 0], [0, 0], [-0.050909, 0], [0, 0], [0.075528, 0]];
var gs50 = [[0.9842990, 0], [0.0211642, 0.0037608], [-0.1036018, -0.0575102], [-0.0329095, -0.0320119], [0.0499471, 0.1223335], [0.0260460, 0.0899805], [0.0007388, -0.1435792], [0.0075848, -0.1334108], [-0.0216473, 0.0776645], [-0.0225161, 0.0853673]];
var miller$1 = [[0.9245, 0], [0, 0], [0.01943, 0]];
var lee = [[0.721316, 0], [0, 0], [-0.00881625, -0.00617325]];
function modifiedStereographicAlaska() {
return modifiedStereographic(alaska, [152, -64])
.scale(1500)
.center([-160.908, 62.4864])
.clipAngle(25);
}
function modifiedStereographicGs48() {
return modifiedStereographic(gs48, [95, -38])
.scale(1000)
.clipAngle(55)
.center([-96.5563, 38.8675]);
}
function modifiedStereographicGs50() {
return modifiedStereographic(gs50, [120, -45])
.scale(359.513)
.clipAngle(55)
.center([-117.474, 53.0628]);
}
function modifiedStereographicMiller() {
return modifiedStereographic(miller$1, [-20, -18])
.scale(209.091)
.center([20, 16.7214])
.clipAngle(82);
}
function modifiedStereographicLee() {
return modifiedStereographic(lee, [165, 10])
.scale(250)
.clipAngle(130)
.center([-165, -10]);
}
function modifiedStereographic(coefficients, rotate) {
var p = d3Geo.geoProjection(modifiedStereographicRaw(coefficients)).rotate(rotate).clipAngle(90), r = d3Geo.geoRotation(rotate), center = p.center;
delete p.rotate;
p.center = function (_) {
return arguments.length ? center(r(_)) : r.invert(center());
};
return p;
}
var sqrt6 = sqrt(6);
var sqrt7 = sqrt(7);
function mtFlatPolarParabolicRaw(lambda, phi) {
var theta = asin(7 * sin(phi) / (3 * sqrt6));
return [
sqrt6 * lambda * (2 * cos(2 * theta / 3) - 1) / sqrt7,
9 * sin(theta / 3) / sqrt7
];
}
mtFlatPolarParabolicRaw.invert = function (x, y) {
var theta = 3 * asin(y * sqrt7 / 9);
return [
x * sqrt7 / (sqrt6 * (2 * cos(2 * theta / 3) - 1)),
asin(sin(theta) * 3 * sqrt6 / 7)
];
};
var mtFlatPolarParabolic = function () {
return d3Geo.geoProjection(mtFlatPolarParabolicRaw)
.scale(164.859);
};
function mtFlatPolarQuarticRaw(lambda, phi) {
var k = (1 + sqrt1_2) * sin(phi), theta = phi;
for (var i = 0, delta; i < 25; i++) {
theta -= delta = (sin(theta / 2) + sin(theta) - k) / (0.5 * cos(theta / 2) + cos(theta));
if (abs(delta) < epsilon)
break;
}
return [
lambda * (1 + 2 * cos(theta) / cos(theta / 2)) / (3 * sqrt2),
2 * sqrt(3) * sin(theta / 2) / sqrt(2 + sqrt2)
];
}
mtFlatPolarQuarticRaw.invert = function (x, y) {
var sinTheta_2 = y * sqrt(2 + sqrt2) / (2 * sqrt(3)), theta = 2 * asin(sinTheta_2);
return [
3 * sqrt2 * x / (1 + 2 * cos(theta) / cos(theta / 2)),
asin((sinTheta_2 + sin(theta)) / (1 + sqrt1_2))
];
};
var mtFlatPolarQuartic = function () {
return d3Geo.geoProjection(mtFlatPolarQuarticRaw)
.scale(188.209);
};
function mtFlatPolarSinusoidalRaw(lambda, phi) {
var A = sqrt(6 / (4 + pi)), k = (1 + pi / 4) * sin(phi), theta = phi / 2;
for (var i = 0, delta; i < 25; i++) {
theta -= delta = (theta / 2 + sin(theta) - k) / (0.5 + cos(theta));
if (abs(delta) < epsilon)
break;
}
return [
A * (0.5 + cos(theta)) * lambda / 1.5,
A * theta
];
}
mtFlatPolarSinusoidalRaw.invert = function (x, y) {
var A = sqrt(6 / (4 + pi)), theta = y / A;
if (abs(abs(theta) - halfPi) < epsilon)
theta = theta < 0 ? -halfPi : halfPi;
return [
1.5 * x / (A * (0.5 + cos(theta))),
asin((theta / 2 + sin(theta)) / (1 + pi / 4))
];
};
var mtFlatPolarSinusoidal = function () {
return d3Geo.geoProjection(mtFlatPolarSinusoidalRaw)
.scale(166.518);
};
function naturalEarthRaw(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)))
];
}
naturalEarthRaw.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 (abs(delta) > epsilon && --i > 0);
return [
x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),
phi
];
};
var naturalEarth = function () {
return d3Geo.geoProjection(naturalEarthRaw)
.scale(175.295);
};
function naturalEarth2Raw(lambda, phi) {
var phi2 = phi * phi, phi4 = phi2 * phi2, phi6 = phi2 * phi4;
return [
lambda * (0.84719 - 0.13063 * phi2 + phi6 * phi6 * (-0.04515 + 0.05494 * phi2 - 0.02326 * phi4 + 0.00331 * phi6)),
phi * (1.01183 + phi4 * phi4 * (-0.02625 + 0.01926 * phi2 - 0.00396 * phi4))
];
}
naturalEarth2Raw.invert = function (x, y) {
var phi = y, i = 25, delta, phi2, phi4, phi6;
do {
phi2 = phi * phi;
phi4 = phi2 * phi2;
phi -= delta = ((phi * (1.01183 + phi4 * phi4 * (-0.02625 + 0.01926 * phi2 - 0.00396 * phi4))) - y) /
(1.01183 + phi4 * phi4 * ((9 * -0.02625) + (11 * 0.01926) * phi2 + (13 * -0.00396) * phi4));
} while (abs(delta) > epsilon2 && --i > 0);
phi2 = phi * phi;
phi4 = phi2 * phi2;
phi6 = phi2 * phi4;
return [
x / (0.84719 - 0.13063 * phi2 + phi6 * phi6 * (-0.04515 + 0.05494 * phi2 - 0.02326 * phi4 + 0.00331 * phi6)),
phi
];
};
var naturalEarth2 = function () {
return d3Geo.geoProjection(naturalEarth2Raw)
.scale(175.295);
};
function nellHammerRaw(lambda, phi) {
return [
lambda * (1 + cos(phi)) / 2,
2 * (phi - tan(phi / 2))
];
}
nellHammerRaw.invert = function (x, y) {
var p = y / 2;
for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; ++i) {
var c = cos(y / 2);
y -= delta = (y - tan(y / 2) - p) / (1 - 0.5 / (c * c));
}
return [
2 * x / (1 + cos(y)),
y
];
};
var nellHammer = function () {
return d3Geo.geoProjection(nellHammerRaw)
.scale(152.63);
};
// Based on Java implementation by Bojan Savric.
// https://github.com/OSUCartography/JMapProjLib/blob/master/src/com/jhlabs/map/proj/PattersonProjection.java
var pattersonK1 = 1.0148;
var pattersonK2 = 0.23185;
var pattersonK3 = -0.14499;
var pattersonK4 = 0.02406;
var pattersonC1 = pattersonK1;
var pattersonC2 = 5 * pattersonK2;
var pattersonC3 = 7 * pattersonK3;
var pattersonC4 = 9 * pattersonK4;
var pattersonYmax = 1.790857183;
function pattersonRaw(lambda, phi) {
var phi2 = phi * phi;
return [
lambda,
phi * (pattersonK1 + phi2 * phi2 * (pattersonK2 + phi2 * (pattersonK3 + pattersonK4 * phi2)))
];
}
pattersonRaw.invert = function (x, y) {
if (y > pattersonYmax)
y = pattersonYmax;
else if (y < -pattersonYmax)
y = -pattersonYmax;
var yc = y, delta;
do { // Newton-Raphson
var y2 = yc * yc;
yc -= delta = ((yc * (pattersonK1 + y2 * y2 * (pattersonK2 + y2 * (pattersonK3 + pattersonK4 * y2)))) - y) / (pattersonC1 + y2 * y2 * (pattersonC2 + y2 * (pattersonC3 + pattersonC4 * y2)));
} while (abs(delta) > epsilon);
return [x, yc];
};
var patterson = function () {
return d3Geo.geoProjection(pattersonRaw)
.scale(139.319);
};
function polyconicRaw(lambda, phi) {
if (abs(phi) < epsilon)
return [lambda, 0];
var tanPhi = tan(phi), k = lambda * sin(phi);
return [
sin(k) / tanPhi,
phi + (1 - cos(k)) / tanPhi
];
}
polyconicRaw.invert = function (x, y) {
if (abs(y) < epsilon)
return [x, 0];
var k = x * x + y * y, phi = y * 0.5, i = 10, delta;
do {
var tanPhi = tan(phi), secPhi = 1 / cos(phi), j = k - 2 * y * phi + phi * phi;
phi -= delta = (tanPhi * j + 2 * (phi - y)) / (2 + j * secPhi * secPhi + 2 * (phi - y) * tanPhi);
} while (abs(delta) > epsilon && --i > 0);
tanPhi = tan(phi);
return [
(abs(y) < abs(phi + 1 / tanPhi) ? asin(x * tanPhi) : sign(x) * (acos(abs(x * tanPhi)) + halfPi)) / sin(phi),
phi
];
};
var polyconic = function () {
return d3Geo.geoProjection(polyconicRaw)
.scale(103.74);
};
// Note: 6-element arrays are used to denote the 3x3 affine transform matrix:
// [a, b, c,
// d, e, f,
// 0, 0, 1] - this redundant row is left out.
// Transform matrix for [a0, a1] -> [b0, b1].
var matrix = function (a, b) {
var u = subtract(a[1], a[0]), v = subtract(b[1], b[0]), phi = angle$1(u, v), s = length(u) / length(v);
return multiply([
1, 0, a[0][0],
0, 1, a[0][1]
], multiply([
s, 0, 0,
0, s, 0
], multiply([
cos(phi), sin(phi), 0,
-sin(phi), cos(phi), 0
], [
1, 0, -b[0][0],
0, 1, -b[0][1]
])));
};
// Inverts a transform matrix.
function inverse(m) {
var k = 1 / (m[0] * m[4] - m[1] * m[3]);
return [
k * m[4], -k * m[1], k * (m[1] * m[5] - m[2] * m[4]),
-k * m[3], k * m[0], k * (m[2] * m[3] - m[0] * m[5])
];
}
// Multiplies two 3x2 matrices.
function multiply(a, b) {
return [
a[0] * b[0] + a[1] * b[3],
a[0] * b[1] + a[1] * b[4],
a[0] * b[2] + a[1] * b[5] + a[2],
a[3] * b[0] + a[4] * b[3],
a[3] * b[1] + a[4] * b[4],
a[3] * b[2] + a[4] * b[5] + a[5]
];
}
// Subtracts 2D vectors.
function subtract(a, b) {
return [a[0] - b[0], a[1] - b[1]];
}
// Magnitude of a 2D vector.
function length(v) {
return sqrt(v[0] * v[0] + v[1] * v[1]);
}
// Angle between two 2D vectors.
function angle$1(a, b) {
return atan2(a[0] * b[1] - a[1] * b[0], a[0] * b[0] + a[1] * b[1]);
}
// Creates a polyhedral projection.
// * root: a spanning tree of polygon faces. Nodes are automatically
// augmented with a transform matrix.
// * face: a function that returns the appropriate node for a given {lambda, phi}
// point (radians).
// * r: rotation angle for final polyhedral net. Defaults to -pi / 6 (for
// butterflies).
var polyhedral = function (root, face, r) {
r = r == null ? -pi / 6 : r; // TODO automate
recurse(root, { transform: [
cos(r), sin(r), 0,
-sin(r), cos(r), 0
] });
function recurse(node, parent) {
node.edges = faceEdges(node.face);
// Find shared edge.
if (parent.face) {
var shared = node.shared = sharedEdge(node.face, parent.face), m = matrix(shared.map(parent.project), shared.map(node.project));
node.transform = parent.transform ? multiply(parent.transform, m) : m;
// Replace shared edge in parent edges array.
var edges = parent.edges;
for (var i = 0, n = edges.length; i < n; ++i) {
if (pointEqual$1(shared[0], edges[i][1]) && pointEqual$1(shared[1], edges[i][0]))
edges[i] = node;
if (pointEqual$1(shared[0], edges[i][0]) && pointEqual$1(shared[1], edges[i][1]))
edges[i] = node;
}
edges = node.edges;
for (i = 0, n = edges.length; i < n; ++i) {
if (pointEqual$1(shared[0], edges[i][0]) && pointEqual$1(shared[1], edges[i][1]))
edges[i] = parent;
if (pointEqual$1(shared[0], edges[i][1]) && pointEqual$1(shared[1], edges[i][0]))
edges[i] = parent;
}
}
else {
node.transform = parent.transform;
}
if (node.children) {
node.children.forEach(function (child) {
recurse(child, node);
});
}
return node;
}
function forward(lambda, phi) {
var node = face(lambda, phi), point = node.project([lambda * degrees, phi * degrees]), t;
if (t = node.transform) {
return [
t[0] * point[0] + t[1] * point[1] + t[2],
-(t[3] * point[0] + t[4] * point[1] + t[5])
];
}
point[1] = -point[1];
return point;
}
// Naive inverse! A faster solution would use bounding boxes, or even a
// polygonal quadtree.
if (hasInverse(root))
forward.invert = function (x, y) {
var coordinates = faceInvert(root, [x, -y]);
return coordinates && (coordinates[0] *= radians, coordinates[1] *= radians, coordinates);
};
function faceInvert(node, coordinates) {
var invert = node.project.invert, t = node.transform, point = coordinates;
if (t) {
t = inverse(t);
point = [
t[0] * point[0] + t[1] * point[1] + t[2],
(t[3] * point[0] + t[4] * point[1] + t[5])
];
}
if (invert && node === faceDegrees(p = invert(point)))
return p;
var p, children = node.children;
for (var i = 0, n = children && children.length; i < n; ++i) {
if (p = faceInvert(children[i], coordinates))
return p;
}
}
function faceDegrees(coordinates) {
return face(coordinates[0] * radians, coordinates[1] * radians);
}
var proj = d3Geo.geoProjection(forward), stream_ = proj.stream;
proj.stream = function (stream) {
var rotate = proj.rotate(), rotateStream = stream_(stream), sphereStream = (proj.rotate([0, 0]), stream_(stream));
proj.rotate(rotate);
rotateStream.sphere = function () {
sphereStream.polygonStart();
sphereStream.lineStart();
outline(sphereStream, root);
sphereStream.lineEnd();
sphereStream.polygonEnd();
};
return rotateStream;
};
return proj;
};
function outline(stream, node, parent) {
var point, edges = node.edges, n = edges.length, edge, multiPoint = { type: "MultiPoint", coordinates: node.face }, notPoles = node.face.filter(function (d) { return abs(d[1]) !== 90; }), b = d3Geo.geoBounds({ type: "MultiPoint", coordinates: notPoles }), inside = false, j = -1, dx = b[1][0] - b[0][0];
// TODO
var c = dx === 180 || dx === 360
? [(b[0][0] + b[1][0]) / 2, (b[0][1] + b[1][1]) / 2]
: d3Geo.geoCentroid(multiPoint);
// First find the shared edge…
if (parent)
while (++j < n) {
if (edges[j] === parent)
break;
}
++j;
for (var i = 0; i < n; ++i) {
edge = edges[(i + j) % n];
if (Array.isArray(edge)) {
if (!inside) {
stream.point((point = d3Geo.geoInterpolate(edge[0], c)(epsilon))[0], point[1]);
inside = true;
}
stream.point((point = d3Geo.geoInterpolate(edge[1], c)(epsilon))[0], point[1]);
}
else {
inside = false;
if (edge !== parent)
outline(stream, edge, node);
}
}
}
// Tests equality of two spherical points.
function pointEqual$1(a, b) {
return a && b && a[0] === b[0] && a[1] === b[1];
}
// Finds a shared edge given two clockwise polygons.
function sharedEdge(a, b) {
var x, y, n = a.length, found = null;
for (var i = 0; i < n; ++i) {
x = a[i];
for (var j = b.length; --j >= 0;) {
y = b[j];
if (x[0] === y[0] && x[1] === y[1]) {
if (found)
return [found, x];
found = x;
}
}
}
}
// Converts an array of n face vertices to an array of n + 1 edges.
function faceEdges(face) {
var n = face.length, edges = [];
for (var a = face[n - 1], i = 0; i < n; ++i)
edges.push([a, a = face[i]]);
return edges;
}
function hasInverse(node) {
return node.project.invert || node.children && node.children.some(hasInverse);
}
// TODO generate on-the-fly to avoid external modification.
var octahedron = [
[0, 90],
[-90, 0], [0, 0], [90, 0], [180, 0],
[0, -90]
];
var octahedron$1 = [
[0, 2, 1],
[0, 3, 2],
[5, 1, 2],
[5, 2, 3],
[0, 1, 4],
[0, 4, 3],
[5, 4, 1],
[5, 3, 4]
].map(function (face) {
return face.map(function (i) {
return octahedron[i];
});
});
var butterfly = function (faceProjection) {
faceProjection = faceProjection || function (face) {
var c = d3Geo.geoCentroid({ type: "MultiPoint", coordinates: face });
return d3Geo.geoGnomonic().scale(1).translate([0, 0]).rotate([-c[0], -c[1]]);
};
var faces = octahedron$1.map(function (face) {
return { face: face, project: faceProjection(face) };
});
[-1, 0, 0, 1, 0, 1, 4, 5].forEach(function (d, i) {
var node = faces[d];
node && (node.children || (node.children = [])).push(faces[i]);
});
return polyhedral(faces[0], function (lambda, phi) {
return faces[lambda < -pi / 2 ? phi < 0 ? 6 : 4
: lambda < 0 ? phi < 0 ? 2 : 0
: lambda < pi / 2 ? phi < 0 ? 3 : 1
: phi < 0 ? 7 : 5];
})
.scale(101.858)
.center([0, 45]);
};
var kx = 2 / sqrt(3);
function collignonK(a, b) {
var p = collignonRaw(a, b);
return [p[0] * kx, p[1]];
}
collignonK.invert = function (x, y) {
return collignonRaw.invert(x / kx, y);
};
var collignon$1 = function (faceProjection) {
faceProjection = faceProjection || function (face) {
var c = d3Geo.geoCentroid({ type: "MultiPoint", coordinates: face });
return d3Geo.geoProjection(collignonK).translate([0, 0]).scale(1).rotate(c[1] > 0 ? [-c[0], 0] : [180 - c[0], 180]);
};
var faces = octahedron$1.map(function (face) {
return { face: face, project: faceProjection(face) };
});
[-1, 0, 0, 1, 0, 1, 4, 5].forEach(function (d, i) {
var node = faces[d];
node && (node.children || (node.children = [])).push(faces[i]);
});
return polyhedral(faces[0], function (lambda, phi) {
return faces[lambda < -pi / 2 ? phi < 0 ? 6 : 4
: lambda < 0 ? phi < 0 ? 2 : 0
: lambda < pi / 2 ? phi < 0 ? 3 : 1
: phi < 0 ? 7 : 5];
})
.scale(121.906)
.center([0, 48.5904]);
};
var waterman = function (faceProjection) {
faceProjection = faceProjection || function (face) {
var c = face.length === 6 ? d3Geo.geoCentroid({ type: "MultiPoint", coordinates: face }) : face[0];
return d3Geo.geoGnomonic().scale(1).translate([0, 0]).rotate([-c[0], -c[1]]);
};
var w5 = octahedron$1.map(function (face) {
var xyz = face.map(cartesian), n = xyz.length, a = xyz[n - 1], b, hexagon = [];
for (var i = 0; i < n; ++i) {
b = xyz[i];
hexagon.push(spherical([
a[0] * 0.9486832980505138 + b[0] * 0.31622776601683794,
a[1] * 0.9486832980505138 + b[1] * 0.31622776601683794,
a[2] * 0.9486832980505138 + b[2] * 0.31622776601683794
]), spherical([
b[0] * 0.9486832980505138 + a[0] * 0.31622776601683794,
b[1] * 0.9486832980505138 + a[1] * 0.31622776601683794,
b[2] * 0.9486832980505138 + a[2] * 0.31622776601683794
]));
a = b;
}
return hexagon;
});
var cornerNormals = [];
var parents = [-1, 0, 0, 1, 0, 1, 4, 5];
w5.forEach(function (hexagon, j) {
var face = octahedron$1[j], n = face.length, normals = cornerNormals[j] = [];
for (var i = 0; i < n; ++i) {
w5.push([
face[i],
hexagon[(i * 2 + 2) % (2 * n)],
hexagon[(i * 2 + 1) % (2 * n)]
]);
parents.push(j);
normals.push(cross(cartesian(hexagon[(i * 2 + 2) % (2 * n)]), cartesian(hexagon[(i * 2 + 1) % (2 * n)])));
}
});
var faces = w5.map(function (face) {
return {
project: faceProjection(face),
face: face
};
});
parents.forEach(function (d, i) {
var parent = faces[d];
parent && (parent.children || (parent.children = [])).push(faces[i]);
});
function face(lambda, phi) {
var cosphi = cos(phi), p = [cosphi * cos(lambda), cosphi * sin(lambda), sin(phi)];
var hexagon = lambda < -pi / 2 ? phi < 0 ? 6 : 4
: lambda < 0 ? phi < 0 ? 2 : 0
: lambda < pi / 2 ? phi < 0 ? 3 : 1
: phi < 0 ? 7 : 5;
var n = cornerNormals[hexagon];
return faces[dot(n[0], p) < 0 ? 8 + 3 * hexagon
: dot(n[1], p) < 0 ? 8 + 3 * hexagon + 1
: dot(n[2], p) < 0 ? 8 + 3 * hexagon + 2
: hexagon];
}
return polyhedral(faces[0], face)
.scale(110.625)
.center([0, 45]);
};
function dot(a, b) {
for (var i = 0, n = a.length, s = 0; i < n; ++i)
s += a[i] * b[i];
return s;
}
function cross(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]
];
}
// Converts 3D Cartesian to spherical coordinates (degrees).
function spherical(cartesian) {
return [
atan2(cartesian[1], cartesian[0]) * degrees,
asin(max(-1, min(1, cartesian[2]))) * degrees
];
}
// Converts spherical coordinates (degrees) to 3D Cartesian.
function cartesian(coordinates) {
var lambda = coordinates[0] * radians, phi = coordinates[1] * radians, cosphi = cos(phi);
return [
cosphi * cos(lambda),
cosphi * sin(lambda),
sin(phi)
];
}
var noop = function () { };
var clockwise = function (ring) {
if ((n = ring.length) < 4)
return false;
var i = 0, n, 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 <= 0;
};
var contains = function (ring, point) {
var x = point[0], y = point[1], contains = false;
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 (((yi > y) ^ (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi))
contains = !contains;
}
return contains;
};
var index = function (object, projection) {
var stream = projection.stream, project;
if (!stream)
throw new Error("invalid projection");
switch (object && object.type) {
case "Feature":
project = projectFeature;
break;
case "FeatureCollection":
project = projectFeatureCollection;
break;
default:
project = projectGeometry;
break;
}
return project(object, stream);
};
function projectFeatureCollection(o, stream) {
return {
type: "FeatureCollection",
features: o.features.map(function (f) {
return projectFeature(f, stream);
})
};
}
function projectFeature(o, stream) {
return {
type: "Feature",
id: o.id,
properties: o.properties,
geometry: projectGeometry(o.geometry, stream)
};
}
function projectGeometryCollection(o, stream) {
return {
type: "GeometryCollection",
geometries: o.geometries.map(function (o) {
return projectGeometry(o, stream);
})
};
}
function projectGeometry(o, stream) {
if (!o)
return null;
if (o.type === "GeometryCollection")
return projectGeometryCollection(o, stream);
var sink;
switch (o.type) {
case "Point":
sink = sinkPoint;
break;
case "MultiPoint":
sink = sinkPoint;
break;
case "LineString":
sink = sinkLine;
break;
case "MultiLineString":
sink = sinkLine;
break;
case "Polygon":
sink = sinkPolygon;
break;
case "MultiPolygon":
sink = sinkPolygon;
break;
case "Sphere":
sink = sinkPolygon;
break;
default: return null;
}
d3Geo.geoStream(o, stream(sink));
return sink.result();
}
var points = [];
var lines = [];
var sinkPoint = {
point: function (x, y) {
points.push([x, y]);
},
result: function () {
var result = !points.length ? null
: points.length < 2 ? { type: "Point", coordinates: points[0] }
: { type: "MultiPoint", coordinates: points };
points = [];
return result;
}
};
var sinkLine = {
lineStart: noop,
point: function (x, y) {
points.push([x, y]);
},
lineEnd: function () {
if (points.length)
lines.push(points), points = [];
},
result: function () {
var result = !lines.length ? null
: lines.length < 2 ? { type: "LineString", coordinates: lines[0] }
: { type: "MultiLineString", coordinates: lines };
lines = [];
return result;
}
};
var sinkPolygon = {
polygonStart: noop,
lineStart: noop,
point: function (x, y) {
points.push([x, y]);
},
lineEnd: function () {
var n = points.length;
if (n) {
do
points.push(points[0].slice());
while (++n < 4);
lines.push(points), points = [];
}
},
polygonEnd: noop,
result: function () {
if (!lines.length)
return null;
var polygons = [], holes = [];
// https://github.com/d3/d3/issues/1558
lines.forEach(function (ring) {
if (clockwise(ring))
polygons.push([ring]);
else
holes.push(ring);
});
holes.forEach(function (hole) {
var point = hole[0];
polygons.some(function (polygon) {
if (contains(polygon[0], point)) {
polygon.push(hole);
return true;
}
}) || polygons.push([hole]);
});
lines = [];
return !polygons.length ? null
: polygons.length > 1 ? { type: "MultiPolygon", coordinates: polygons }
: { type: "Polygon", coordinates: polygons[0] };
}
};
var quincuncial = function (project) {
var dx = project(halfPi, 0)[0] - project(-halfPi, 0)[0];
function projectQuincuncial(lambda, phi) {
var t = abs(lambda) < halfPi, p = project(t ? lambda : lambda > 0 ? lambda - pi : lambda + pi, phi), x = (p[0] - p[1]) * sqrt1_2, y = (p[0] + p[1]) * sqrt1_2;
if (t)
return [x, y];
var d = dx * sqrt1_2, s = x > 0 ^ y > 0 ? -1 : 1;
return [s * x - sign(y) * d, s * y - sign(x) * d];
}
if (project.invert)
projectQuincuncial.invert = function (x0, y0) {
var x = (x0 + y0) * sqrt1_2, y = (y0 - x0) * sqrt1_2, t = abs(x) < 0.5 * dx && abs(y) < 0.5 * dx;
if (!t) {
var d = dx * sqrt1_2, s = x > 0 ^ y > 0 ? -1 : 1, x1 = -s * x0 + (y > 0 ? 1 : -1) * d, y1 = -s * y0 + (x > 0 ? 1 : -1) * d;
x = (-x1 - y1) * sqrt1_2;
y = (x1 - y1) * sqrt1_2;
}
var p = project.invert(x, y);
if (!t)
p[0] += x > 0 ? pi : -pi;
return p;
};
return d3Geo.geoProjection(projectQuincuncial)
.rotate([-90, -90, 45])
.clipAngle(180 - 1e-3);
};
var gringorten$1 = function () {
return quincuncial(gringortenRaw)
.scale(176.423);
};
var peirce = function () {
return quincuncial(guyouRaw)
.scale(111.48);
};
var quantize = function (input, digits) {
if (!(0 <= (digits = +digits) && digits <= 20))
throw new Error("invalid digits");
function quantizePoint(input) {
var n = input.length, i = 2, output = new Array(n);
output[0] = +input[0].toFixed(digits);
output[1] = +input[1].toFixed(digits);
while (i < n)
output[i] = input[i], ++i;
return output;
}
function quantizePoints(input) {
return input.map(quantizePoint);
}
function quantizePolygon(input) {
return input.map(quantizePoints);
}
function quantizeGeometry(input) {
if (input == null)
return input;
var output;
switch (input.type) {
case "GeometryCollection":
output = { type: "GeometryCollection", geometries: input.geometries.map(quantizeGeometry) };
break;
case "Point":
output = { type: "Point", coordinates: quantizePoint(input.coordinates) };
break;
case "MultiPoint":
case "LineString":
output = { type: input.type, coordinates: quantizePoints(input.coordinates) };
break;
case "MultiLineString":
case "Polygon":
output = { type: input.type, coordinates: quantizePolygon(input.coordinates) };
break;
case "MultiPolygon":
output = { type: "MultiPolygon", coordinates: input.coordinates.map(quantizePolygon) };
break;
default: return input;
}
if (input.bbox != null)
output.bbox = input.bbox;
return output;
}
function quantizeFeature(input) {
var output = { type: "Feature", properties: input.properties, geometry: quantizeGeometry(input.geometry) };
if (input.id != null)
output.id = input.id;
if (input.bbox != null)
output.bbox = input.bbox;
return output;
}
if (input != null)
switch (input.type) {
case "Feature": return quantizeFeature(input);
case "FeatureCollection": {
var output = { type: "FeatureCollection", features: input.features.map(quantizeFeature) };
if (input.bbox != null)
output.bbox = input.bbox;
return output;
}
default: return quantizeGeometry(input);
}
return input;
};
function rectangularPolyconicRaw(phi0) {
var sinPhi0 = sin(phi0);
function forward(lambda, phi) {
var A = sinPhi0 ? tan(lambda * sinPhi0 / 2) / sinPhi0 : lambda / 2;
if (!phi)
return [2 * A, -phi0];
var E = 2 * atan(A * sin(phi)), cotPhi = 1 / tan(phi);
return [
sin(E) * cotPhi,
phi + (1 - cos(E)) * cotPhi - phi0
];
}
// TODO return null for points outside outline.
forward.invert = function (x, y) {
if (abs(y += phi0) < epsilon)
return [sinPhi0 ? 2 * atan(sinPhi0 * x / 2) / sinPhi0 : x, 0];
var k = x * x + y * y, phi = 0, i = 10, delta;
do {
var tanPhi = tan(phi), secPhi = 1 / cos(phi), j = k - 2 * y * phi + phi * phi;
phi -= delta = (tanPhi * j + 2 * (phi - y)) / (2 + j * secPhi * secPhi + 2 * (phi - y) * tanPhi);
} while (abs(delta) > epsilon && --i > 0);
var E = x * (tanPhi = tan(phi)), A = tan(abs(y) < abs(phi + 1 / tanPhi) ? asin(E) * 0.5 : acos(E) * 0.5 + pi / 4) / sin(phi);
return [
sinPhi0 ? 2 * atan(sinPhi0 * A) / sinPhi0 : 2 * A,
phi
];
};
return forward;
}
var rectangularPolyconic = function () {
return parallel1(rectangularPolyconicRaw)
.scale(131.215);
};
var K = [
[0.9986, -0.062],
[1.0000, 0.0000],
[0.9986, 0.0620],
[0.9954, 0.1240],
[0.9900, 0.1860],
[0.9822, 0.2480],
[0.9730, 0.3100],
[0.9600, 0.3720],
[0.9427, 0.4340],
[0.9216, 0.4958],
[0.8962, 0.5571],
[0.8679, 0.6176],
[0.8350, 0.6769],
[0.7986, 0.7346],
[0.7597, 0.7903],
[0.7186, 0.8435],
[0.6732, 0.8936],
[0.6213, 0.9394],
[0.5722, 0.9761],
[0.5322, 1.0000]
];
K.forEach(function (d) {
d[1] *= 1.0144;
});
function robinsonRaw(lambda, phi) {
var i = min(18, abs(phi) * 36 / pi), i0 = floor(i), di = i - i0, ax = (k = K[i0])[0], ay = k[1], bx = (k = K[++i0])[0], by = k[1], cx = (k = K[min(19, ++i0)])[0], cy = k[1], k;
return [
lambda * (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2),
(phi > 0 ? halfPi : -halfPi) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2)
];
}
robinsonRaw.invert = function (x, y) {
var yy = y / halfPi, phi = yy * 90, i = min(18, abs(phi / 5)), i0 = max(0, floor(i));
do {
var ay = K[i0][1], by = K[i0 + 1][1], cy = K[min(19, i0 + 2)][1], u = cy - ay, v = cy - 2 * by + ay, t = 2 * (abs(yy) - by) / u, c = v / u, di = t * (1 - c * t * (1 - 2 * c * t));
if (di >= 0 || i0 === 1) {
phi = (y >= 0 ? 5 : -5) * (di + i);
var j = 50, delta;
do {
i = min(18, abs(phi) / 5);
i0 = floor(i);
di = i - i0;
ay = K[i0][1];
by = K[i0 + 1][1];
cy = K[min(19, i0 + 2)][1];
phi -= (delta = (y >= 0 ? halfPi : -halfPi) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) - y) * degrees;
} while (abs(delta) > epsilon2 && --j > 0);
break;
}
} while (--i0 >= 0);
var ax = K[i0][0], bx = K[i0 + 1][0], cx = K[min(19, i0 + 2)][0];
return [
x / (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2),
phi * radians
];
};
var robinson = function () {
return d3Geo.geoProjection(robinsonRaw)
.scale(152.63);
};
function satelliteVerticalRaw(P) {
function forward(lambda, phi) {
var cosPhi = cos(phi), k = (P - 1) / (P - cosPhi * cos(lambda));
return [
k * cosPhi * sin(lambda),
k * sin(phi)
];
}
forward.invert = function (x, y) {
var rho2 = x * x + y * y, rho = sqrt(rho2), sinc = (P - sqrt(1 - rho2 * (P + 1) / (P - 1))) / ((P - 1) / rho + rho / (P - 1));
return [
atan2(x * sinc, rho * sqrt(1 - sinc * sinc)),
rho ? asin(y * sinc / rho) : 0
];
};
return forward;
}
function satelliteRaw(P, omega) {
var vertical = satelliteVerticalRaw(P);
if (!omega)
return vertical;
var cosOmega = cos(omega), sinOmega = sin(omega);
function forward(lambda, phi) {
var coordinates = vertical(lambda, phi), y = coordinates[1], A = y * sinOmega / (P - 1) + cosOmega;
return [
coordinates[0] * cosOmega / A,
y / A
];
}
forward.invert = function (x, y) {
var k = (P - 1) / (P - 1 - y * sinOmega);
return vertical.invert(k * x, k * y * cosOmega);
};
return forward;
}
var satellite = function () {
var distance = 2, omega = 0, m = d3Geo.geoProjectionMutator(satelliteRaw), p = m(distance, omega);
// As a multiple of radius.
p.distance = function (_) {
if (!arguments.length)
return distance;
return m(distance = +_, omega);
};
p.tilt = function (_) {
if (!arguments.length)
return omega * degrees;
return m(distance, omega = _ * radians);
};
return p
.scale(432.147)
.clipAngle(acos(1 / distance) * degrees - 1e-6);
};
var epsilon$1 = 1e-4;
var epsilonInverse = 1e4;
var x0 = -180;
var x0e = x0 + epsilon$1;
var x1 = 180;
var x1e = x1 - epsilon$1;
var y0 = -90;
var y0e = y0 + epsilon$1;
var y1 = 90;
var y1e = y1 - epsilon$1;
function nonempty(coordinates) {
return coordinates.length > 0;
}
function quantize$1(x) {
return Math.floor(x * epsilonInverse) / epsilonInverse;
}
function normalizePoint(y) {
return y === y0 || y === y1 ? [0, y] : [x0, quantize$1(y)]; // pole or antimeridian?
}
function clampPoint(p) {
var x = p[0], y = p[1], clamped = false;
if (x <= x0e)
x = x0, clamped = true;
else if (x >= x1e)
x = x1, clamped = true;
if (y <= y0e)
y = y0, clamped = true;
else if (y >= y1e)
y = y1, clamped = true;
return clamped ? [x, y] : p;
}
function clampPoints(points) {
return points.map(clampPoint);
}
// For each ring, detect where it crosses the antimeridian or pole.
function extractFragments(rings, polygon, fragments) {
for (var j = 0, m = rings.length; j < m; ++j) {
var ring = rings[j].slice();
// By default, assume that this ring doesnt need any stitching.
fragments.push({ index: -1, polygon: polygon, ring: ring });
for (var i = 0, n = ring.length; i < n; ++i) {
var point = ring[i], x = point[0], y = point[1];
// If this is an antimeridian or polar point…
if (x <= x0e || x >= x1e || y <= y0e || y >= y1e) {
ring[i] = clampPoint(point);
// Advance through any antimeridian or polar points…
for (var k = i + 1; k < n; ++k) {
var pointk = ring[k], xk = pointk[0], yk = pointk[1];
if (xk > x0e && xk < x1e && yk > y0e && yk < y1e)
break;
}
// If this was just a single antimeridian or polar point,
// we dont need to cut this ring into a fragment;
// we can just leave it as-is.
if (k === i + 1)
continue;
// Otherwise, if this is not the first point in the ring,
// cut the current fragment so that it ends at the current point.
// The current point is also normalized for later joining.
if (i) {
var fragmentBefore = { index: -1, polygon: polygon, ring: ring.slice(0, i + 1) };
fragmentBefore.ring[fragmentBefore.ring.length - 1] = normalizePoint(y);
fragments[fragments.length - 1] = fragmentBefore;
}
// If the ring started with an antimeridian fragment,
// we can ignore that fragment entirely.
else
fragments.pop();
// If the remainder of the ring is an antimeridian fragment,
// move on to the next ring.
if (k >= n)
break;
// Otherwise, add the remaining ring fragment and continue.
fragments.push({ index: -1, polygon: polygon, ring: ring = ring.slice(k - 1) });
ring[0] = normalizePoint(ring[0][1]);
i = -1;
n = ring.length;
}
}
}
}
// Now stitch the fragments back together into rings.
function stitchFragments(fragments) {
var i, n = fragments.length;
// To connect the fragments start-to-end, create a simple index by end.
var fragmentByStart = {}, fragmentByEnd = {}, fragment, start, startFragment, end, endFragment;
// For each fragment…
for (i = 0; i < n; ++i) {
fragment = fragments[i];
start = fragment.ring[0];
end = fragment.ring[fragment.ring.length - 1];
// If this fragment is closed, add it as a standalone ring.
if (start[0] === end[0] && start[1] === end[1]) {
fragment.polygon.push(fragment.ring);
fragments[i] = null;
continue;
}
fragment.index = i;
fragmentByStart[start] = fragmentByEnd[end] = fragment;
}
// For each open fragment…
for (i = 0; i < n; ++i) {
fragment = fragments[i];
if (fragment) {
start = fragment.ring[0];
end = fragment.ring[fragment.ring.length - 1];
startFragment = fragmentByEnd[start];
endFragment = fragmentByStart[end];
delete fragmentByStart[start];
delete fragmentByEnd[end];
// If this fragment is closed, add it as a standalone ring.
if (start[0] === end[0] && start[1] === end[1]) {
fragment.polygon.push(fragment.ring);
continue;
}
if (startFragment) {
delete fragmentByEnd[start];
delete fragmentByStart[startFragment.ring[0]];
startFragment.ring.pop(); // drop the shared coordinate
fragments[startFragment.index] = null;
fragment = { index: -1, polygon: startFragment.polygon, ring: startFragment.ring.concat(fragment.ring) };
if (startFragment === endFragment) {
// Connect both ends to this single fragment to create a ring.
fragment.polygon.push(fragment.ring);
}
else {
fragment.index = n++;
fragments.push(fragmentByStart[fragment.ring[0]] = fragmentByEnd[fragment.ring[fragment.ring.length - 1]] = fragment);
}
}
else if (endFragment) {
delete fragmentByStart[end];
delete fragmentByEnd[endFragment.ring[endFragment.ring.length - 1]];
fragment.ring.pop(); // drop the shared coordinate
fragment = { index: n++, polygon: endFragment.polygon, ring: fragment.ring.concat(endFragment.ring) };
fragments[endFragment.index] = null;
fragments.push(fragmentByStart[fragment.ring[0]] = fragmentByEnd[fragment.ring[fragment.ring.length - 1]] = fragment);
}
else {
fragment.ring.push(fragment.ring[0]); // close ring
fragment.polygon.push(fragment.ring);
}
}
}
}
function stitchFeature(input) {
var output = { type: "Feature", geometry: stitchGeometry(input.geometry) };
if (input.id != null)
output.id = input.id;
if (input.bbox != null)
output.bbox = input.bbox;
if (input.properties != null)
output.properties = input.properties;
return output;
}
function stitchGeometry(input) {
if (input == null)
return input;
var output, fragments, i, n;
switch (input.type) {
case "GeometryCollection":
output = { type: "GeometryCollection", geometries: input.geometries.map(stitchGeometry) };
break;
case "Point":
output = { type: "Point", coordinates: clampPoint(input.coordinates) };
break;
case "MultiPoint":
case "LineString":
output = { type: input.type, coordinates: clampPoints(input.coordinates) };
break;
case "MultiLineString":
output = { type: "MultiLineString", coordinates: input.coordinates.map(clampPoints) };
break;
case "Polygon": {
var polygon = [];
extractFragments(input.coordinates, polygon, fragments = []);
stitchFragments(fragments);
output = { type: "Polygon", coordinates: polygon };
break;
}
case "MultiPolygon": {
fragments = [], i = -1, n = input.coordinates.length;
var polygons = new Array(n);
while (++i < n)
extractFragments(input.coordinates[i], polygons[i] = [], fragments);
stitchFragments(fragments);
output = { type: "MultiPolygon", coordinates: polygons.filter(nonempty) };
break;
}
default: return input;
}
if (input.bbox != null)
output.bbox = input.bbox;
return output;
}
var stitch = function (input) {
if (input == null)
return input;
switch (input.type) {
case "Feature": return stitchFeature(input);
case "FeatureCollection": {
var output = { type: "FeatureCollection", features: input.features.map(stitchFeature) };
if (input.bbox != null)
output.bbox = input.bbox;
return output;
}
default: return stitchGeometry(input);
}
};
function timesRaw(lambda, phi) {
var t = tan(phi / 2), s = sin(quarterPi * t);
return [
lambda * (0.74482 - 0.34588 * s * s),
1.70711 * t
];
}
timesRaw.invert = function (x, y) {
var t = y / 1.70711, s = sin(quarterPi * t);
return [
x / (0.74482 - 0.34588 * s * s),
2 * atan(t)
];
};
var times = function () {
return d3Geo.geoProjection(timesRaw)
.scale(146.153);
};
// Compute the origin as the midpoint of the two reference points.
// Rotate one of the reference points by the origin.
// Apply the spherical law of sines to compute gamma rotation.
var twoPoint = function (raw, p0, p1) {
var i = d3Geo.geoInterpolate(p0, p1), o = i(0.5), a = d3Geo.geoRotation([-o[0], -o[1]])(p0), b = i.distance / 2, y = -asin(sin(a[1] * radians) / sin(b)), R = [-o[0], -o[1], -(a[0] > 0 ? pi - y : y) * degrees], p = d3Geo.geoProjection(raw(b)).rotate(R), r = d3Geo.geoRotation(R), center = p.center;
delete p.rotate;
p.center = function (_) {
return arguments.length ? center(r(_)) : r.invert(center());
};
return p
.clipAngle(90);
};
function twoPointAzimuthalRaw(d) {
var cosd = cos(d);
function forward(lambda, phi) {
var coordinates = d3Geo.geoGnomonicRaw(lambda, phi);
coordinates[0] *= cosd;
return coordinates;
}
forward.invert = function (x, y) {
return d3Geo.geoGnomonicRaw.invert(x / cosd, y);
};
return forward;
}
function twoPointAzimuthalUsa() {
return twoPointAzimuthal([-158, 21.5], [-77, 39])
.clipAngle(60)
.scale(400);
}
function twoPointAzimuthal(p0, p1) {
return twoPoint(twoPointAzimuthalRaw, p0, p1);
}
// TODO clip to ellipse
function twoPointEquidistantRaw(z0) {
if (!(z0 *= 2))
return d3Geo.geoAzimuthalEquidistantRaw;
var lambdaa = -z0 / 2, lambdab = -lambdaa, z02 = z0 * z0, tanLambda0 = tan(lambdab), S = 0.5 / sin(lambdab);
function forward(lambda, phi) {
var za = acos(cos(phi) * cos(lambda - lambdaa)), zb = acos(cos(phi) * cos(lambda - lambdab)), ys = phi < 0 ? -1 : 1;
za *= za, zb *= zb;
return [
(za - zb) / (2 * z0),
ys * sqrt(4 * z02 * zb - (z02 - za + zb) * (z02 - za + zb)) / (2 * z0)
];
}
forward.invert = function (x, y) {
var y2 = y * y, cosza = cos(sqrt(y2 + (t = x + lambdaa) * t)), coszb = cos(sqrt(y2 + (t = x + lambdab) * t)), t, d;
return [
atan2(d = cosza - coszb, t = (cosza + coszb) * tanLambda0),
(y < 0 ? -1 : 1) * acos(sqrt(t * t + d * d) * S)
];
};
return forward;
}
function twoPointEquidistantUsa() {
return twoPointEquidistant([-158, 21.5], [-77, 39])
.clipAngle(130)
.scale(122.571);
}
function twoPointEquidistant(p0, p1) {
return twoPoint(twoPointEquidistantRaw, p0, p1);
}
function vanDerGrintenRaw(lambda, phi) {
if (abs(phi) < epsilon)
return [lambda, 0];
var sinTheta = abs(phi / halfPi), theta = asin(sinTheta);
if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon)
return [0, sign(phi) * pi * tan(theta / 2)];
var cosTheta = cos(theta), A = abs(pi / lambda - lambda / pi) / 2, A2 = A * A, G = cosTheta / (sinTheta + cosTheta - 1), P = G * (2 / sinTheta - 1), P2 = P * P, P2_A2 = P2 + A2, G_P2 = G - P2, Q = A2 + G;
return [
sign(lambda) * pi * (A * G_P2 + sqrt(A2 * G_P2 * G_P2 - P2_A2 * (G * G - P2))) / P2_A2,
sign(phi) * pi * (P * Q - A * sqrt((A2 + 1) * P2_A2 - Q * Q)) / P2_A2
];
}
vanDerGrintenRaw.invert = function (x, y) {
if (abs(y) < epsilon)
return [x, 0];
if (abs(x) < epsilon)
return [0, halfPi * sin(2 * atan(y / pi))];
var x2 = (x /= pi) * x, y2 = (y /= pi) * y, x2_y2 = x2 + y2, z = x2_y2 * x2_y2, c1 = -abs(y) * (1 + x2_y2), c2 = c1 - 2 * y2 + x2, c3 = -2 * c1 + 1 + 2 * y2 + z, d = y2 / c3 + (2 * c2 * c2 * c2 / (c3 * c3 * c3) - 9 * c1 * c2 / (c3 * c3)) / 27, a1 = (c1 - c2 * c2 / (3 * c3)) / c3, m1 = 2 * sqrt(-a1 / 3), theta1 = acos(3 * d / (a1 * m1)) / 3;
return [
pi * (x2_y2 - 1 + sqrt(1 + 2 * (x2 - y2) + z)) / (2 * x),
sign(y) * pi * (-m1 * cos(theta1 + pi / 3) - c2 / (3 * c3))
];
};
var vanDerGrinten = function () {
return d3Geo.geoProjection(vanDerGrintenRaw)
.scale(79.4183);
};
function vanDerGrinten2Raw(lambda, phi) {
if (abs(phi) < epsilon)
return [lambda, 0];
var sinTheta = abs(phi / halfPi), theta = asin(sinTheta);
if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon)
return [0, sign(phi) * pi * tan(theta / 2)];
var cosTheta = cos(theta), A = abs(pi / lambda - lambda / pi) / 2, A2 = A * A, x1 = cosTheta * (sqrt(1 + A2) - A * cosTheta) / (1 + A2 * sinTheta * sinTheta);
return [
sign(lambda) * pi * x1,
sign(phi) * pi * sqrt(1 - x1 * (2 * A + x1))
];
}
vanDerGrinten2Raw.invert = function (x, y) {
if (!x)
return [0, halfPi * sin(2 * atan(y / pi))];
var x1 = abs(x / pi), A = (1 - x1 * x1 - (y /= pi) * y) / (2 * x1), A2 = A * A, B = sqrt(A2 + 1);
return [
sign(x) * pi * (B - A),
sign(y) * halfPi * sin(2 * atan2(sqrt((1 - 2 * A * x1) * (A + B) - x1), sqrt(B + A + x1)))
];
};
var vanDerGrinten2 = function () {
return d3Geo.geoProjection(vanDerGrinten2Raw)
.scale(79.4183);
};
function vanDerGrinten3Raw(lambda, phi) {
if (abs(phi) < epsilon)
return [lambda, 0];
var sinTheta = phi / halfPi, theta = asin(sinTheta);
if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon)
return [0, pi * tan(theta / 2)];
var A = (pi / lambda - lambda / pi) / 2, y1 = sinTheta / (1 + cos(theta));
return [
pi * (sign(lambda) * sqrt(A * A + 1 - y1 * y1) - A),
pi * y1
];
}
vanDerGrinten3Raw.invert = function (x, y) {
if (!y)
return [x, 0];
var y1 = y / pi, A = (pi * pi * (1 - y1 * y1) - x * x) / (2 * pi * x);
return [
x ? pi * (sign(x) * sqrt(A * A + 1) - A) : 0,
halfPi * sin(2 * atan(y1))
];
};
var vanDerGrinten3 = function () {
return d3Geo.geoProjection(vanDerGrinten3Raw)
.scale(79.4183);
};
function vanDerGrinten4Raw(lambda, phi) {
if (!phi)
return [lambda, 0];
var phi0 = abs(phi);
if (!lambda || phi0 === halfPi)
return [0, phi];
var B = phi0 / halfPi, B2 = B * B, C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)), C2 = C * C, BC = B * C, B_C2 = B2 + C2 + 2 * BC, B_3C = B + 3 * C, lambda0 = lambda / halfPi, lambda1 = lambda0 + 1 / lambda0, D = sign(abs(lambda) - halfPi) * sqrt(lambda1 * lambda1 - 4), D2 = D * D, F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + 12 * BC * C2 + 4 * C2 * C2), x1 = (D * (B_C2 + C2 - 1) + 2 * sqrt(F)) / (4 * B_C2 + D2);
return [
sign(lambda) * halfPi * x1,
sign(phi) * halfPi * sqrt(1 + D * abs(x1) - x1 * x1)
];
}
vanDerGrinten4Raw.invert = function (x, y) {
var delta;
if (!x || !y)
return [x, y];
y /= pi;
var x1 = sign(x) * x / halfPi, D = (x1 * x1 - 1 + 4 * y * y) / abs(x1), D2 = D * D, B = 2 * y, i = 50;
do {
var B2 = B * B, C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)), C_ = (3 * B - B2 * B - 10) / (2 * B2 * B), C2 = C * C, BC = B * C, B_C = B + C, B_C2 = B_C * B_C, B_3C = B + 3 * C, F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + C2 * (12 * BC + 4 * C2)), F_ = -2 * B_C * (4 * BC * C2 + (1 - 4 * B2 + 3 * B2 * B2) * (1 + C_) + C2 * (-6 + 14 * B2 - D2 + (-8 + 8 * B2 - 2 * D2) * C_) + BC * (-8 + 12 * B2 + (-10 + 10 * B2 - D2) * C_)), sqrtF = sqrt(F), f = D * (B_C2 + C2 - 1) + 2 * sqrtF - x1 * (4 * B_C2 + D2), f_ = D * (2 * C * C_ + 2 * B_C * (1 + C_)) + F_ / sqrtF - 8 * B_C * (D * (-1 + C2 + B_C2) + 2 * sqrtF) * (1 + C_) / (D2 + 4 * B_C2);
B -= delta = f / f_;
} while (delta > epsilon && --i > 0);
return [
sign(x) * (sqrt(D * D + 4) + D) * pi / 4,
halfPi * B
];
};
var vanDerGrinten4 = function () {
return d3Geo.geoProjection(vanDerGrinten4Raw)
.scale(127.16);
};
var A = 4 * pi + 3 * sqrt(3);
var B = 2 * sqrt(2 * pi * sqrt(3) / A);
var wagner4Raw = mollweideBromleyRaw(B * sqrt(3) / pi, B, A / 6);
var wagner4 = function () {
return d3Geo.geoProjection(wagner4Raw)
.scale(176.84);
};
function wagner6Raw(lambda, phi) {
return [lambda * sqrt(1 - 3 * phi * phi / (pi * pi)), phi];
}
wagner6Raw.invert = function (x, y) {
return [x / sqrt(1 - 3 * y * y / (pi * pi)), y];
};
var wagner6 = function () {
return d3Geo.geoProjection(wagner6Raw)
.scale(152.63);
};
function wagner7Raw(lambda, phi) {
var s = 0.90631 * sin(phi), c0 = sqrt(1 - s * s), c1 = sqrt(2 / (1 + c0 * cos(lambda /= 3)));
return [
2.66723 * c0 * c1 * sin(lambda),
1.24104 * s * c1
];
}
wagner7Raw.invert = function (x, y) {
var t1 = x / 2.66723, t2 = y / 1.24104, p = sqrt(t1 * t1 + t2 * t2), c = 2 * asin(p / 2);
return [
3 * atan2(x * tan(c), 2.66723 * p),
p && asin(y * sin(c) / (1.24104 * 0.90631 * p))
];
};
var wagner7 = function () {
return d3Geo.geoProjection(wagner7Raw)
.scale(172.632);
};
function wiechelRaw(lambda, phi) {
var cosPhi = cos(phi), sinPhi = cos(lambda) * cosPhi, sin1_Phi = 1 - sinPhi, cosLambda = cos(lambda = atan2(sin(lambda) * cosPhi, -sin(phi))), sinLambda = sin(lambda);
cosPhi = sqrt(1 - sinPhi * sinPhi);
return [
sinLambda * cosPhi - cosLambda * sin1_Phi,
-cosLambda * cosPhi - sinLambda * sin1_Phi
];
}
wiechelRaw.invert = function (x, y) {
var w = (x * x + y * y) / -2, k = sqrt(-w * (2 + w)), b = y * w + x * k, a = x * w - y * k, D = sqrt(a * a + b * b);
return [
atan2(k * b, D * (1 + w)),
D ? -asin(k * a / D) : 0
];
};
var wiechel = function () {
return d3Geo.geoProjection(wiechelRaw)
.rotate([0, -90, 45])
.scale(124.75)
.clipAngle(180 - 1e-3);
};
function winkel3Raw(lambda, phi) {
var coordinates = aitoffRaw(lambda, phi);
return [
(coordinates[0] + lambda / halfPi) / 2,
(coordinates[1] + phi) / 2
];
}
winkel3Raw.invert = function (x, y) {
var lambda = x, phi = y, i = 25;
do {
var cosphi = cos(phi), sinphi = sin(phi), sin_2phi = sin(2 * phi), sin2phi = sinphi * sinphi, cos2phi = cosphi * cosphi, sinlambda = sin(lambda), coslambda_2 = cos(lambda / 2), sinlambda_2 = sin(lambda / 2), sin2lambda_2 = sinlambda_2 * sinlambda_2, C = 1 - cos2phi * coslambda_2 * coslambda_2, E = C ? acos(cosphi * coslambda_2) * sqrt(F = 1 / C) : F = 0, F, fx = 0.5 * (2 * E * cosphi * sinlambda_2 + lambda / halfPi) - x, fy = 0.5 * (E * sinphi + phi) - y, dxdlambda = 0.5 * F * (cos2phi * sin2lambda_2 + E * cosphi * coslambda_2 * sin2phi) + 0.5 / halfPi, dxdphi = F * (sinlambda * sin_2phi / 4 - E * sinphi * sinlambda_2), dydlambda = 0.125 * F * (sin_2phi * sinlambda_2 - E * sinphi * cos2phi * sinlambda), dydphi = 0.5 * F * (sin2phi * coslambda_2 + E * sin2lambda_2 * cosphi) + 0.5, denominator = dxdphi * dydlambda - dydphi * dxdlambda, dlambda = (fy * dxdphi - fx * dydphi) / denominator, dphi = (fx * dydlambda - fy * dxdlambda) / denominator;
lambda -= dlambda, phi -= dphi;
} while ((abs(dlambda) > epsilon || abs(dphi) > epsilon) && --i > 0);
return [lambda, phi];
};
var winkel3 = function () {
return d3Geo.geoProjection(winkel3Raw)
.scale(158.837);
};
exports.geoAiry = airy;
exports.geoAiryRaw = airyRaw;
exports.geoAitoff = aitoff;
exports.geoAitoffRaw = aitoffRaw;
exports.geoArmadillo = armadillo;
exports.geoArmadilloRaw = armadilloRaw;
exports.geoAugust = august;
exports.geoAugustRaw = augustRaw;
exports.geoBaker = baker;
exports.geoBakerRaw = bakerRaw;
exports.geoBerghaus = berghaus;
exports.geoBerghausRaw = berghausRaw;
exports.geoBoggs = boggs;
exports.geoBoggsRaw = boggsRaw;
exports.geoBonne = bonne;
exports.geoBonneRaw = bonneRaw;
exports.geoBottomley = bottomley;
exports.geoBottomleyRaw = bottomleyRaw;
exports.geoBromley = bromley;
exports.geoBromleyRaw = bromleyRaw;
exports.geoChamberlin = chamberlin;
exports.geoChamberlinRaw = chamberlinRaw;
exports.geoChamberlinAfrica = chamberlinAfrica;
exports.geoCollignon = collignon;
exports.geoCollignonRaw = collignonRaw;
exports.geoCraig = craig;
exports.geoCraigRaw = craigRaw;
exports.geoCraster = craster;
exports.geoCrasterRaw = crasterRaw;
exports.geoCylindricalEqualArea = cylindricalEqualArea;
exports.geoCylindricalEqualAreaRaw = cylindricalEqualAreaRaw;
exports.geoCylindricalStereographic = cylindricalStereographic;
exports.geoCylindricalStereographicRaw = cylindricalStereographicRaw;
exports.geoEckert1 = eckert1;
exports.geoEckert1Raw = eckert1Raw;
exports.geoEckert2 = eckert2;
exports.geoEckert2Raw = eckert2Raw;
exports.geoEckert3 = eckert3;
exports.geoEckert3Raw = eckert3Raw;
exports.geoEckert4 = eckert4;
exports.geoEckert4Raw = eckert4Raw;
exports.geoEckert5 = eckert5;
exports.geoEckert5Raw = eckert5Raw;
exports.geoEckert6 = eckert6;
exports.geoEckert6Raw = eckert6Raw;
exports.geoEisenlohr = eisenlohr;
exports.geoEisenlohrRaw = eisenlohrRaw;
exports.geoFahey = fahey;
exports.geoFaheyRaw = faheyRaw;
exports.geoFoucaut = foucaut;
exports.geoFoucautRaw = foucautRaw;
exports.geoGilbert = gilbert;
exports.geoGingery = gingery;
exports.geoGingeryRaw = gingeryRaw;
exports.geoGinzburg4 = ginzburg4;
exports.geoGinzburg4Raw = ginzburg4Raw;
exports.geoGinzburg5 = ginzburg5;
exports.geoGinzburg5Raw = ginzburg5Raw;
exports.geoGinzburg6 = ginzburg6;
exports.geoGinzburg6Raw = ginzburg6Raw;
exports.geoGinzburg8 = ginzburg8;
exports.geoGinzburg8Raw = ginzburg8Raw;
exports.geoGinzburg9 = ginzburg9;
exports.geoGinzburg9Raw = ginzburg9Raw;
exports.geoGringorten = gringorten;
exports.geoGringortenRaw = gringortenRaw;
exports.geoGuyou = guyou;
exports.geoGuyouRaw = guyouRaw;
exports.geoHammer = hammer;
exports.geoHammerRaw = hammerRaw;
exports.geoHammerRetroazimuthal = hammerRetroazimuthal;
exports.geoHammerRetroazimuthalRaw = hammerRetroazimuthalRaw;
exports.geoHealpix = healpix;
exports.geoHealpixRaw = healpixRaw;
exports.geoHill = hill;
exports.geoHillRaw = hillRaw;
exports.geoHomolosine = homolosine;
exports.geoHomolosineRaw = homolosineRaw;
exports.geoInterrupt = interrupt;
exports.geoInterruptedBoggs = boggs$1;
exports.geoInterruptedHomolosine = homolosine$1;
exports.geoInterruptedMollweide = mollweide$1;
exports.geoInterruptedMollweideHemispheres = mollweideHemispheres;
exports.geoInterruptedSinuMollweide = sinuMollweide$1;
exports.geoInterruptedSinusoidal = sinusoidal$1;
exports.geoKavrayskiy7 = kavrayskiy7;
exports.geoKavrayskiy7Raw = kavrayskiy7Raw;
exports.geoLagrange = lagrange;
exports.geoLagrangeRaw = lagrangeRaw;
exports.geoLarrivee = larrivee;
exports.geoLarriveeRaw = larriveeRaw;
exports.geoLaskowski = laskowski;
exports.geoLaskowskiRaw = laskowskiRaw;
exports.geoLittrow = littrow;
exports.geoLittrowRaw = littrowRaw;
exports.geoLoximuthal = loximuthal;
exports.geoLoximuthalRaw = loximuthalRaw;
exports.geoMiller = miller;
exports.geoMillerRaw = millerRaw;
exports.geoModifiedStereographic = modifiedStereographic;
exports.geoModifiedStereographicRaw = modifiedStereographicRaw;
exports.geoModifiedStereographicAlaska = modifiedStereographicAlaska;
exports.geoModifiedStereographicGs48 = modifiedStereographicGs48;
exports.geoModifiedStereographicGs50 = modifiedStereographicGs50;
exports.geoModifiedStereographicMiller = modifiedStereographicMiller;
exports.geoModifiedStereographicLee = modifiedStereographicLee;
exports.geoMollweide = mollweide;
exports.geoMollweideRaw = mollweideRaw;
exports.geoMtFlatPolarParabolic = mtFlatPolarParabolic;
exports.geoMtFlatPolarParabolicRaw = mtFlatPolarParabolicRaw;
exports.geoMtFlatPolarQuartic = mtFlatPolarQuartic;
exports.geoMtFlatPolarQuarticRaw = mtFlatPolarQuarticRaw;
exports.geoMtFlatPolarSinusoidal = mtFlatPolarSinusoidal;
exports.geoMtFlatPolarSinusoidalRaw = mtFlatPolarSinusoidalRaw;
exports.geoNaturalEarth = naturalEarth;
exports.geoNaturalEarthRaw = naturalEarthRaw;
exports.geoNaturalEarth2 = naturalEarth2;
exports.geoNaturalEarth2Raw = naturalEarth2Raw;
exports.geoNellHammer = nellHammer;
exports.geoNellHammerRaw = nellHammerRaw;
exports.geoPatterson = patterson;
exports.geoPattersonRaw = pattersonRaw;
exports.geoPolyconic = polyconic;
exports.geoPolyconicRaw = polyconicRaw;
exports.geoPolyhedral = polyhedral;
exports.geoPolyhedralButterfly = butterfly;
exports.geoPolyhedralCollignon = collignon$1;
exports.geoPolyhedralWaterman = waterman;
exports.geoProject = index;
exports.geoGringortenQuincuncial = gringorten$1;
exports.geoPeirceQuincuncial = peirce;
exports.geoPierceQuincuncial = peirce;
exports.geoQuantize = quantize;
exports.geoQuincuncial = quincuncial;
exports.geoRectangularPolyconic = rectangularPolyconic;
exports.geoRectangularPolyconicRaw = rectangularPolyconicRaw;
exports.geoRobinson = robinson;
exports.geoRobinsonRaw = robinsonRaw;
exports.geoSatellite = satellite;
exports.geoSatelliteRaw = satelliteRaw;
exports.geoSinuMollweide = sinuMollweide;
exports.geoSinuMollweideRaw = sinuMollweideRaw;
exports.geoSinusoidal = sinusoidal;
exports.geoSinusoidalRaw = sinusoidalRaw;
exports.geoStitch = stitch;
exports.geoTimes = times;
exports.geoTimesRaw = timesRaw;
exports.geoTwoPointAzimuthal = twoPointAzimuthal;
exports.geoTwoPointAzimuthalRaw = twoPointAzimuthalRaw;
exports.geoTwoPointAzimuthalUsa = twoPointAzimuthalUsa;
exports.geoTwoPointEquidistant = twoPointEquidistant;
exports.geoTwoPointEquidistantRaw = twoPointEquidistantRaw;
exports.geoTwoPointEquidistantUsa = twoPointEquidistantUsa;
exports.geoVanDerGrinten = vanDerGrinten;
exports.geoVanDerGrintenRaw = vanDerGrintenRaw;
exports.geoVanDerGrinten2 = vanDerGrinten2;
exports.geoVanDerGrinten2Raw = vanDerGrinten2Raw;
exports.geoVanDerGrinten3 = vanDerGrinten3;
exports.geoVanDerGrinten3Raw = vanDerGrinten3Raw;
exports.geoVanDerGrinten4 = vanDerGrinten4;
exports.geoVanDerGrinten4Raw = vanDerGrinten4Raw;
exports.geoWagner4 = wagner4;
exports.geoWagner4Raw = wagner4Raw;
exports.geoWagner6 = wagner6;
exports.geoWagner6Raw = wagner6Raw;
exports.geoWagner7 = wagner7;
exports.geoWagner7Raw = wagner7Raw;
exports.geoWiechel = wiechel;
exports.geoWiechelRaw = wiechelRaw;
exports.geoWinkel3 = winkel3;
exports.geoWinkel3Raw = winkel3Raw;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/_d3-geo@1.12.1@d3-geo/dist/d3-geo.js":
/*!***********************************************************!*\
!*** ./node_modules/_d3-geo@1.12.1@d3-geo/dist/d3-geo.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-geo/ v1.12.1 Copyright 2020 Mike Bostock
(function (global, factory) {
true ? factory(exports, __webpack_require__(/*! d3-array */ "./node_modules/_d3-array@1.2.4@d3-array/dist/d3-array.js")) :
undefined;
}(this, (function (exports, d3Array) {
'use strict';
// 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)
// 305363 (1997).
// Code adapted from GeographicLib by Charles F. F. Karney,
// http://geographiclib.sourceforge.net/
function adder() {
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);
}
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 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;
}
function noop() { }
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();
}
function geoStream(object, stream) {
if (object && streamObjectType.hasOwnProperty(object.type)) {
streamObjectType[object.type](object, stream);
}
else {
streamGeometry(object, stream);
}
}
var areaRingSum = adder();
var areaSum = adder(), lambda00, phi00, lambda0, cosPhi0, sinPhi0;
var areaStream = {
point: noop,
lineStart: noop,
lineEnd: noop,
polygonStart: function () {
areaRingSum.reset();
areaStream.lineStart = areaRingStart;
areaStream.lineEnd = areaRingEnd;
},
polygonEnd: function () {
var areaRing = +areaRingSum;
areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);
this.lineStart = this.lineEnd = this.point = noop;
},
sphere: function () {
areaSum.add(tau);
}
};
function areaRingStart() {
areaStream.point = areaPointFirst;
}
function areaRingEnd() {
areaPoint(lambda00, phi00);
}
function areaPointFirst(lambda, phi) {
areaStream.point = areaPoint;
lambda00 = lambda, phi00 = phi;
lambda *= radians, phi *= radians;
lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);
}
function areaPoint(lambda, phi) {
lambda *= radians, phi *= radians;
phi = phi / 2 + 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 Cagnolis
// theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).
var dLambda = lambda - lambda0, sdLambda = dLambda >= 0 ? 1 : -1, adLambda = sdLambda * dLambda, cosPhi = cos(phi), sinPhi = sin(phi), k = sinPhi0 * sinPhi, u = cosPhi0 * cosPhi + k * cos(adLambda), v = k * sdLambda * sin(adLambda);
areaRingSum.add(atan2(v, u));
// Advance the previous points.
lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
}
function area(object) {
areaSum.reset();
geoStream(object, areaStream);
return areaSum * 2;
}
function spherical(cartesian) {
return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];
}
function cartesian(spherical) {
var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);
return [cosPhi * cos(lambda), cosPhi * sin(lambda), 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 = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
d[0] /= l, d[1] /= l, d[2] /= l;
}
var lambda0$1, phi0, lambda1, phi1, // bounds
lambda2, // previous lambda-coordinate
lambda00$1, phi00$1, // first point
p0, // previous 3D point
deltaSum = adder(), ranges, range;
var boundsStream = {
point: boundsPoint,
lineStart: boundsLineStart,
lineEnd: boundsLineEnd,
polygonStart: function () {
boundsStream.point = boundsRingPoint;
boundsStream.lineStart = boundsRingStart;
boundsStream.lineEnd = boundsRingEnd;
deltaSum.reset();
areaStream.polygonStart();
},
polygonEnd: function () {
areaStream.polygonEnd();
boundsStream.point = boundsPoint;
boundsStream.lineStart = boundsLineStart;
boundsStream.lineEnd = boundsLineEnd;
if (areaRingSum < 0)
lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
else if (deltaSum > epsilon)
phi1 = 90;
else if (deltaSum < -epsilon)
phi0 = -90;
range[0] = lambda0$1, range[1] = lambda1;
},
sphere: function () {
lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
}
};
function boundsPoint(lambda, phi) {
ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]);
if (phi < phi0)
phi0 = phi;
if (phi > phi1)
phi1 = phi;
}
function linePoint(lambda, phi) {
var p = cartesian([lambda * radians, phi * radians]);
if (p0) {
var normal = cartesianCross(p0, p), equatorial = [normal[1], -normal[0], 0], inflection = cartesianCross(equatorial, normal);
cartesianNormalizeInPlace(inflection);
inflection = spherical(inflection);
var delta = lambda - lambda2, sign = delta > 0 ? 1 : -1, lambdai = inflection[0] * degrees * sign, phii, antimeridian = abs(delta) > 180;
if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {
phii = inflection[1] * degrees;
if (phii > phi1)
phi1 = phii;
}
else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {
phii = -inflection[1] * 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$1, lambda) > angle(lambda0$1, lambda1))
lambda1 = lambda;
}
else {
if (angle(lambda, lambda1) > angle(lambda0$1, lambda1))
lambda0$1 = lambda;
}
}
else {
if (lambda1 >= lambda0$1) {
if (lambda < lambda0$1)
lambda0$1 = lambda;
if (lambda > lambda1)
lambda1 = lambda;
}
else {
if (lambda > lambda2) {
if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1))
lambda1 = lambda;
}
else {
if (angle(lambda, lambda1) > angle(lambda0$1, lambda1))
lambda0$1 = lambda;
}
}
}
}
else {
ranges.push(range = [lambda0$1 = 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$1, range[1] = lambda1;
boundsStream.point = boundsPoint;
p0 = null;
}
function boundsRingPoint(lambda, phi) {
if (p0) {
var delta = lambda - lambda2;
deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
}
else {
lambda00$1 = lambda, phi00$1 = phi;
}
areaStream.point(lambda, phi);
linePoint(lambda, phi);
}
function boundsRingStart() {
areaStream.lineStart();
}
function boundsRingEnd() {
boundsRingPoint(lambda00$1, phi00$1);
areaStream.lineEnd();
if (abs(deltaSum) > epsilon)
lambda0$1 = -(lambda1 = 180);
range[0] = lambda0$1, 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;
}
function bounds(feature) {
var i, n, a, b, merged, deltaMax, delta;
phi1 = lambda1 = -(lambda0$1 = phi0 = Infinity);
ranges = [];
geoStream(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$1 = b[0], lambda1 = a[1];
}
}
ranges = range = null;
return lambda0$1 === Infinity || phi0 === Infinity
? [[NaN, NaN], [NaN, NaN]]
: [[lambda0$1, phi0], [lambda1, phi1]];
}
var W0, W1, X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2, lambda00$2, phi00$2, // first point
x0, y0, z0; // previous point
var centroidStream = {
sphere: noop,
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 *= radians, phi *= radians;
var cosPhi = cos(phi);
centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), 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 *= radians, phi *= radians;
var cosPhi = cos(phi);
x0 = cosPhi * cos(lambda);
y0 = cosPhi * sin(lambda);
z0 = sin(phi);
centroidStream.point = centroidLinePoint;
centroidPointCartesian(x0, y0, z0);
}
function centroidLinePoint(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos(phi), x = cosPhi * cos(lambda), y = cosPhi * sin(lambda), z = sin(phi), w = atan2(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$2, phi00$2);
centroidStream.point = centroidPoint;
}
function centroidRingPointFirst(lambda, phi) {
lambda00$2 = lambda, phi00$2 = phi;
lambda *= radians, phi *= radians;
centroidStream.point = centroidRingPoint;
var cosPhi = cos(phi);
x0 = cosPhi * cos(lambda);
y0 = cosPhi * sin(lambda);
z0 = sin(phi);
centroidPointCartesian(x0, y0, z0);
}
function centroidRingPoint(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos(phi), x = cosPhi * cos(lambda), y = cosPhi * sin(lambda), z = sin(phi), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = sqrt(cx * cx + cy * cy + cz * cz), w = 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);
}
function centroid(object) {
W0 = W1 =
X0 = Y0 = Z0 =
X1 = Y1 = Z1 =
X2 = Y2 = Z2 = 0;
geoStream(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 < epsilon2) {
x = X1, y = Y1, z = Z1;
// If the feature has zero length, fall back to arithmetic mean of point vectors.
if (W1 < 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 < epsilon2)
return [NaN, NaN];
}
return [atan2(y, x) * degrees, asin(z / sqrt(m)) * degrees];
}
function constant(x) {
return function () {
return x;
};
}
function compose(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;
}
function rotationIdentity(lambda, phi) {
return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi];
}
rotationIdentity.invert = rotationIdentity;
function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))
: rotationLambda(deltaLambda))
: (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)
: rotationIdentity);
}
function forwardRotationLambda(deltaLambda) {
return function (lambda, phi) {
return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];
};
}
function rotationLambda(deltaLambda) {
var rotation = forwardRotationLambda(deltaLambda);
rotation.invert = forwardRotationLambda(-deltaLambda);
return rotation;
}
function rotationPhiGamma(deltaPhi, deltaGamma) {
var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
function rotation(lambda, phi) {
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaPhi + x * sinDeltaPhi;
return [
atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),
asin(k * cosDeltaGamma + y * sinDeltaGamma)
];
}
rotation.invert = function (lambda, phi) {
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaGamma - y * sinDeltaGamma;
return [
atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),
asin(k * cosDeltaPhi - x * sinDeltaPhi)
];
};
return rotation;
}
function rotation(rotate) {
rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
function forward(coordinates) {
coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
}
forward.invert = function (coordinates) {
coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
};
return forward;
}
// 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 = cos(radius), sinRadius = sin(radius), step = direction * delta;
if (t0 == null) {
t0 = radius + direction * tau;
t1 = radius - step / 2;
}
else {
t0 = circleRadius(cosRadius, t0);
t1 = circleRadius(cosRadius, t1);
if (direction > 0 ? t0 < t1 : t0 > t1)
t0 += direction * tau;
}
for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {
point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * 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 = cartesian(point), point[0] -= cosRadius;
cartesianNormalizeInPlace(point);
var radius = acos(-point[1]);
return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
}
function circle() {
var center = constant([0, 0]), radius = constant(90), precision = constant(6), ring, rotate, stream = { point: point };
function point(x, y) {
ring.push(x = rotate(x, y));
x[0] *= degrees, x[1] *= degrees;
}
function circle() {
var c = center.apply(this, arguments), r = radius.apply(this, arguments) * radians, p = precision.apply(this, arguments) * radians;
ring = [];
rotate = rotateRadians(-c[0] * radians, -c[1] * 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" ? _ : constant([+_[0], +_[1]]), circle) : center;
};
circle.radius = function (_) {
return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), circle) : radius;
};
circle.precision = function (_) {
return arguments.length ? (precision = typeof _ === "function" ? _ : constant(+_), circle) : precision;
};
return circle;
}
function clipBuffer() {
var lines = [], line;
return {
point: function (x, y, m) {
line.push([x, y, m]);
},
lineStart: function () {
lines.push(line = []);
},
lineEnd: noop,
rejoin: function () {
if (lines.length > 1)
lines.push(lines.pop().concat(lines.shift()));
},
result: function () {
var result = lines;
lines = [];
line = null;
return result;
}
};
}
function pointEqual(a, b) {
return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;
}
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.
function clipRejoin(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 (pointEqual(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 * 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;
}
var sum = adder();
function longitude(point) {
if (abs(point[0]) <= pi)
return point[0];
else
return sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);
}
function polygonContains(polygon, point) {
var lambda = longitude(point), phi = point[1], sinPhi = sin(phi), normal = [sin(lambda), -cos(lambda), 0], angle = 0, winding = 0;
sum.reset();
if (sinPhi === 1)
phi = halfPi + epsilon;
else if (sinPhi === -1)
phi = -halfPi - 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 + quarterPi, sinPhi0 = sin(phi0), cosPhi0 = 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 + quarterPi, sinPhi1 = sin(phi1), cosPhi1 = cos(phi1), delta = lambda1 - lambda0, sign = delta >= 0 ? 1 : -1, absDelta = sign * delta, antimeridian = absDelta > pi, k = sinPhi0 * sinPhi1;
sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));
angle += antimeridian ? delta + sign * tau : delta;
// Are the longitudes either side of the points meridian (lambda),
// and are the latitudes smaller than the parallel (phi)?
if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {
var arc = cartesianCross(cartesian(point0), cartesian(point1));
cartesianNormalizeInPlace(arc);
var intersection = cartesianCross(normal, arc);
cartesianNormalizeInPlace(intersection);
var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * 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 < -epsilon || angle < epsilon && sum < -epsilon) ^ (winding & 1);
}
function clip(pointVisible, clipLine, interpolate, start) {
return function (sink) {
var line = clipLine(sink), ringBuffer = clipBuffer(), 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 = d3Array.merge(segments);
var startInside = polygonContains(polygon, start);
if (segments.length) {
if (!polygonStarted)
sink.polygonStart(), polygonStarted = true;
clipRejoin(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] - halfPi - epsilon : halfPi - a[1])
- ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);
}
var clipAntimeridian = clip(function () { return true; }, clipAntimeridianLine, clipAntimeridianInterpolate, [-pi, -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 ? pi : -pi, delta = abs(lambda1 - lambda0);
if (abs(delta - pi) < epsilon) { // line crosses a pole
stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);
stream.point(sign0, phi0);
stream.lineEnd();
stream.lineStart();
stream.point(sign1, phi0);
stream.point(lambda1, phi0);
clean = 0;
}
else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian
if (abs(lambda0 - sign0) < epsilon)
lambda0 -= sign0 * epsilon; // handle degeneracies
if (abs(lambda1 - sign1) < epsilon)
lambda1 -= sign1 * 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 = sin(lambda0 - lambda1);
return abs(sinLambda0Lambda1) > epsilon
? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)
- sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))
/ (cosPhi0 * cosPhi1 * sinLambda0Lambda1))
: (phi0 + phi1) / 2;
}
function clipAntimeridianInterpolate(from, to, direction, stream) {
var phi;
if (from == null) {
phi = direction * halfPi;
stream.point(-pi, phi);
stream.point(0, phi);
stream.point(pi, phi);
stream.point(pi, 0);
stream.point(pi, -phi);
stream.point(0, -phi);
stream.point(-pi, -phi);
stream.point(-pi, 0);
stream.point(-pi, phi);
}
else if (abs(from[0] - to[0]) > epsilon) {
var lambda = from[0] < to[0] ? pi : -pi;
phi = direction * lambda / 2;
stream.point(-lambda, phi);
stream.point(0, phi);
stream.point(lambda, phi);
}
else {
stream.point(to[0], to[1]);
}
}
function clipCircle(radius) {
var cr = cos(radius), delta = 6 * radians, smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case
function interpolate(from, to, direction, stream) {
circleStream(stream, radius, delta, direction, from, to);
}
function visible(lambda, phi) {
return cos(lambda) * 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 ? pi : -pi), phi) : 0;
if (!point0 && (v00 = v0 = v))
stream.lineStart();
if (v !== v0) {
point2 = intersect(point0, point1);
if (!point2 || pointEqual(point0, point2) || pointEqual(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 || !pointEqual(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 = cartesian(a), pb = 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 = cartesianCross(pa, pb), n2n2 = 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 = cartesianCross(n1, n2), A = cartesianScale(n1, c1), B = cartesianScale(n2, c2);
cartesianAddInPlace(A, B);
// Solve |p(t)|^2 = 1.
var u = n1xn2, w = cartesianDot(A, u), uu = cartesianDot(u, u), t2 = w * w - uu * (cartesianDot(A, A) - 1);
if (t2 < 0)
return;
var t = sqrt(t2), q = cartesianScale(u, (-w - t) / uu);
cartesianAddInPlace(q, A);
q = 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 = abs(delta - pi) < epsilon, meridian = polar || delta < 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] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)
: phi0 <= q[1] && q[1] <= phi1
: delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {
var q1 = cartesianScale(u, (-w + t) / uu);
cartesianAddInPlace(q1, A);
return [q, 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 : 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 clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
}
function clipLine(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;
}
var clipMax = 1e9, clipMin = -clipMax;
// TODO Use d3-polygons 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 abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3
: abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1
: abs(p[1] - y0) < 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 = clipBuffer(), 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 = d3Array.merge(segments)).length;
if (cleanInside || visible) {
stream.polygonStart();
if (cleanInside) {
stream.lineStart();
interpolate(null, null, 1, stream);
stream.lineEnd();
}
if (visible) {
clipRejoin(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 (clipLine(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;
};
}
function extent() {
var x0 = 0, y0 = 0, x1 = 960, y1 = 500, cache, cacheStream, clip;
return clip = {
stream: function (stream) {
return cache && cacheStream === stream ? cache : cache = clipRectangle(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]];
}
};
}
var lengthSum = adder(), lambda0$2, sinPhi0$1, cosPhi0$1;
var lengthStream = {
sphere: noop,
point: noop,
lineStart: lengthLineStart,
lineEnd: noop,
polygonStart: noop,
polygonEnd: noop
};
function lengthLineStart() {
lengthStream.point = lengthPointFirst;
lengthStream.lineEnd = lengthLineEnd;
}
function lengthLineEnd() {
lengthStream.point = lengthStream.lineEnd = noop;
}
function lengthPointFirst(lambda, phi) {
lambda *= radians, phi *= radians;
lambda0$2 = lambda, sinPhi0$1 = sin(phi), cosPhi0$1 = cos(phi);
lengthStream.point = lengthPoint;
}
function lengthPoint(lambda, phi) {
lambda *= radians, phi *= radians;
var sinPhi = sin(phi), cosPhi = cos(phi), delta = abs(lambda - lambda0$2), cosDelta = cos(delta), sinDelta = sin(delta), x = cosPhi * sinDelta, y = cosPhi0$1 * sinPhi - sinPhi0$1 * cosPhi * cosDelta, z = sinPhi0$1 * sinPhi + cosPhi0$1 * cosPhi * cosDelta;
lengthSum.add(atan2(sqrt(x * x + y * y), z));
lambda0$2 = lambda, sinPhi0$1 = sinPhi, cosPhi0$1 = cosPhi;
}
function length(object) {
lengthSum.reset();
geoStream(object, lengthStream);
return +lengthSum;
}
var coordinates = [null, null], object = { type: "LineString", coordinates: coordinates };
function distance(a, b) {
coordinates[0] = a;
coordinates[1] = b;
return length(object);
}
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 distance(coordinates, point) === 0;
}
function containsLine(coordinates, point) {
var ao, bo, ab;
for (var i = 0, n = coordinates.length; i < n; i++) {
bo = distance(coordinates[i], point);
if (bo === 0)
return true;
if (i > 0) {
ab = distance(coordinates[i], coordinates[i - 1]);
if (ab > 0 &&
ao <= ab &&
bo <= ab &&
(ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < epsilon2 * ab)
return true;
}
ao = bo;
}
return false;
}
function containsPolygon(coordinates, point) {
return !!polygonContains(coordinates.map(ringRadians), pointRadians(point));
}
function ringRadians(ring) {
return ring = ring.map(pointRadians), ring.pop(), ring;
}
function pointRadians(point) {
return [point[0] * radians, point[1] * radians];
}
function contains(object, point) {
return (object && containsObjectType.hasOwnProperty(object.type)
? containsObjectType[object.type]
: containsGeometry)(object, point);
}
function graticuleX(y0, y1, dy) {
var y = d3Array.range(y0, y1 - epsilon, dy).concat(y1);
return function (x) { return y.map(function (y) { return [x, y]; }); };
}
function graticuleY(x0, x1, dx) {
var x = d3Array.range(x0, x1 - 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 d3Array.range(ceil(X0 / DX) * DX, X1, DX).map(X)
.concat(d3Array.range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))
.concat(d3Array.range(ceil(x0 / dx) * dx, x1, dx).filter(function (x) { return abs(x % DX) > epsilon; }).map(x))
.concat(d3Array.range(ceil(y0 / dy) * dy, y1, dy).filter(function (y) { return abs(y % DY) > 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 + epsilon], [180, 90 - epsilon]])
.extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);
}
function graticule10() {
return graticule()();
}
function interpolate(a, b) {
var x0 = a[0] * radians, y0 = a[1] * radians, x1 = b[0] * radians, y1 = b[1] * radians, cy0 = cos(y0), sy0 = sin(y0), cy1 = cos(y1), sy1 = sin(y1), kx0 = cy0 * cos(x0), ky0 = cy0 * sin(x0), kx1 = cy1 * cos(x1), ky1 = cy1 * sin(x1), d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))), k = sin(d);
var interpolate = d ? function (t) {
var B = sin(t *= d) / k, A = sin(d - t) / k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
return [
atan2(y, x) * degrees,
atan2(z, sqrt(x * x + y * y)) * degrees
];
} : function () {
return [x0 * degrees, y0 * degrees];
};
interpolate.distance = d;
return interpolate;
}
function identity(x) {
return x;
}
var areaSum$1 = adder(), areaRingSum$1 = adder(), x00, y00, x0$1, y0$1;
var areaStream$1 = {
point: noop,
lineStart: noop,
lineEnd: noop,
polygonStart: function () {
areaStream$1.lineStart = areaRingStart$1;
areaStream$1.lineEnd = areaRingEnd$1;
},
polygonEnd: function () {
areaStream$1.lineStart = areaStream$1.lineEnd = areaStream$1.point = noop;
areaSum$1.add(abs(areaRingSum$1));
areaRingSum$1.reset();
},
result: function () {
var area = areaSum$1 / 2;
areaSum$1.reset();
return area;
}
};
function areaRingStart$1() {
areaStream$1.point = areaPointFirst$1;
}
function areaPointFirst$1(x, y) {
areaStream$1.point = areaPoint$1;
x00 = x0$1 = x, y00 = y0$1 = y;
}
function areaPoint$1(x, y) {
areaRingSum$1.add(y0$1 * x - x0$1 * y);
x0$1 = x, y0$1 = y;
}
function areaRingEnd$1() {
areaPoint$1(x00, y00);
}
var x0$2 = Infinity, y0$2 = x0$2, x1 = -x0$2, y1 = x1;
var boundsStream$1 = {
point: boundsPoint$1,
lineStart: noop,
lineEnd: noop,
polygonStart: noop,
polygonEnd: noop,
result: function () {
var bounds = [[x0$2, y0$2], [x1, y1]];
x1 = y1 = -(y0$2 = x0$2 = Infinity);
return bounds;
}
};
function boundsPoint$1(x, y) {
if (x < x0$2)
x0$2 = x;
if (x > x1)
x1 = x;
if (y < y0$2)
y0$2 = y;
if (y > y1)
y1 = y;
}
// TODO Enforce positive area for exterior, negative area for interior?
var X0$1 = 0, Y0$1 = 0, Z0$1 = 0, X1$1 = 0, Y1$1 = 0, Z1$1 = 0, X2$1 = 0, Y2$1 = 0, Z2$1 = 0, x00$1, y00$1, x0$3, y0$3;
var centroidStream$1 = {
point: centroidPoint$1,
lineStart: centroidLineStart$1,
lineEnd: centroidLineEnd$1,
polygonStart: function () {
centroidStream$1.lineStart = centroidRingStart$1;
centroidStream$1.lineEnd = centroidRingEnd$1;
},
polygonEnd: function () {
centroidStream$1.point = centroidPoint$1;
centroidStream$1.lineStart = centroidLineStart$1;
centroidStream$1.lineEnd = centroidLineEnd$1;
},
result: function () {
var centroid = Z2$1 ? [X2$1 / Z2$1, Y2$1 / Z2$1]
: Z1$1 ? [X1$1 / Z1$1, Y1$1 / Z1$1]
: Z0$1 ? [X0$1 / Z0$1, Y0$1 / Z0$1]
: [NaN, NaN];
X0$1 = Y0$1 = Z0$1 =
X1$1 = Y1$1 = Z1$1 =
X2$1 = Y2$1 = Z2$1 = 0;
return centroid;
}
};
function centroidPoint$1(x, y) {
X0$1 += x;
Y0$1 += y;
++Z0$1;
}
function centroidLineStart$1() {
centroidStream$1.point = centroidPointFirstLine;
}
function centroidPointFirstLine(x, y) {
centroidStream$1.point = centroidPointLine;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
function centroidPointLine(x, y) {
var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy);
X1$1 += z * (x0$3 + x) / 2;
Y1$1 += z * (y0$3 + y) / 2;
Z1$1 += z;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
function centroidLineEnd$1() {
centroidStream$1.point = centroidPoint$1;
}
function centroidRingStart$1() {
centroidStream$1.point = centroidPointFirstRing;
}
function centroidRingEnd$1() {
centroidPointRing(x00$1, y00$1);
}
function centroidPointFirstRing(x, y) {
centroidStream$1.point = centroidPointRing;
centroidPoint$1(x00$1 = x0$3 = x, y00$1 = y0$3 = y);
}
function centroidPointRing(x, y) {
var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy);
X1$1 += z * (x0$3 + x) / 2;
Y1$1 += z * (y0$3 + y) / 2;
Z1$1 += z;
z = y0$3 * x - x0$3 * y;
X2$1 += z * (x0$3 + x);
Y2$1 += z * (y0$3 + y);
Z2$1 += z * 3;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
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, tau);
break;
}
}
},
result: noop
};
var lengthSum$1 = adder(), lengthRing, x00$2, y00$2, x0$4, y0$4;
var lengthStream$1 = {
point: noop,
lineStart: function () {
lengthStream$1.point = lengthPointFirst$1;
},
lineEnd: function () {
if (lengthRing)
lengthPoint$1(x00$2, y00$2);
lengthStream$1.point = noop;
},
polygonStart: function () {
lengthRing = true;
},
polygonEnd: function () {
lengthRing = null;
},
result: function () {
var length = +lengthSum$1;
lengthSum$1.reset();
return length;
}
};
function lengthPointFirst$1(x, y) {
lengthStream$1.point = lengthPoint$1;
x00$2 = x0$4 = x, y00$2 = y0$4 = y;
}
function lengthPoint$1(x, y) {
x0$4 -= x, y0$4 -= y;
lengthSum$1.add(sqrt(x0$4 * x0$4 + y0$4 * y0$4));
x0$4 = x, y0$4 = y;
}
function PathString() {
this._string = [];
}
PathString.prototype = {
_radius: 4.5,
_circle: circle$1(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$1(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$1(radius) {
return "m0," + radius
+ "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius
+ "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius
+ "z";
}
function index(projection, context) {
var pointRadius = 4.5, projectionStream, contextStream;
function path(object) {
if (object) {
if (typeof pointRadius === "function")
contextStream.pointRadius(+pointRadius.apply(this, arguments));
geoStream(object, projectionStream(contextStream));
}
return contextStream.result();
}
path.area = function (object) {
geoStream(object, projectionStream(areaStream$1));
return areaStream$1.result();
};
path.measure = function (object) {
geoStream(object, projectionStream(lengthStream$1));
return lengthStream$1.result();
};
path.bounds = function (object) {
geoStream(object, projectionStream(boundsStream$1));
return boundsStream$1.result();
};
path.centroid = function (object) {
geoStream(object, projectionStream(centroidStream$1));
return centroidStream$1.result();
};
path.projection = function (_) {
return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;
};
path.context = function (_) {
if (!arguments.length)
return context;
contextStream = _ == null ? (context = null, new PathString) : new PathContext(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);
}
function transform(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(); }
};
function fit(projection, fitBounds, object) {
var clip = projection.clipExtent && projection.clipExtent();
projection.scale(150).translate([0, 0]);
if (clip != null)
projection.clipExtent(null);
geoStream(object, projection.stream(boundsStream$1));
fitBounds(boundsStream$1.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);
}
var maxDepth = 16, // maximum depth of subdivision
cosMinDistance = cos(30 * radians); // cos(minimum angular distance)
function resample(project, delta2) {
return +delta2 ? resample$1(project, delta2) : resampleNone(project);
}
function resampleNone(project) {
return transformer({
point: function (x, y) {
x = project(x, y);
this.stream.point(x[0], x[1]);
}
});
}
function resample$1(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 = sqrt(a * a + b * b + c * c), phi2 = asin(c /= m), lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : 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
|| 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 = 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;
};
}
var transformRadians = transformer({
point: function (x, y) {
this.stream.point(x * radians, y * radians);
}
});
function transformRotate(rotate) {
return 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 = cos(alpha), sinAlpha = 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 = clipAntimeridian, // pre-clip angle
x0 = null, y0, x1, y1, postclip = identity, // post-clip extent
delta2 = 0.5, // precision
projectResample, projectTransform, projectRotateTransform, cache, cacheStream;
function projection(point) {
return projectRotateTransform(point[0] * radians, point[1] * radians);
}
function invert(point) {
point = projectRotateTransform.invert(point[0], point[1]);
return point && [point[0] * degrees, point[1] * 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 = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;
};
projection.clipExtent = function (_) {
return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(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 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
};
projection.rotate = function (_) {
return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
};
projection.angle = function (_) {
return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * 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 = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);
};
projection.fitExtent = function (extent, object) {
return fitExtent(projection, extent, object);
};
projection.fitSize = function (size, object) {
return fitSize(projection, size, object);
};
projection.fitWidth = function (width, object) {
return fitWidth(projection, width, object);
};
projection.fitHeight = function (height, object) {
return 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 = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
projectTransform = compose(project, transform);
projectRotateTransform = compose(rotate, projectTransform);
projectResample = resample(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();
};
}
function conicProjection(projectAt) {
var phi0 = 0, phi1 = pi / 3, m = projectionMutator(projectAt), p = m(phi0, phi1);
p.parallels = function (_) {
return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];
};
return p;
}
function cylindricalEqualAreaRaw(phi0) {
var cosPhi0 = cos(phi0);
function forward(lambda, phi) {
return [lambda * cosPhi0, sin(phi) / cosPhi0];
}
forward.invert = function (x, y) {
return [x / cosPhi0, asin(y * cosPhi0)];
};
return forward;
}
function conicEqualAreaRaw(y0, y1) {
var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;
// Are the parallels symmetrical around the Equator?
if (abs(n) < epsilon)
return cylindricalEqualAreaRaw(y0);
var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;
function project(x, y) {
var r = sqrt(c - 2 * n * sin(y)) / n;
return [r * sin(x *= n), r0 - r * cos(x)];
}
project.invert = function (x, y) {
var r0y = r0 - y, l = atan2(x, abs(r0y)) * sign(r0y);
if (r0y * n < 0)
l -= pi * sign(x) * sign(r0y);
return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];
};
return project;
}
function conicEqualArea() {
return conicProjection(conicEqualAreaRaw)
.scale(155.424)
.center([0, 33.6442]);
}
function albers() {
return conicEqualArea()
.parallels([29.5, 45.5])
.scale(1070)
.translate([480, 250])
.rotate([96, 0])
.center([-0.6, 38.7]);
}
// 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
function albersUsa() {
var cache, cacheStream, lower48 = albers(), lower48Point, alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338
hawaii = conicEqualArea().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 + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])
.stream(pointStream);
hawaiiPoint = hawaii
.translate([x - 0.205 * k, y + 0.212 * k])
.clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])
.stream(pointStream);
return reset();
};
albersUsa.fitExtent = function (extent, object) {
return fitExtent(albersUsa, extent, object);
};
albersUsa.fitSize = function (size, object) {
return fitSize(albersUsa, size, object);
};
albersUsa.fitWidth = function (width, object) {
return fitWidth(albersUsa, width, object);
};
albersUsa.fitHeight = function (height, object) {
return fitHeight(albersUsa, height, object);
};
function reset() {
cache = cacheStream = null;
return albersUsa;
}
return albersUsa.scale(1070);
}
function azimuthalRaw(scale) {
return function (x, y) {
var cx = cos(x), cy = cos(y), k = scale(cx * cy);
return [
k * cy * sin(x),
k * sin(y)
];
};
}
function azimuthalInvert(angle) {
return function (x, y) {
var z = sqrt(x * x + y * y), c = angle(z), sc = sin(c), cc = cos(c);
return [
atan2(x * sc, z * cc),
asin(z && y * sc / z)
];
};
}
var azimuthalEqualAreaRaw = azimuthalRaw(function (cxcy) {
return sqrt(2 / (1 + cxcy));
});
azimuthalEqualAreaRaw.invert = azimuthalInvert(function (z) {
return 2 * asin(z / 2);
});
function azimuthalEqualArea() {
return projection(azimuthalEqualAreaRaw)
.scale(124.75)
.clipAngle(180 - 1e-3);
}
var azimuthalEquidistantRaw = azimuthalRaw(function (c) {
return (c = acos(c)) && c / sin(c);
});
azimuthalEquidistantRaw.invert = azimuthalInvert(function (z) {
return z;
});
function azimuthalEquidistant() {
return projection(azimuthalEquidistantRaw)
.scale(79.4188)
.clipAngle(180 - 1e-3);
}
function mercatorRaw(lambda, phi) {
return [lambda, log(tan((halfPi + phi) / 2))];
}
mercatorRaw.invert = function (x, y) {
return [x, 2 * atan(exp(y)) - halfPi];
};
function mercator() {
return mercatorProjection(mercatorRaw)
.scale(961 / tau);
}
function mercatorProjection(project) {
var m = projection(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 = pi * scale(), t = m(rotation(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();
}
function tany(y) {
return tan((halfPi + y) / 2);
}
function conicConformalRaw(y0, y1) {
var cy0 = cos(y0), n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)), f = cy0 * pow(tany(y0), n) / n;
if (!n)
return mercatorRaw;
function project(x, y) {
if (f > 0) {
if (y < -halfPi + epsilon)
y = -halfPi + epsilon;
}
else {
if (y > halfPi - epsilon)
y = halfPi - epsilon;
}
var r = f / pow(tany(y), n);
return [r * sin(n * x), f - r * cos(n * x)];
}
project.invert = function (x, y) {
var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy), l = atan2(x, abs(fy)) * sign(fy);
if (fy * n < 0)
l -= pi * sign(x) * sign(fy);
return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];
};
return project;
}
function conicConformal() {
return conicProjection(conicConformalRaw)
.scale(109.5)
.parallels([30, 30]);
}
function equirectangularRaw(lambda, phi) {
return [lambda, phi];
}
equirectangularRaw.invert = equirectangularRaw;
function equirectangular() {
return projection(equirectangularRaw)
.scale(152.63);
}
function conicEquidistantRaw(y0, y1) {
var cy0 = cos(y0), n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0), g = cy0 / n + y0;
if (abs(n) < epsilon)
return equirectangularRaw;
function project(x, y) {
var gy = g - y, nx = n * x;
return [gy * sin(nx), g - gy * cos(nx)];
}
project.invert = function (x, y) {
var gy = g - y, l = atan2(x, abs(gy)) * sign(gy);
if (gy * n < 0)
l -= pi * sign(x) * sign(gy);
return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];
};
return project;
}
function conicEquidistant() {
return conicProjection(conicEquidistantRaw)
.scale(131.154)
.center([0, 13.9389]);
}
var A1 = 1.340264, A2 = -0.081106, A3 = 0.000893, A4 = 0.003796, M = sqrt(3) / 2, iterations = 12;
function equalEarthRaw(lambda, phi) {
var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;
return [
lambda * 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 (abs(delta) < epsilon2)
break;
}
return [
M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),
asin(sin(l) / M)
];
};
function equalEarth() {
return projection(equalEarthRaw)
.scale(177.158);
}
function gnomonicRaw(x, y) {
var cy = cos(y), k = cos(x) * cy;
return [cy * sin(x) / k, sin(y) / k];
}
gnomonicRaw.invert = azimuthalInvert(atan);
function gnomonic() {
return projection(gnomonicRaw)
.scale(144.049)
.clipAngle(60);
}
function identity$1() {
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 = transformer({
point: function (x, y) {
var p = projection([x, y]);
this.stream.point(p[0], p[1]);
}
}), postclip = identity, 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) : clipRectangle(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 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * 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 fitExtent(projection, extent, object);
};
projection.fitSize = function (size, object) {
return fitSize(projection, size, object);
};
projection.fitWidth = function (width, object) {
return fitWidth(projection, width, object);
};
projection.fitHeight = function (height, object) {
return fitHeight(projection, height, object);
};
return projection;
}
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 (abs(delta) > epsilon && --i > 0);
return [
x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),
phi
];
};
function naturalEarth1() {
return projection(naturalEarth1Raw)
.scale(175.295);
}
function orthographicRaw(x, y) {
return [cos(y) * sin(x), sin(y)];
}
orthographicRaw.invert = azimuthalInvert(asin);
function orthographic() {
return projection(orthographicRaw)
.scale(249.5)
.clipAngle(90 + epsilon);
}
function stereographicRaw(x, y) {
var cy = cos(y), k = 1 + cos(x) * cy;
return [cy * sin(x) / k, sin(y) / k];
}
stereographicRaw.invert = azimuthalInvert(function (z) {
return 2 * atan(z);
});
function stereographic() {
return projection(stereographicRaw)
.scale(250)
.clipAngle(142);
}
function transverseMercatorRaw(lambda, phi) {
return [log(tan((halfPi + phi) / 2)), -lambda];
}
transverseMercatorRaw.invert = function (x, y) {
return [-y, 2 * atan(exp(x)) - halfPi];
};
function transverseMercator() {
var m = 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);
}
exports.geoAlbers = albers;
exports.geoAlbersUsa = albersUsa;
exports.geoArea = area;
exports.geoAzimuthalEqualArea = azimuthalEqualArea;
exports.geoAzimuthalEqualAreaRaw = azimuthalEqualAreaRaw;
exports.geoAzimuthalEquidistant = azimuthalEquidistant;
exports.geoAzimuthalEquidistantRaw = azimuthalEquidistantRaw;
exports.geoBounds = bounds;
exports.geoCentroid = centroid;
exports.geoCircle = circle;
exports.geoClipAntimeridian = clipAntimeridian;
exports.geoClipCircle = clipCircle;
exports.geoClipExtent = extent;
exports.geoClipRectangle = clipRectangle;
exports.geoConicConformal = conicConformal;
exports.geoConicConformalRaw = conicConformalRaw;
exports.geoConicEqualArea = conicEqualArea;
exports.geoConicEqualAreaRaw = conicEqualAreaRaw;
exports.geoConicEquidistant = conicEquidistant;
exports.geoConicEquidistantRaw = conicEquidistantRaw;
exports.geoContains = contains;
exports.geoDistance = distance;
exports.geoEqualEarth = equalEarth;
exports.geoEqualEarthRaw = equalEarthRaw;
exports.geoEquirectangular = equirectangular;
exports.geoEquirectangularRaw = equirectangularRaw;
exports.geoGnomonic = gnomonic;
exports.geoGnomonicRaw = gnomonicRaw;
exports.geoGraticule = graticule;
exports.geoGraticule10 = graticule10;
exports.geoIdentity = identity$1;
exports.geoInterpolate = interpolate;
exports.geoLength = length;
exports.geoMercator = mercator;
exports.geoMercatorRaw = mercatorRaw;
exports.geoNaturalEarth1 = naturalEarth1;
exports.geoNaturalEarth1Raw = naturalEarth1Raw;
exports.geoOrthographic = orthographic;
exports.geoOrthographicRaw = orthographicRaw;
exports.geoPath = index;
exports.geoProjection = projection;
exports.geoProjectionMutator = projectionMutator;
exports.geoRotation = rotation;
exports.geoStereographic = stereographic;
exports.geoStereographicRaw = stereographicRaw;
exports.geoStream = geoStream;
exports.geoTransform = transform;
exports.geoTransverseMercator = transverseMercator;
exports.geoTransverseMercatorRaw = transverseMercatorRaw;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/_d3-geo@1.6.4@d3-geo/build/d3-geo.js":
/*!***********************************************************!*\
!*** ./node_modules/_d3-geo@1.6.4@d3-geo/build/d3-geo.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-geo/ Version 1.6.4. Copyright 2017 Mike Bostock.
(function (global, factory) {
true ? factory(exports, __webpack_require__(/*! d3-array */ "./node_modules/_d3-array@1.2.4@d3-array/dist/d3-array.js")) :
undefined;
}(this, (function (exports, d3Array) {
'use strict';
// 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)
// 305363 (1997).
// Code adapted from GeographicLib by Charles F. F. Karney,
// http://geographiclib.sourceforge.net/
var adder = 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);
}
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 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;
}
function noop() { }
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();
}
var geoStream = function (object, stream) {
if (object && streamObjectType.hasOwnProperty(object.type)) {
streamObjectType[object.type](object, stream);
}
else {
streamGeometry(object, stream);
}
};
var areaRingSum = adder();
var areaSum = adder();
var lambda00;
var phi00;
var lambda0;
var cosPhi0;
var sinPhi0;
var areaStream = {
point: noop,
lineStart: noop,
lineEnd: noop,
polygonStart: function () {
areaRingSum.reset();
areaStream.lineStart = areaRingStart;
areaStream.lineEnd = areaRingEnd;
},
polygonEnd: function () {
var areaRing = +areaRingSum;
areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);
this.lineStart = this.lineEnd = this.point = noop;
},
sphere: function () {
areaSum.add(tau);
}
};
function areaRingStart() {
areaStream.point = areaPointFirst;
}
function areaRingEnd() {
areaPoint(lambda00, phi00);
}
function areaPointFirst(lambda, phi) {
areaStream.point = areaPoint;
lambda00 = lambda, phi00 = phi;
lambda *= radians, phi *= radians;
lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);
}
function areaPoint(lambda, phi) {
lambda *= radians, phi *= radians;
phi = phi / 2 + 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 Cagnolis
// theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).
var dLambda = lambda - lambda0, sdLambda = dLambda >= 0 ? 1 : -1, adLambda = sdLambda * dLambda, cosPhi = cos(phi), sinPhi = sin(phi), k = sinPhi0 * sinPhi, u = cosPhi0 * cosPhi + k * cos(adLambda), v = k * sdLambda * sin(adLambda);
areaRingSum.add(atan2(v, u));
// Advance the previous points.
lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
}
var area = function (object) {
areaSum.reset();
geoStream(object, areaStream);
return areaSum * 2;
};
function spherical(cartesian) {
return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];
}
function cartesian(spherical) {
var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);
return [cosPhi * cos(lambda), cosPhi * sin(lambda), 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 = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
d[0] /= l, d[1] /= l, d[2] /= l;
}
var lambda0$1;
var phi0;
var lambda1;
var phi1;
var lambda2;
var lambda00$1;
var phi00$1;
var p0;
var deltaSum = adder();
var ranges;
var range$1;
var boundsStream = {
point: boundsPoint,
lineStart: boundsLineStart,
lineEnd: boundsLineEnd,
polygonStart: function () {
boundsStream.point = boundsRingPoint;
boundsStream.lineStart = boundsRingStart;
boundsStream.lineEnd = boundsRingEnd;
deltaSum.reset();
areaStream.polygonStart();
},
polygonEnd: function () {
areaStream.polygonEnd();
boundsStream.point = boundsPoint;
boundsStream.lineStart = boundsLineStart;
boundsStream.lineEnd = boundsLineEnd;
if (areaRingSum < 0)
lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
else if (deltaSum > epsilon)
phi1 = 90;
else if (deltaSum < -epsilon)
phi0 = -90;
range$1[0] = lambda0$1, range$1[1] = lambda1;
}
};
function boundsPoint(lambda, phi) {
ranges.push(range$1 = [lambda0$1 = lambda, lambda1 = lambda]);
if (phi < phi0)
phi0 = phi;
if (phi > phi1)
phi1 = phi;
}
function linePoint(lambda, phi) {
var p = cartesian([lambda * radians, phi * radians]);
if (p0) {
var normal = cartesianCross(p0, p), equatorial = [normal[1], -normal[0], 0], inflection = cartesianCross(equatorial, normal);
cartesianNormalizeInPlace(inflection);
inflection = spherical(inflection);
var delta = lambda - lambda2, sign$$1 = delta > 0 ? 1 : -1, lambdai = inflection[0] * degrees * sign$$1, phii, antimeridian = abs(delta) > 180;
if (antimeridian ^ (sign$$1 * lambda2 < lambdai && lambdai < sign$$1 * lambda)) {
phii = inflection[1] * degrees;
if (phii > phi1)
phi1 = phii;
}
else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign$$1 * lambda2 < lambdai && lambdai < sign$$1 * lambda)) {
phii = -inflection[1] * 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$1, lambda) > angle(lambda0$1, lambda1))
lambda1 = lambda;
}
else {
if (angle(lambda, lambda1) > angle(lambda0$1, lambda1))
lambda0$1 = lambda;
}
}
else {
if (lambda1 >= lambda0$1) {
if (lambda < lambda0$1)
lambda0$1 = lambda;
if (lambda > lambda1)
lambda1 = lambda;
}
else {
if (lambda > lambda2) {
if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1))
lambda1 = lambda;
}
else {
if (angle(lambda, lambda1) > angle(lambda0$1, lambda1))
lambda0$1 = lambda;
}
}
}
}
else {
ranges.push(range$1 = [lambda0$1 = 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$1[0] = lambda0$1, range$1[1] = lambda1;
boundsStream.point = boundsPoint;
p0 = null;
}
function boundsRingPoint(lambda, phi) {
if (p0) {
var delta = lambda - lambda2;
deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
}
else {
lambda00$1 = lambda, phi00$1 = phi;
}
areaStream.point(lambda, phi);
linePoint(lambda, phi);
}
function boundsRingStart() {
areaStream.lineStart();
}
function boundsRingEnd() {
boundsRingPoint(lambda00$1, phi00$1);
areaStream.lineEnd();
if (abs(deltaSum) > epsilon)
lambda0$1 = -(lambda1 = 180);
range$1[0] = lambda0$1, range$1[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$$1, x) {
return range$$1[0] <= range$$1[1] ? range$$1[0] <= x && x <= range$$1[1] : x < range$$1[0] || range$$1[1] < x;
}
var bounds = function (feature) {
var i, n, a, b, merged, deltaMax, delta;
phi1 = lambda1 = -(lambda0$1 = phi0 = Infinity);
ranges = [];
geoStream(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$1 = b[0], lambda1 = a[1];
}
}
ranges = range$1 = null;
return lambda0$1 === Infinity || phi0 === Infinity
? [[NaN, NaN], [NaN, NaN]]
: [[lambda0$1, phi0], [lambda1, phi1]];
};
var W0;
var W1;
var X0;
var Y0;
var Z0;
var X1;
var Y1;
var Z1;
var X2;
var Y2;
var Z2;
var lambda00$2;
var phi00$2;
var x0;
var y0;
var z0; // previous point
var centroidStream = {
sphere: noop,
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 *= radians, phi *= radians;
var cosPhi = cos(phi);
centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), 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 *= radians, phi *= radians;
var cosPhi = cos(phi);
x0 = cosPhi * cos(lambda);
y0 = cosPhi * sin(lambda);
z0 = sin(phi);
centroidStream.point = centroidLinePoint;
centroidPointCartesian(x0, y0, z0);
}
function centroidLinePoint(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos(phi), x = cosPhi * cos(lambda), y = cosPhi * sin(lambda), z = sin(phi), w = atan2(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$2, phi00$2);
centroidStream.point = centroidPoint;
}
function centroidRingPointFirst(lambda, phi) {
lambda00$2 = lambda, phi00$2 = phi;
lambda *= radians, phi *= radians;
centroidStream.point = centroidRingPoint;
var cosPhi = cos(phi);
x0 = cosPhi * cos(lambda);
y0 = cosPhi * sin(lambda);
z0 = sin(phi);
centroidPointCartesian(x0, y0, z0);
}
function centroidRingPoint(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos(phi), x = cosPhi * cos(lambda), y = cosPhi * sin(lambda), z = sin(phi), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = sqrt(cx * cx + cy * cy + cz * cz), w = 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);
}
var centroid = function (object) {
W0 = W1 =
X0 = Y0 = Z0 =
X1 = Y1 = Z1 =
X2 = Y2 = Z2 = 0;
geoStream(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 < epsilon2) {
x = X1, y = Y1, z = Z1;
// If the feature has zero length, fall back to arithmetic mean of point vectors.
if (W1 < 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 < epsilon2)
return [NaN, NaN];
}
return [atan2(y, x) * degrees, asin(z / sqrt(m)) * degrees];
};
var constant = function (x) {
return function () {
return x;
};
};
var compose = 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;
};
function rotationIdentity(lambda, phi) {
return [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];
}
rotationIdentity.invert = rotationIdentity;
function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))
: rotationLambda(deltaLambda))
: (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)
: rotationIdentity);
}
function forwardRotationLambda(deltaLambda) {
return function (lambda, phi) {
return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];
};
}
function rotationLambda(deltaLambda) {
var rotation = forwardRotationLambda(deltaLambda);
rotation.invert = forwardRotationLambda(-deltaLambda);
return rotation;
}
function rotationPhiGamma(deltaPhi, deltaGamma) {
var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
function rotation(lambda, phi) {
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaPhi + x * sinDeltaPhi;
return [
atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),
asin(k * cosDeltaGamma + y * sinDeltaGamma)
];
}
rotation.invert = function (lambda, phi) {
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaGamma - y * sinDeltaGamma;
return [
atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),
asin(k * cosDeltaPhi - x * sinDeltaPhi)
];
};
return rotation;
}
var rotation = function (rotate) {
rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
function forward(coordinates) {
coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
}
forward.invert = function (coordinates) {
coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
};
return forward;
};
// 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 = cos(radius), sinRadius = sin(radius), step = direction * delta;
if (t0 == null) {
t0 = radius + direction * tau;
t1 = radius - step / 2;
}
else {
t0 = circleRadius(cosRadius, t0);
t1 = circleRadius(cosRadius, t1);
if (direction > 0 ? t0 < t1 : t0 > t1)
t0 += direction * tau;
}
for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {
point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * 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 = cartesian(point), point[0] -= cosRadius;
cartesianNormalizeInPlace(point);
var radius = acos(-point[1]);
return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
}
var circle = function () {
var center = constant([0, 0]), radius = constant(90), precision = constant(6), ring, rotate, stream = { point: point };
function point(x, y) {
ring.push(x = rotate(x, y));
x[0] *= degrees, x[1] *= degrees;
}
function circle() {
var c = center.apply(this, arguments), r = radius.apply(this, arguments) * radians, p = precision.apply(this, arguments) * radians;
ring = [];
rotate = rotateRadians(-c[0] * radians, -c[1] * 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" ? _ : constant([+_[0], +_[1]]), circle) : center;
};
circle.radius = function (_) {
return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), circle) : radius;
};
circle.precision = function (_) {
return arguments.length ? (precision = typeof _ === "function" ? _ : constant(+_), circle) : precision;
};
return circle;
};
var clipBuffer = function () {
var lines = [], line;
return {
point: function (x, y) {
line.push([x, y]);
},
lineStart: function () {
lines.push(line = []);
},
lineEnd: noop,
rejoin: function () {
if (lines.length > 1)
lines.push(lines.pop().concat(lines.shift()));
},
result: function () {
var result = lines;
lines = [];
line = null;
return result;
}
};
};
var clipLine = 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;
};
var pointEqual = function (a, b) {
return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;
};
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.
var clipPolygon = 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 the first and last points of a segment are coincident, then treat as a
// closed ring. TODO if all rings are closed, then the winding order of the
// exterior ring should be checked.
if (pointEqual(p0, p1)) {
stream.lineStart();
for (i = 0; i < n; ++i)
stream.point((p0 = segment[i])[0], p0[1]);
stream.lineEnd();
return;
}
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;
}
var clipMax = 1e9;
var clipMin = -clipMax;
// TODO Use d3-polygons polygonContains here for the ring check?
// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?
function clipExtent(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 abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3
: abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1
: abs(p[1] - y0) < 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 = clipBuffer(), 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 = d3Array.merge(segments)).length;
if (cleanInside || visible) {
stream.polygonStart();
if (cleanInside) {
stream.lineStart();
interpolate(null, null, 1, stream);
stream.lineEnd();
}
if (visible) {
clipPolygon(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 (clipLine(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;
};
}
var extent = function () {
var x0 = 0, y0 = 0, x1 = 960, y1 = 500, cache, cacheStream, clip;
return clip = {
stream: function (stream) {
return cache && cacheStream === stream ? cache : cache = clipExtent(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]];
}
};
};
var sum = adder();
var polygonContains = function (polygon, point) {
var lambda = point[0], phi = point[1], normal = [sin(lambda), -cos(lambda), 0], angle = 0, winding = 0;
sum.reset();
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 = point0[0], phi0 = point0[1] / 2 + quarterPi, sinPhi0 = sin(phi0), cosPhi0 = cos(phi0);
for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {
var point1 = ring[j], lambda1 = point1[0], phi1 = point1[1] / 2 + quarterPi, sinPhi1 = sin(phi1), cosPhi1 = cos(phi1), delta = lambda1 - lambda0, sign$$1 = delta >= 0 ? 1 : -1, absDelta = sign$$1 * delta, antimeridian = absDelta > pi, k = sinPhi0 * sinPhi1;
sum.add(atan2(k * sign$$1 * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));
angle += antimeridian ? delta + sign$$1 * tau : delta;
// Are the longitudes either side of the points meridian (lambda),
// and are the latitudes smaller than the parallel (phi)?
if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {
var arc = cartesianCross(cartesian(point0), cartesian(point1));
cartesianNormalizeInPlace(arc);
var intersection = cartesianCross(normal, arc);
cartesianNormalizeInPlace(intersection);
var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * 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 < -epsilon || angle < epsilon && sum < -epsilon) ^ (winding & 1);
};
var lengthSum = adder();
var lambda0$2;
var sinPhi0$1;
var cosPhi0$1;
var lengthStream = {
sphere: noop,
point: noop,
lineStart: lengthLineStart,
lineEnd: noop,
polygonStart: noop,
polygonEnd: noop
};
function lengthLineStart() {
lengthStream.point = lengthPointFirst;
lengthStream.lineEnd = lengthLineEnd;
}
function lengthLineEnd() {
lengthStream.point = lengthStream.lineEnd = noop;
}
function lengthPointFirst(lambda, phi) {
lambda *= radians, phi *= radians;
lambda0$2 = lambda, sinPhi0$1 = sin(phi), cosPhi0$1 = cos(phi);
lengthStream.point = lengthPoint;
}
function lengthPoint(lambda, phi) {
lambda *= radians, phi *= radians;
var sinPhi = sin(phi), cosPhi = cos(phi), delta = abs(lambda - lambda0$2), cosDelta = cos(delta), sinDelta = sin(delta), x = cosPhi * sinDelta, y = cosPhi0$1 * sinPhi - sinPhi0$1 * cosPhi * cosDelta, z = sinPhi0$1 * sinPhi + cosPhi0$1 * cosPhi * cosDelta;
lengthSum.add(atan2(sqrt(x * x + y * y), z));
lambda0$2 = lambda, sinPhi0$1 = sinPhi, cosPhi0$1 = cosPhi;
}
var length = function (object) {
lengthSum.reset();
geoStream(object, lengthStream);
return +lengthSum;
};
var coordinates = [null, null];
var object = { type: "LineString", coordinates: coordinates };
var distance = function (a, b) {
coordinates[0] = a;
coordinates[1] = b;
return length(object);
};
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 distance(coordinates, point) === 0;
}
function containsLine(coordinates, point) {
var ab = distance(coordinates[0], coordinates[1]), ao = distance(coordinates[0], point), ob = distance(point, coordinates[1]);
return ao + ob <= ab + epsilon;
}
function containsPolygon(coordinates, point) {
return !!polygonContains(coordinates.map(ringRadians), pointRadians(point));
}
function ringRadians(ring) {
return ring = ring.map(pointRadians), ring.pop(), ring;
}
function pointRadians(point) {
return [point[0] * radians, point[1] * radians];
}
var contains = function (object, point) {
return (object && containsObjectType.hasOwnProperty(object.type)
? containsObjectType[object.type]
: containsGeometry)(object, point);
};
function graticuleX(y0, y1, dy) {
var y = d3Array.range(y0, y1 - epsilon, dy).concat(y1);
return function (x) { return y.map(function (y) { return [x, y]; }); };
}
function graticuleY(x0, x1, dx) {
var x = d3Array.range(x0, x1 - 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 d3Array.range(ceil(X0 / DX) * DX, X1, DX).map(X)
.concat(d3Array.range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))
.concat(d3Array.range(ceil(x0 / dx) * dx, x1, dx).filter(function (x) { return abs(x % DX) > epsilon; }).map(x))
.concat(d3Array.range(ceil(y0 / dy) * dy, y1, dy).filter(function (y) { return abs(y % DY) > 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 + epsilon], [180, 90 - epsilon]])
.extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);
}
function graticule10() {
return graticule()();
}
var interpolate = function (a, b) {
var x0 = a[0] * radians, y0 = a[1] * radians, x1 = b[0] * radians, y1 = b[1] * radians, cy0 = cos(y0), sy0 = sin(y0), cy1 = cos(y1), sy1 = sin(y1), kx0 = cy0 * cos(x0), ky0 = cy0 * sin(x0), kx1 = cy1 * cos(x1), ky1 = cy1 * sin(x1), d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))), k = sin(d);
var interpolate = d ? function (t) {
var B = sin(t *= d) / k, A = sin(d - t) / k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
return [
atan2(y, x) * degrees,
atan2(z, sqrt(x * x + y * y)) * degrees
];
} : function () {
return [x0 * degrees, y0 * degrees];
};
interpolate.distance = d;
return interpolate;
};
var identity = function (x) {
return x;
};
var areaSum$1 = adder();
var areaRingSum$1 = adder();
var x00;
var y00;
var x0$1;
var y0$1;
var areaStream$1 = {
point: noop,
lineStart: noop,
lineEnd: noop,
polygonStart: function () {
areaStream$1.lineStart = areaRingStart$1;
areaStream$1.lineEnd = areaRingEnd$1;
},
polygonEnd: function () {
areaStream$1.lineStart = areaStream$1.lineEnd = areaStream$1.point = noop;
areaSum$1.add(abs(areaRingSum$1));
areaRingSum$1.reset();
},
result: function () {
var area = areaSum$1 / 2;
areaSum$1.reset();
return area;
}
};
function areaRingStart$1() {
areaStream$1.point = areaPointFirst$1;
}
function areaPointFirst$1(x, y) {
areaStream$1.point = areaPoint$1;
x00 = x0$1 = x, y00 = y0$1 = y;
}
function areaPoint$1(x, y) {
areaRingSum$1.add(y0$1 * x - x0$1 * y);
x0$1 = x, y0$1 = y;
}
function areaRingEnd$1() {
areaPoint$1(x00, y00);
}
var x0$2 = Infinity;
var y0$2 = x0$2;
var x1 = -x0$2;
var y1 = x1;
var boundsStream$1 = {
point: boundsPoint$1,
lineStart: noop,
lineEnd: noop,
polygonStart: noop,
polygonEnd: noop,
result: function () {
var bounds = [[x0$2, y0$2], [x1, y1]];
x1 = y1 = -(y0$2 = x0$2 = Infinity);
return bounds;
}
};
function boundsPoint$1(x, y) {
if (x < x0$2)
x0$2 = x;
if (x > x1)
x1 = x;
if (y < y0$2)
y0$2 = y;
if (y > y1)
y1 = y;
}
// TODO Enforce positive area for exterior, negative area for interior?
var X0$1 = 0;
var Y0$1 = 0;
var Z0$1 = 0;
var X1$1 = 0;
var Y1$1 = 0;
var Z1$1 = 0;
var X2$1 = 0;
var Y2$1 = 0;
var Z2$1 = 0;
var x00$1;
var y00$1;
var x0$3;
var y0$3;
var centroidStream$1 = {
point: centroidPoint$1,
lineStart: centroidLineStart$1,
lineEnd: centroidLineEnd$1,
polygonStart: function () {
centroidStream$1.lineStart = centroidRingStart$1;
centroidStream$1.lineEnd = centroidRingEnd$1;
},
polygonEnd: function () {
centroidStream$1.point = centroidPoint$1;
centroidStream$1.lineStart = centroidLineStart$1;
centroidStream$1.lineEnd = centroidLineEnd$1;
},
result: function () {
var centroid = Z2$1 ? [X2$1 / Z2$1, Y2$1 / Z2$1]
: Z1$1 ? [X1$1 / Z1$1, Y1$1 / Z1$1]
: Z0$1 ? [X0$1 / Z0$1, Y0$1 / Z0$1]
: [NaN, NaN];
X0$1 = Y0$1 = Z0$1 =
X1$1 = Y1$1 = Z1$1 =
X2$1 = Y2$1 = Z2$1 = 0;
return centroid;
}
};
function centroidPoint$1(x, y) {
X0$1 += x;
Y0$1 += y;
++Z0$1;
}
function centroidLineStart$1() {
centroidStream$1.point = centroidPointFirstLine;
}
function centroidPointFirstLine(x, y) {
centroidStream$1.point = centroidPointLine;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
function centroidPointLine(x, y) {
var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy);
X1$1 += z * (x0$3 + x) / 2;
Y1$1 += z * (y0$3 + y) / 2;
Z1$1 += z;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
function centroidLineEnd$1() {
centroidStream$1.point = centroidPoint$1;
}
function centroidRingStart$1() {
centroidStream$1.point = centroidPointFirstRing;
}
function centroidRingEnd$1() {
centroidPointRing(x00$1, y00$1);
}
function centroidPointFirstRing(x, y) {
centroidStream$1.point = centroidPointRing;
centroidPoint$1(x00$1 = x0$3 = x, y00$1 = y0$3 = y);
}
function centroidPointRing(x, y) {
var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy);
X1$1 += z * (x0$3 + x) / 2;
Y1$1 += z * (y0$3 + y) / 2;
Z1$1 += z;
z = y0$3 * x - x0$3 * y;
X2$1 += z * (x0$3 + x);
Y2$1 += z * (y0$3 + y);
Z2$1 += z * 3;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
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, tau);
break;
}
}
},
result: noop
};
var lengthSum$1 = adder();
var lengthRing;
var x00$2;
var y00$2;
var x0$4;
var y0$4;
var lengthStream$1 = {
point: noop,
lineStart: function () {
lengthStream$1.point = lengthPointFirst$1;
},
lineEnd: function () {
if (lengthRing)
lengthPoint$1(x00$2, y00$2);
lengthStream$1.point = noop;
},
polygonStart: function () {
lengthRing = true;
},
polygonEnd: function () {
lengthRing = null;
},
result: function () {
var length = +lengthSum$1;
lengthSum$1.reset();
return length;
}
};
function lengthPointFirst$1(x, y) {
lengthStream$1.point = lengthPoint$1;
x00$2 = x0$4 = x, y00$2 = y0$4 = y;
}
function lengthPoint$1(x, y) {
x0$4 -= x, y0$4 -= y;
lengthSum$1.add(sqrt(x0$4 * x0$4 + y0$4 * y0$4));
x0$4 = x, y0$4 = y;
}
function PathString() {
this._string = [];
}
PathString.prototype = {
_radius: 4.5,
_circle: circle$1(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$1(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$1(radius) {
return "m0," + radius
+ "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius
+ "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius
+ "z";
}
var index = function (projection, context) {
var pointRadius = 4.5, projectionStream, contextStream;
function path(object) {
if (object) {
if (typeof pointRadius === "function")
contextStream.pointRadius(+pointRadius.apply(this, arguments));
geoStream(object, projectionStream(contextStream));
}
return contextStream.result();
}
path.area = function (object) {
geoStream(object, projectionStream(areaStream$1));
return areaStream$1.result();
};
path.measure = function (object) {
geoStream(object, projectionStream(lengthStream$1));
return lengthStream$1.result();
};
path.bounds = function (object) {
geoStream(object, projectionStream(boundsStream$1));
return boundsStream$1.result();
};
path.centroid = function (object) {
geoStream(object, projectionStream(centroidStream$1));
return centroidStream$1.result();
};
path.projection = function (_) {
return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;
};
path.context = function (_) {
if (!arguments.length)
return context;
contextStream = _ == null ? (context = null, new PathString) : new PathContext(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);
};
var clip = function (pointVisible, clipLine, interpolate, start) {
return function (rotate, sink) {
var line = clipLine(sink), rotatedStart = rotate.invert(start[0], start[1]), ringBuffer = clipBuffer(), 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 = d3Array.merge(segments);
var startInside = polygonContains(polygon, rotatedStart);
if (segments.length) {
if (!polygonStarted)
sink.polygonStart(), polygonStarted = true;
clipPolygon(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) {
var point = rotate(lambda, phi);
if (pointVisible(lambda = point[0], phi = point[1]))
sink.point(lambda, phi);
}
function pointLine(lambda, phi) {
var point = rotate(lambda, phi);
line.point(point[0], point[1]);
}
function lineStart() {
clip.point = pointLine;
line.lineStart();
}
function lineEnd() {
clip.point = point;
line.lineEnd();
}
function pointRing(lambda, phi) {
ring.push([lambda, phi]);
var point = rotate(lambda, phi);
ringSink.point(point[0], point[1]);
}
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] - halfPi - epsilon : halfPi - a[1])
- ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);
}
var clipAntimeridian = clip(function () { return true; }, clipAntimeridianLine, clipAntimeridianInterpolate, [-pi, -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 ? pi : -pi, delta = abs(lambda1 - lambda0);
if (abs(delta - pi) < epsilon) { // line crosses a pole
stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);
stream.point(sign0, phi0);
stream.lineEnd();
stream.lineStart();
stream.point(sign1, phi0);
stream.point(lambda1, phi0);
clean = 0;
}
else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian
if (abs(lambda0 - sign0) < epsilon)
lambda0 -= sign0 * epsilon; // handle degeneracies
if (abs(lambda1 - sign1) < epsilon)
lambda1 -= sign1 * 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 = sin(lambda0 - lambda1);
return abs(sinLambda0Lambda1) > epsilon
? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)
- sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))
/ (cosPhi0 * cosPhi1 * sinLambda0Lambda1))
: (phi0 + phi1) / 2;
}
function clipAntimeridianInterpolate(from, to, direction, stream) {
var phi;
if (from == null) {
phi = direction * halfPi;
stream.point(-pi, phi);
stream.point(0, phi);
stream.point(pi, phi);
stream.point(pi, 0);
stream.point(pi, -phi);
stream.point(0, -phi);
stream.point(-pi, -phi);
stream.point(-pi, 0);
stream.point(-pi, phi);
}
else if (abs(from[0] - to[0]) > epsilon) {
var lambda = from[0] < to[0] ? pi : -pi;
phi = direction * lambda / 2;
stream.point(-lambda, phi);
stream.point(0, phi);
stream.point(lambda, phi);
}
else {
stream.point(to[0], to[1]);
}
}
var clipCircle = function (radius, delta) {
var cr = cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case
function interpolate(from, to, direction, stream) {
circleStream(stream, radius, delta, direction, from, to);
}
function visible(lambda, phi) {
return cos(lambda) * 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 ? pi : -pi), phi) : 0;
if (!point0 && (v00 = v0 = v))
stream.lineStart();
// Handle degeneracies.
// TODO ignore if not clipping polygons.
if (v !== v0) {
point2 = intersect(point0, point1);
if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {
point1[0] += epsilon;
point1[1] += epsilon;
v = visible(point1[0], point1[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]);
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]);
}
}
}
if (v && (!point0 || !pointEqual(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 = cartesian(a), pb = 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 = cartesianCross(pa, pb), n2n2 = 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 = cartesianCross(n1, n2), A = cartesianScale(n1, c1), B = cartesianScale(n2, c2);
cartesianAddInPlace(A, B);
// Solve |p(t)|^2 = 1.
var u = n1xn2, w = cartesianDot(A, u), uu = cartesianDot(u, u), t2 = w * w - uu * (cartesianDot(A, A) - 1);
if (t2 < 0)
return;
var t = sqrt(t2), q = cartesianScale(u, (-w - t) / uu);
cartesianAddInPlace(q, A);
q = 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 = abs(delta - pi) < epsilon, meridian = polar || delta < 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] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)
: phi0 <= q[1] && q[1] <= phi1
: delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {
var q1 = cartesianScale(u, (-w + t) / uu);
cartesianAddInPlace(q1, A);
return [q, 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 : 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 clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
};
var transform = 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(); }
};
function fitExtent(projection, extent, object) {
var w = extent[1][0] - extent[0][0], h = extent[1][1] - extent[0][1], clip = projection.clipExtent && projection.clipExtent();
projection
.scale(150)
.translate([0, 0]);
if (clip != null)
projection.clipExtent(null);
geoStream(object, projection.stream(boundsStream$1));
var b = boundsStream$1.result(), 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;
if (clip != null)
projection.clipExtent(clip);
return projection
.scale(k * 150)
.translate([x, y]);
}
function fitSize(projection, size, object) {
return fitExtent(projection, [[0, 0], size], object);
}
var maxDepth = 16;
var cosMinDistance = cos(30 * radians); // cos(minimum angular distance)
var resample = function (project, delta2) {
return +delta2 ? resample$1(project, delta2) : resampleNone(project);
};
function resampleNone(project) {
return transformer({
point: function (x, y) {
x = project(x, y);
this.stream.point(x[0], x[1]);
}
});
}
function resample$1(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 = sqrt(a * a + b * b + c * c), phi2 = asin(c /= m), lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : 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
|| 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 = 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;
};
}
var transformRadians = transformer({
point: function (x, y) {
this.stream.point(x * radians, y * radians);
}
});
function projection(project) {
return projectionMutator(function () { return project; })();
}
function projectionMutator(projectAt) {
var project, k = 150, // scale
x = 480, y = 250, // translate
dx, dy, lambda = 0, phi = 0, // center
deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, projectRotate, // rotate
theta = null, preclip = clipAntimeridian, // clip angle
x0 = null, y0, x1, y1, postclip = identity, // clip extent
delta2 = 0.5, projectResample = resample(projectTransform, delta2), // precision
cache, cacheStream;
function projection(point) {
point = projectRotate(point[0] * radians, point[1] * radians);
return [point[0] * k + dx, dy - point[1] * k];
}
function invert(point) {
point = projectRotate.invert((point[0] - dx) / k, (dy - point[1]) / k);
return point && [point[0] * degrees, point[1] * degrees];
}
function projectTransform(x, y) {
return x = project(x, y), [x[0] * k + dx, dy - x[1] * k];
}
projection.stream = function (stream) {
return cache && cacheStream === stream ? cache : cache = transformRadians(preclip(rotate, projectResample(postclip(cacheStream = stream))));
};
projection.clipAngle = function (_) {
return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians, 6 * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;
};
projection.clipExtent = function (_) {
return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipExtent(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 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
};
projection.rotate = function (_) {
return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
};
projection.precision = function (_) {
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);
};
projection.fitExtent = function (extent, object) {
return fitExtent(projection, extent, object);
};
projection.fitSize = function (size, object) {
return fitSize(projection, size, object);
};
function recenter() {
projectRotate = compose(rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma), project);
var center = project(lambda, phi);
dx = x - center[0] * k;
dy = y + center[1] * k;
return reset();
}
function reset() {
cache = cacheStream = null;
return projection;
}
return function () {
project = projectAt.apply(this, arguments);
projection.invert = project.invert && invert;
return recenter();
};
}
function conicProjection(projectAt) {
var phi0 = 0, phi1 = pi / 3, m = projectionMutator(projectAt), p = m(phi0, phi1);
p.parallels = function (_) {
return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];
};
return p;
}
function cylindricalEqualAreaRaw(phi0) {
var cosPhi0 = cos(phi0);
function forward(lambda, phi) {
return [lambda * cosPhi0, sin(phi) / cosPhi0];
}
forward.invert = function (x, y) {
return [x / cosPhi0, asin(y * cosPhi0)];
};
return forward;
}
function conicEqualAreaRaw(y0, y1) {
var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;
// Are the parallels symmetrical around the Equator?
if (abs(n) < epsilon)
return cylindricalEqualAreaRaw(y0);
var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;
function project(x, y) {
var r = sqrt(c - 2 * n * sin(y)) / n;
return [r * sin(x *= n), r0 - r * cos(x)];
}
project.invert = function (x, y) {
var r0y = r0 - y;
return [atan2(x, abs(r0y)) / n * sign(r0y), asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];
};
return project;
}
var conicEqualArea = function () {
return conicProjection(conicEqualAreaRaw)
.scale(155.424)
.center([0, 33.6442]);
};
var albers = function () {
return conicEqualArea()
.parallels([29.5, 45.5])
.scale(1070)
.translate([480, 250])
.rotate([96, 0])
.center([-0.6, 38.7]);
};
// 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
var albersUsa = function () {
var cache, cacheStream, lower48 = albers(), lower48Point, alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338
hawaii = conicEqualArea().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 + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])
.stream(pointStream);
hawaiiPoint = hawaii
.translate([x - 0.205 * k, y + 0.212 * k])
.clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])
.stream(pointStream);
return reset();
};
albersUsa.fitExtent = function (extent, object) {
return fitExtent(albersUsa, extent, object);
};
albersUsa.fitSize = function (size, object) {
return fitSize(albersUsa, size, object);
};
function reset() {
cache = cacheStream = null;
return albersUsa;
}
return albersUsa.scale(1070);
};
function azimuthalRaw(scale) {
return function (x, y) {
var cx = cos(x), cy = cos(y), k = scale(cx * cy);
return [
k * cy * sin(x),
k * sin(y)
];
};
}
function azimuthalInvert(angle) {
return function (x, y) {
var z = sqrt(x * x + y * y), c = angle(z), sc = sin(c), cc = cos(c);
return [
atan2(x * sc, z * cc),
asin(z && y * sc / z)
];
};
}
var azimuthalEqualAreaRaw = azimuthalRaw(function (cxcy) {
return sqrt(2 / (1 + cxcy));
});
azimuthalEqualAreaRaw.invert = azimuthalInvert(function (z) {
return 2 * asin(z / 2);
});
var azimuthalEqualArea = function () {
return projection(azimuthalEqualAreaRaw)
.scale(124.75)
.clipAngle(180 - 1e-3);
};
var azimuthalEquidistantRaw = azimuthalRaw(function (c) {
return (c = acos(c)) && c / sin(c);
});
azimuthalEquidistantRaw.invert = azimuthalInvert(function (z) {
return z;
});
var azimuthalEquidistant = function () {
return projection(azimuthalEquidistantRaw)
.scale(79.4188)
.clipAngle(180 - 1e-3);
};
function mercatorRaw(lambda, phi) {
return [lambda, log(tan((halfPi + phi) / 2))];
}
mercatorRaw.invert = function (x, y) {
return [x, 2 * atan(exp(y)) - halfPi];
};
var mercator = function () {
return mercatorProjection(mercatorRaw)
.scale(961 / tau);
};
function mercatorProjection(project) {
var m = projection(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 = pi * scale(), t = m(rotation(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();
}
function tany(y) {
return tan((halfPi + y) / 2);
}
function conicConformalRaw(y0, y1) {
var cy0 = cos(y0), n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)), f = cy0 * pow(tany(y0), n) / n;
if (!n)
return mercatorRaw;
function project(x, y) {
if (f > 0) {
if (y < -halfPi + epsilon)
y = -halfPi + epsilon;
}
else {
if (y > halfPi - epsilon)
y = halfPi - epsilon;
}
var r = f / pow(tany(y), n);
return [r * sin(n * x), f - r * cos(n * x)];
}
project.invert = function (x, y) {
var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy);
return [atan2(x, abs(fy)) / n * sign(fy), 2 * atan(pow(f / r, 1 / n)) - halfPi];
};
return project;
}
var conicConformal = function () {
return conicProjection(conicConformalRaw)
.scale(109.5)
.parallels([30, 30]);
};
function equirectangularRaw(lambda, phi) {
return [lambda, phi];
}
equirectangularRaw.invert = equirectangularRaw;
var equirectangular = function () {
return projection(equirectangularRaw)
.scale(152.63);
};
function conicEquidistantRaw(y0, y1) {
var cy0 = cos(y0), n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0), g = cy0 / n + y0;
if (abs(n) < epsilon)
return equirectangularRaw;
function project(x, y) {
var gy = g - y, nx = n * x;
return [gy * sin(nx), g - gy * cos(nx)];
}
project.invert = function (x, y) {
var gy = g - y;
return [atan2(x, abs(gy)) / n * sign(gy), g - sign(n) * sqrt(x * x + gy * gy)];
};
return project;
}
var conicEquidistant = function () {
return conicProjection(conicEquidistantRaw)
.scale(131.154)
.center([0, 13.9389]);
};
function gnomonicRaw(x, y) {
var cy = cos(y), k = cos(x) * cy;
return [cy * sin(x) / k, sin(y) / k];
}
gnomonicRaw.invert = azimuthalInvert(atan);
var gnomonic = function () {
return projection(gnomonicRaw)
.scale(144.049)
.clipAngle(60);
};
function scaleTranslate(kx, ky, tx, ty) {
return kx === 1 && ky === 1 && tx === 0 && ty === 0 ? identity : transformer({
point: function (x, y) {
this.stream.point(x * kx + tx, y * ky + ty);
}
});
}
var identity$1 = function () {
var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, transform = identity, // scale, translate and reflect
x0 = null, y0, x1, y1, clip = identity, // clip extent
cache, cacheStream, projection;
function reset() {
cache = cacheStream = null;
return projection;
}
return projection = {
stream: function (stream) {
return cache && cacheStream === stream ? cache : cache = transform(clip(cacheStream = stream));
},
clipExtent: function (_) {
return arguments.length ? (clip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
},
scale: function (_) {
return arguments.length ? (transform = scaleTranslate((k = +_) * sx, k * sy, tx, ty), reset()) : k;
},
translate: function (_) {
return arguments.length ? (transform = scaleTranslate(k * sx, k * sy, tx = +_[0], ty = +_[1]), reset()) : [tx, ty];
},
reflectX: function (_) {
return arguments.length ? (transform = scaleTranslate(k * (sx = _ ? -1 : 1), k * sy, tx, ty), reset()) : sx < 0;
},
reflectY: function (_) {
return arguments.length ? (transform = scaleTranslate(k * sx, k * (sy = _ ? -1 : 1), tx, ty), reset()) : sy < 0;
},
fitExtent: function (extent, object) {
return fitExtent(projection, extent, object);
},
fitSize: function (size, object) {
return fitSize(projection, size, object);
}
};
};
function orthographicRaw(x, y) {
return [cos(y) * sin(x), sin(y)];
}
orthographicRaw.invert = azimuthalInvert(asin);
var orthographic = function () {
return projection(orthographicRaw)
.scale(249.5)
.clipAngle(90 + epsilon);
};
function stereographicRaw(x, y) {
var cy = cos(y), k = 1 + cos(x) * cy;
return [cy * sin(x) / k, sin(y) / k];
}
stereographicRaw.invert = azimuthalInvert(function (z) {
return 2 * atan(z);
});
var stereographic = function () {
return projection(stereographicRaw)
.scale(250)
.clipAngle(142);
};
function transverseMercatorRaw(lambda, phi) {
return [log(tan((halfPi + phi) / 2)), -lambda];
}
transverseMercatorRaw.invert = function (x, y) {
return [-y, 2 * atan(exp(x)) - halfPi];
};
var transverseMercator = function () {
var m = 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);
};
exports.geoArea = area;
exports.geoBounds = bounds;
exports.geoCentroid = centroid;
exports.geoCircle = circle;
exports.geoClipExtent = extent;
exports.geoContains = contains;
exports.geoDistance = distance;
exports.geoGraticule = graticule;
exports.geoGraticule10 = graticule10;
exports.geoInterpolate = interpolate;
exports.geoLength = length;
exports.geoPath = index;
exports.geoAlbers = albers;
exports.geoAlbersUsa = albersUsa;
exports.geoAzimuthalEqualArea = azimuthalEqualArea;
exports.geoAzimuthalEqualAreaRaw = azimuthalEqualAreaRaw;
exports.geoAzimuthalEquidistant = azimuthalEquidistant;
exports.geoAzimuthalEquidistantRaw = azimuthalEquidistantRaw;
exports.geoConicConformal = conicConformal;
exports.geoConicConformalRaw = conicConformalRaw;
exports.geoConicEqualArea = conicEqualArea;
exports.geoConicEqualAreaRaw = conicEqualAreaRaw;
exports.geoConicEquidistant = conicEquidistant;
exports.geoConicEquidistantRaw = conicEquidistantRaw;
exports.geoEquirectangular = equirectangular;
exports.geoEquirectangularRaw = equirectangularRaw;
exports.geoGnomonic = gnomonic;
exports.geoGnomonicRaw = gnomonicRaw;
exports.geoIdentity = identity$1;
exports.geoProjection = projection;
exports.geoProjectionMutator = projectionMutator;
exports.geoMercator = mercator;
exports.geoMercatorRaw = mercatorRaw;
exports.geoOrthographic = orthographic;
exports.geoOrthographicRaw = orthographicRaw;
exports.geoStereographic = stereographic;
exports.geoStereographicRaw = stereographicRaw;
exports.geoTransverseMercator = transverseMercator;
exports.geoTransverseMercatorRaw = transverseMercatorRaw;
exports.geoRotation = rotation;
exports.geoStream = geoStream;
exports.geoTransform = transform;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/_d3-hexjson@1.1.0@d3-hexjson/build/d3-hexjson.js":
/*!***********************************************************************!*\
!*** ./node_modules/_d3-hexjson@1.1.0@d3-hexjson/build/d3-hexjson.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
(function (global, factory) {
true ? factory(exports, __webpack_require__(/*! d3-array */ "./node_modules/_d3-array@1.2.4@d3-array/dist/d3-array.js")) :
undefined;
}(this, function (exports, d3Array) {
'use strict';
// Main render method
function renderHexJSON(hexjson, width, height) {
// Get the layout
var layout = hexjson.layout;
// Get the hex objects as an array
var hexes = [];
var hexRadius = 0;
Object.keys(hexjson.hexes).forEach(function (key) {
hexjson.hexes[key].key = key;
hexes.push(hexjson.hexes[key]);
});
// Calculate the number of rows and columns
var qmax = d3Array.max(hexes, function (d) { return +d.q; }), qmin = d3Array.min(hexes, function (d) { return +d.q; }), rmax = d3Array.max(hexes, function (d) { return +d.r; }), rmin = d3Array.min(hexes, function (d) { return +d.r; });
var qnum = qmax - qmin + 1, rnum = rmax - rmin + 1;
// Calculate maximum radius the hexagons can have to fit the svg
if (layout === "odd-r" || layout === "even-r") {
hexRadius = d3Array.min([(width) / ((qnum + 0.5) * Math.sqrt(3)),
height / ((rnum + 1 / 3) * 1.5)]);
}
else {
hexRadius = d3Array.min([(height) / ((rnum + 0.5) * Math.sqrt(3)),
width / ((qnum + 1 / 3) * 1.5)]);
}
// Calculate the hexagon width
var hexWidth = hexRadius * Math.sqrt(3);
// Get the vertices and points for this layout
var vertices = getVertices(layout, hexWidth, hexRadius);
var points = getPoints(vertices);
// Calculate the values needed to render each hex and add to hexes
hexes.forEach(function (hex) {
// Calculate the absolute co-ordinates of each hex
hex.qc = hex.q - qmin;
hex.rc = rmax - hex.r;
// Calculate the x and y position of each hex for this svg
hex.x = getX(hex, layout, hexWidth, hexRadius);
hex.y = getY(hex, layout, hexWidth, hexRadius);
// Add the vertex positions and points relative to x and y
hex.vertices = vertices;
hex.points = points;
});
return hexes;
}
// Get the x position for a hex
function getX(hex, layout, hexWidth, hexRadius) {
var x = 0, xOffset = 0;
switch (layout) {
case "odd-r":
xOffset = (hex.rc % 2 === 1) ? hexWidth : (hexWidth / 2);
x = (hex.qc * hexWidth) + xOffset;
break;
case "even-r":
xOffset = (hex.rc % 2 === 0) ? hexWidth : (hexWidth / 2);
x = (hex.qc * hexWidth) + xOffset;
break;
case "odd-q":
case "even-q":
x = (hex.qc * hexRadius * 1.5) + hexRadius;
break;
}
return x;
}
// Get the y position for a hex
function getY(hex, layout, hexWidth, hexRadius) {
var y = 0, yOffset = 0;
switch (layout) {
case "odd-r":
case "even-r":
y = (hex.rc * hexRadius * 1.5) + hexRadius;
break;
case "odd-q":
yOffset = (hex.qc % 2 === 1) ? hexWidth : (hexWidth / 2);
y = (hex.rc * hexWidth) + yOffset;
break;
case "even-q":
yOffset = (hex.qc % 2 === 0) ? hexWidth : (hexWidth / 2);
y = (hex.rc * hexWidth) + yOffset;
break;
}
return y;
}
// Get the positions of the vertices for the hex:
// - Row layouts are ordered from the topmost vertex clockwise
// - Column layouts are ordered from the leftmost vertex clockwise
function getVertices(layout, hexWidth, hexRadius) {
var vertices = [];
switch (layout) {
case "odd-r":
case "even-r":
vertices.push({ x: 0, y: (0 - hexRadius) });
vertices.push({ x: (0 + hexWidth * 0.5), y: (0 - 0.5 * hexRadius) });
vertices.push({ x: (0 + hexWidth * 0.5), y: (0 + 0.5 * hexRadius) });
vertices.push({ x: 0, y: (0 + hexRadius) });
vertices.push({ x: (0 - hexWidth * 0.5), y: (0 + 0.5 * hexRadius) });
vertices.push({ x: (0 - hexWidth * 0.5), y: (0 - 0.5 * hexRadius) });
break;
case "odd-q":
case "even-q":
vertices.push({ x: (0 - hexRadius), y: 0 });
vertices.push({ x: (0 - 0.5 * hexRadius), y: (0 - hexWidth * 0.5) });
vertices.push({ x: (0 + 0.5 * hexRadius), y: (0 - hexWidth * 0.5) });
vertices.push({ x: (0 + hexRadius), y: 0 });
vertices.push({ x: (0 + 0.5 * hexRadius), y: (0 + hexWidth * 0.5) });
vertices.push({ x: (0 - 0.5 * hexRadius), y: (0 + hexWidth * 0.5) });
break;
}
return vertices;
}
// Get the points attribute for a polygon with these vertices
function getPoints(vertices) {
var points = "";
vertices.forEach(function (v) { points += v.x + "," + v.y + " "; });
return points.substring(0, points.length - 1);
}
// Creates a hexjson grid with the layout and dimensions of the given hexjson
function getGridForHexJSON(hexjson) {
// Create a new HexJSON object for the grid
var grid = {};
grid.layout = hexjson.layout;
grid.hexes = {};
// Get the hex objects from the hexjson as an array
var hexes = [];
Object.keys(hexjson.hexes).forEach(function (key) {
hexes.push(hexjson.hexes[key]);
});
// Calculate the number of rows and columns in the grid
var qmax = d3Array.max(hexes, function (d) { return +d.q; }), qmin = d3Array.min(hexes, function (d) { return +d.q; }), rmax = d3Array.max(hexes, function (d) { return +d.r; }), rmin = d3Array.min(hexes, function (d) { return +d.r; });
// Create the hexjson grid
var i, j, fkey;
for (i = qmin; i <= qmax; i++) {
for (j = rmin; j <= rmax; j++) {
fkey = "Q" + i + "R" + j;
grid.hexes[fkey] = { q: i, r: j };
}
}
return grid;
}
// Creates a list of dots along the boundaries between
// hexes which have different values of "field"
function getBoundaryDotsForHexJSON(hexjson, width, height, field) {
// Get the hex objects from the hexjson as an array
var hexes = [];
var layout = hexjson.layout;
Object.keys(hexjson.hexes).forEach(function (key) {
hexes.push(hexjson.hexes[key]);
});
// Calculate the number of rows and columns
var qmax = d3Array.max(hexes, function (d) { return +d.q; }), qmin = d3Array.min(hexes, function (d) { return +d.q; }), rmax = d3Array.max(hexes, function (d) { return +d.r; }), rmin = d3Array.min(hexes, function (d) { return +d.r; });
var qnum = qmax - qmin + 1, rnum = rmax - rmin + 1;
var hexRadius;
// Calculate maximum radius the hexagons can have to fit the svg
if (layout === "odd-r" || layout === "even-r") {
hexRadius = d3Array.min([(width) / ((qnum + 0.5) * Math.sqrt(3)),
height / ((rnum + 1 / 3) * 1.5)]);
}
else {
hexRadius = d3Array.min([(height) / ((rnum + 0.5) * Math.sqrt(3)),
width / ((qnum + 1 / 3) * 1.5)]);
}
// Calculate the hexagon width
var hexWidth = hexRadius * Math.sqrt(3);
// Create an array into which we will put points along the
// boundaries between differing hexes.
// Each edge has five points, equally spaced.
var lines = [];
var hexRadiusSquared = hexRadius * hexRadius * 4;
var maxHex = hexes.length;
if (maxHex > 1) {
hexes.forEach(function (hex) {
hex.qc = hex.q - qmin;
hex.rc = rmax - hex.r;
// Calculate the x and y position of each hex for this svg
hex.x = getX(hex, layout, hexWidth, hexRadius);
hex.y = getY(hex, layout, hexWidth, hexRadius);
});
for (var i = 0; i < maxHex - 1; i++) {
for (var j = i + 1; j < maxHex; j++) {
var hex = hexes[i];
var otherHex = hexes[j];
if (hex[field] !== otherHex[field]) {
if (Math.abs(hex.q - otherHex.q) <= 1 &&
Math.abs(hex.r - otherHex.r) <= 1) {
if (((hex.x - otherHex.x) * (hex.x - otherHex.x)) +
((hex.y - otherHex.y) * (hex.y - otherHex.y)) < hexRadiusSquared) {
// They're neighbours
var midpoint = {};
midpoint.x = otherHex.x + (hex.x - otherHex.x) / 2;
midpoint.y = otherHex.y + (hex.y - otherHex.y) / 2;
var perp = {};
var denom = Math.sqrt(3) * 4;
perp.dx = (hex.y - otherHex.y) / denom;
perp.dy = -(hex.x - otherHex.x) / denom;
lines.push({ x: midpoint.x - 2 * perp.dx, y: midpoint.y - 2 * perp.dy });
lines.push({ x: midpoint.x - perp.dx, y: midpoint.y - perp.dy });
lines.push({ x: midpoint.x, y: midpoint.y });
lines.push({ x: midpoint.x + perp.dx, y: midpoint.y + perp.dy });
lines.push({ x: midpoint.x + 2 * perp.dx, y: midpoint.y + 2 * perp.dy });
}
}
}
}
}
}
return lines;
}
// Creates a list of line segments along the boundaries
// between hexes which have different values of "field"
function getBoundarySegmentsForHexJSON(hexjson, width, height, field) {
// Get the hex objects from the hexjson as an array
var hexes = [];
var layout = hexjson.layout;
Object.keys(hexjson.hexes).forEach(function (key) {
hexes.push(hexjson.hexes[key]);
});
// Calculate the number of rows and columns
var qmax = d3Array.max(hexes, function (d) { return +d.q; }), qmin = d3Array.min(hexes, function (d) { return +d.q; }), rmax = d3Array.max(hexes, function (d) { return +d.r; }), rmin = d3Array.min(hexes, function (d) { return +d.r; });
var qnum = qmax - qmin + 1, rnum = rmax - rmin + 1;
var hexRadius;
// Calculate maximum radius the hexagons can have to fit the svg
if (layout === "odd-r" || layout === "even-r") {
hexRadius = d3Array.min([(width) / ((qnum + 0.5) * Math.sqrt(3)),
height / ((rnum + 1 / 3) * 1.5)]);
}
else {
hexRadius = d3Array.min([(height) / ((rnum + 0.5) * Math.sqrt(3)),
width / ((qnum + 1 / 3) * 1.5)]);
}
// Calculate the hexagon width
var hexWidth = hexRadius * Math.sqrt(3);
// Create an array into which we will put points along the
// boundaries between differing hexes.
// Each segment will be of the form
// {x: <start point X>, y: <start point Y>, cx: <difference X>, cy: <difference Y> }
// intended to be used with the simple line drawing functionality of d3
//
var segments = [];
var hexRadiusSquared = hexRadius * hexRadius * 4;
var maxHex = hexes.length;
if (maxHex > 1) {
hexes.forEach(function (hex) {
hex.qc = hex.q - qmin;
hex.rc = rmax - hex.r;
// Calculate the x and y position of each hex for this svg
hex.x = getX(hex, layout, hexWidth, hexRadius);
hex.y = getY(hex, layout, hexWidth, hexRadius);
});
for (var i = 0; i < maxHex - 1; i++) {
for (var j = i + 1; j < maxHex; j++) {
var hex = hexes[i];
var otherHex = hexes[j];
if (hex[field] !== otherHex[field]) {
if (Math.abs(hex.q - otherHex.q) <= 1 &&
Math.abs(hex.r - otherHex.r) <= 1) {
if (((hex.x - otherHex.x) * (hex.x - otherHex.x)) +
((hex.y - otherHex.y) * (hex.y - otherHex.y)) < hexRadiusSquared) {
// They're neighbours
var midpoint = {};
midpoint.x = otherHex.x + (hex.x - otherHex.x) / 2;
midpoint.y = otherHex.y + (hex.y - otherHex.y) / 2;
var perp = {};
var direction = +1;
if (hex[field] < otherHex[field]) {
direction = -1;
} // otherwise, direction will be +1
var denom = Math.sqrt(3) * 2 * direction;
perp.dx = (hex.y - otherHex.y) / denom;
perp.dy = -(hex.x - otherHex.x) / denom;
segments.push({
x1: midpoint.x - perp.dx,
y1: midpoint.y - perp.dy,
x2: midpoint.x + perp.dx,
y2: midpoint.y + perp.dy
});
}
}
}
}
}
}
return segments;
}
exports.renderHexJSON = renderHexJSON;
exports.getGridForHexJSON = getGridForHexJSON;
exports.getBoundaryDotsForHexJSON = getBoundaryDotsForHexJSON;
exports.getBoundarySegmentsForHexJSON = getBoundarySegmentsForHexJSON;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/***/ "./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js":
/*!****************************************************************************!*\
!*** ./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-hierarchy/ v1.1.9 Copyright 2019 Mike Bostock
(function (global, factory) {
true ? factory(exports) :
undefined;
}(this, function (exports) {
'use strict';
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;
}
function cluster() {
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;
}
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;
}
function node_count() {
return this.eachAfter(count);
}
function node_each(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;
}
function node_eachBefore(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;
}
function node_eachAfter(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;
}
function node_sum(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;
});
}
function node_sort(compare) {
return this.eachBefore(function (node) {
if (node.children) {
node.children.sort(compare);
}
});
}
function node_path(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;
}
function node_ancestors() {
var node = this, nodes = [node];
while (node = node.parent) {
nodes.push(node);
}
return nodes;
}
function node_descendants() {
var nodes = [];
this.each(function (node) {
nodes.push(node);
});
return nodes;
}
function node_leaves() {
var leaves = [];
this.eachBefore(function (node) {
if (!node.children) {
leaves.push(node);
}
});
return leaves;
}
function node_links() {
var root = this, links = [];
root.each(function (node) {
if (node !== root) { // Dont include the roots parent, if any.
links.push({ source: node.parent, target: node });
}
});
return links;
}
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: node_count,
each: node_each,
eachAfter: node_eachAfter,
eachBefore: node_eachBefore,
sum: node_sum,
sort: node_sort,
path: node_path,
ancestors: node_ancestors,
descendants: node_descendants,
leaves: node_leaves,
links: node_links,
copy: node_copy
};
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;
}
function enclose(circles) {
var i = 0, n = (circles = shuffle(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
};
}
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$1(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$1(a), b = new Node$1(b), c = new Node$1(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$1(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 = enclose(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;
}
function siblings(circles) {
packEnclose(circles);
return circles;
}
function optional(f) {
return f == null ? null : required(f);
}
function required(f) {
if (typeof f !== "function")
throw new Error;
return f;
}
function constantZero() {
return 0;
}
function constant(x) {
return function () {
return x;
};
}
function defaultRadius(d) {
return Math.sqrt(d.value);
}
function index() {
var radius = null, dx = 1, dy = 1, padding = 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(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 = 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 : constant(+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 = 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;
}
};
}
function roundNode(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);
}
function treemapDice(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;
}
}
function partition() {
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(roundNode);
return root;
}
function positionNode(dy, n) {
return function (node) {
if (node.children) {
treemapDice(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;
}
var keyPrefix = "$", // Protect against keys like “__proto__”.
preroot = { depth: -1 }, ambiguous = {};
function defaultId(d) {
return d.id;
}
function defaultParentId(d) {
return d.parentId;
}
function stratify() {
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 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(computeHeight);
root.parent = null;
if (n > 0)
throw new Error("cycle");
return root;
}
stratify.id = function (x) {
return arguments.length ? (id = required(x), stratify) : id;
};
stratify.parentId = function (x) {
return arguments.length ? (parentId = required(x), stratify) : parentId;
};
return stratify;
}
function defaultSeparation$1(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(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
function tree() {
var separation = defaultSeparation$1, 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;
}
function treemapSlice(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;
}
}
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)
treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
else
treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
value -= sumValue, i0 = i1;
}
return rows;
}
var squarify = (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);
function index$1() {
var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
function treemap(root) {
root.x0 =
root.y0 = 0;
root.x1 = dx;
root.y1 = dy;
root.eachBefore(positionNode);
paddingStack = [0];
if (round)
root.eachBefore(roundNode);
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 = 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 : constant(+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 : constant(+x), treemap) : paddingTop;
};
treemap.paddingRight = function (x) {
return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap) : paddingRight;
};
treemap.paddingBottom = function (x) {
return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap) : paddingBottom;
};
treemap.paddingLeft = function (x) {
return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap) : paddingLeft;
};
return treemap;
}
function binary(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);
}
}
}
function sliceDice(parent, x0, y0, x1, y1) {
(parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1);
}
var resquarify = (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)
treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);
else
treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);
value -= row.value;
}
}
else {
parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
rows.ratio = ratio;
}
}
resquarify.ratio = function (x) {
return custom((x = +x) > 1 ? x : 1);
};
return resquarify;
})(phi);
exports.cluster = cluster;
exports.hierarchy = hierarchy;
exports.pack = index;
exports.packEnclose = enclose;
exports.packSiblings = siblings;
exports.partition = partition;
exports.stratify = stratify;
exports.tree = tree;
exports.treemap = index$1;
exports.treemapBinary = binary;
exports.treemapDice = treemapDice;
exports.treemapResquarify = resquarify;
exports.treemapSlice = treemapSlice;
exports.treemapSliceDice = sliceDice;
exports.treemapSquarify = squarify;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/***/ "./node_modules/_d3-path@1.0.9@d3-path/dist/d3-path.js":
/*!*************************************************************!*\
!*** ./node_modules/_d3-path@1.0.9@d3-path/dist/d3-path.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-path/ v1.0.9 Copyright 2019 Mike Bostock
(function (global, factory) {
true ? factory(exports) :
undefined;
}(this, function (exports) {
'use strict';
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? Were 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._;
}
};
exports.path = path;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/***/ "./node_modules/_d3-sankey@0.9.1@d3-sankey/dist/d3-sankey.js":
/*!*******************************************************************!*\
!*** ./node_modules/_d3-sankey@0.9.1@d3-sankey/dist/d3-sankey.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
// https://github.com/d3/d3-sankey v0.9.1 Copyright 2019 Mike Bostock
(function (global, factory) {
true ? factory(exports, __webpack_require__(/*! d3-array */ "./node_modules/_d3-array@1.2.4@d3-array/dist/d3-array.js"), __webpack_require__(/*! d3-collection */ "./node_modules/_d3-collection@1.0.7@d3-collection/dist/d3-collection.js"), __webpack_require__(/*! d3-shape */ "./node_modules/_d3-shape@1.3.7@d3-shape/dist/d3-shape.js")) :
undefined;
}(this, function (exports, d3Array, d3Collection, d3Shape) {
'use strict';
function targetDepth(d) {
return d.target.depth;
}
function left(node) {
return node.depth;
}
function right(node, n) {
return n - 1 - node.height;
}
function justify(node, n) {
return node.sourceLinks.length ? node.depth : n - 1;
}
function center(node) {
return node.targetLinks.length ? node.depth
: node.sourceLinks.length ? d3Array.min(node.sourceLinks, targetDepth) - 1
: 0;
}
function constant(x) {
return function () {
return x;
};
}
function ascendingSourceBreadth(a, b) {
return ascendingBreadth(a.source, b.source) || a.index - b.index;
}
function ascendingTargetBreadth(a, b) {
return ascendingBreadth(a.target, b.target) || a.index - b.index;
}
function ascendingBreadth(a, b) {
return a.y0 - b.y0;
}
function value(d) {
return d.value;
}
function defaultId(d) {
return d.index;
}
function defaultNodes(graph) {
return graph.nodes;
}
function defaultLinks(graph) {
return graph.links;
}
function find(nodeById, id) {
var node = nodeById.get(id);
if (!node)
throw new Error("missing: " + id);
return node;
}
function Sankey() {
var x0 = 0, y0 = 0, x1 = 1, y1 = 1, // extent
dx = 24, // nodeWidth
py = 8, // nodePadding
id = defaultId, align = justify, sort, nodes = defaultNodes, links = defaultLinks, iterations = 6;
function sankey() {
var graph = { nodes: nodes.apply(null, arguments), links: links.apply(null, arguments) };
computeNodeLinks(graph);
computeNodeValues(graph);
computeNodeDepths(graph);
computeNodeBreadths(graph);
computeLinkBreadths(graph);
return graph;
}
sankey.update = function (graph) {
computeLinkBreadths(graph);
return graph;
};
sankey.nodeId = function (_) {
return arguments.length ? (id = typeof _ === "function" ? _ : constant(_), sankey) : id;
};
sankey.nodeAlign = function (_) {
return arguments.length ? (align = typeof _ === "function" ? _ : constant(_), sankey) : align;
};
sankey.nodeSort = function (_) {
return arguments.length ? (sort = _, sankey) : sort;
};
sankey.nodeWidth = function (_) {
return arguments.length ? (dx = +_, sankey) : dx;
};
sankey.nodePadding = function (_) {
return arguments.length ? (py = +_, sankey) : py;
};
sankey.nodes = function (_) {
return arguments.length ? (nodes = typeof _ === "function" ? _ : constant(_), sankey) : nodes;
};
sankey.links = function (_) {
return arguments.length ? (links = typeof _ === "function" ? _ : constant(_), sankey) : links;
};
sankey.size = function (_) {
return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];
};
sankey.extent = function (_) {
return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];
};
sankey.iterations = function (_) {
return arguments.length ? (iterations = +_, sankey) : iterations;
};
// Populate the sourceLinks and targetLinks for each node.
// Also, if the source and target are not objects, assume they are indices.
function computeNodeLinks(graph) {
graph.nodes.forEach(function (node, i) {
node.index = i;
node.sourceLinks = [];
node.targetLinks = [];
});
var nodeById = d3Collection.map(graph.nodes, id);
graph.links.forEach(function (link, i) {
link.index = i;
var source = link.source, target = link.target;
if (typeof source !== "object")
source = link.source = find(nodeById, source);
if (typeof target !== "object")
target = link.target = find(nodeById, target);
source.sourceLinks.push(link);
target.targetLinks.push(link);
});
}
// Compute the value (size) of each node by summing the associated links.
function computeNodeValues(graph) {
graph.nodes.forEach(function (node) {
node.value = Math.max(d3Array.sum(node.sourceLinks, value), d3Array.sum(node.targetLinks, value));
});
}
// Iteratively assign the depth (x-position) for each node.
// Nodes are assigned the maximum depth of incoming neighbors plus one;
// nodes with no incoming links are assigned depth zero, while
// nodes with no outgoing links are assigned the maximum depth.
function computeNodeDepths(graph) {
var nodes, next, x, n = graph.nodes.length;
for (nodes = graph.nodes, next = [], x = 0; nodes.length; ++x, nodes = next, next = []) {
if (x > n)
throw new Error("circular link");
nodes.forEach(function (node) {
node.depth = x;
node.sourceLinks.forEach(function (link) {
if (next.indexOf(link.target) < 0) {
next.push(link.target);
}
});
});
}
for (nodes = graph.nodes, next = [], x = 0; nodes.length; ++x, nodes = next, next = []) {
if (x > n)
throw new Error("circular link");
nodes.forEach(function (node) {
node.height = x;
node.targetLinks.forEach(function (link) {
if (next.indexOf(link.source) < 0) {
next.push(link.source);
}
});
});
}
var kx = (x1 - x0 - dx) / (x - 1);
graph.nodes.forEach(function (node) {
node.x1 = (node.x0 = x0 + Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x)))) * kx) + dx;
});
}
function computeNodeBreadths(graph) {
var columns = d3Collection.nest()
.key(function (d) { return d.x0; })
.sortKeys(d3Array.ascending)
.entries(graph.nodes)
.map(function (d) { return d.values; });
//
initializeNodeBreadth();
resolveCollisions();
for (var alpha = 0.9, n = iterations; n > 0; --n, alpha *= 0.9) {
relaxRightToLeft(alpha);
resolveCollisions();
relaxLeftToRight(alpha);
resolveCollisions();
}
function initializeNodeBreadth() {
var ky = d3Array.min(columns, function (nodes) {
return (y1 - y0 - (nodes.length - 1) * py) / d3Array.sum(nodes, value);
});
columns.forEach(function (nodes) {
if (sort != null)
nodes.sort(sort);
nodes.forEach(function (node, i) {
node.y1 = (node.y0 = i) + node.value * ky;
});
});
graph.links.forEach(function (link) {
link.width = link.value * ky;
});
}
function relaxLeftToRight(alpha) {
columns.forEach(function (nodes) {
nodes.forEach(function (node) {
var e_1, _a, e_2, _b;
var y = node.y0;
try {
for (var _c = tslib_1.__values(node.sourceLinks.sort(ascendingTargetBreadth)), _d = _c.next(); !_d.done; _d = _c.next()) {
var _e = _d.value, target = _e.target, width = _e.width, value_1 = _e.value;
if (value_1 > 0) {
var dy = 0;
try {
for (var _f = (e_2 = void 0, tslib_1.__values(target.targetLinks)), _g = _f.next(); !_g.done; _g = _f.next()) {
var _h = _g.value, source = _h.source, width_1 = _h.width;
if (source === node)
break;
dy += width_1 + py / 2;
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
}
finally { if (e_2) throw e_2.error; }
}
dy = (y - dy - target.y0) * alpha * (value_1 / Math.min(node.value, target.value));
target.y0 += dy;
target.y1 += dy;
}
y += width + py / 2;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
}
finally { if (e_1) throw e_1.error; }
}
});
});
}
function relaxRightToLeft(alpha) {
columns.slice().reverse().forEach(function (nodes) {
nodes.forEach(function (node) {
var e_3, _a, e_4, _b;
var y = node.y0;
try {
for (var _c = tslib_1.__values(node.targetLinks.sort(ascendingSourceBreadth)), _d = _c.next(); !_d.done; _d = _c.next()) {
var _e = _d.value, source = _e.source, width = _e.width, value_2 = _e.value;
if (value_2 > 0) {
var dy = 0;
try {
for (var _f = (e_4 = void 0, tslib_1.__values(source.sourceLinks)), _g = _f.next(); !_g.done; _g = _f.next()) {
var _h = _g.value, target = _h.target, width_2 = _h.width;
if (target === node)
break;
dy += width_2 + py / 2;
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
}
finally { if (e_4) throw e_4.error; }
}
dy = (y - dy - source.y0) * alpha * (value_2 / Math.min(node.value, source.value));
source.y0 += dy;
source.y1 += dy;
}
y += width + py / 2;
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
}
finally { if (e_3) throw e_3.error; }
}
});
});
}
function resolveCollisions() {
columns.forEach(function (nodes) {
var node, dy, y = y0, n = nodes.length, i;
// Push any overlapping nodes down.
if (sort === undefined)
nodes.sort(ascendingBreadth);
for (i = 0; i < n; ++i) {
node = nodes[i];
dy = y - node.y0;
if (dy > 0)
node.y0 += dy, node.y1 += dy;
y = node.y1 + py;
}
// If the bottommost node goes outside the bounds, push it back up.
dy = y - py - y1;
if (dy > 0) {
y = (node.y0 -= dy), node.y1 -= dy;
// Push any overlapping nodes back up.
for (i = n - 2; i >= 0; --i) {
node = nodes[i];
dy = node.y1 + py - y;
if (dy > 0)
node.y0 -= dy, node.y1 -= dy;
y = node.y0;
}
}
});
}
}
function computeLinkBreadths(graph) {
graph.nodes.forEach(function (node) {
node.sourceLinks.sort(ascendingTargetBreadth);
node.targetLinks.sort(ascendingSourceBreadth);
});
graph.nodes.forEach(function (node) {
var y0 = node.y0, y1 = y0;
node.sourceLinks.forEach(function (link) {
link.y0 = y0 + link.width / 2, y0 += link.width;
});
node.targetLinks.forEach(function (link) {
link.y1 = y1 + link.width / 2, y1 += link.width;
});
});
}
return sankey;
}
function horizontalSource(d) {
return [d.source.x1, d.y0];
}
function horizontalTarget(d) {
return [d.target.x0, d.y1];
}
function sankeyLinkHorizontal() {
return d3Shape.linkHorizontal()
.source(horizontalSource)
.target(horizontalTarget);
}
exports.sankey = Sankey;
exports.sankeyCenter = center;
exports.sankeyLeft = left;
exports.sankeyRight = right;
exports.sankeyJustify = justify;
exports.sankeyLinkHorizontal = sankeyLinkHorizontal;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/***/ "./node_modules/_d3-shape@1.3.7@d3-shape/dist/d3-shape.js":
/*!****************************************************************!*\
!*** ./node_modules/_d3-shape@1.3.7@d3-shape/dist/d3-shape.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-shape/ v1.3.7 Copyright 2019 Mike Bostock
(function (global, factory) {
true ? factory(exports, __webpack_require__(/*! d3-path */ "./node_modules/_d3-path@1.0.9@d3-path/dist/d3-path.js")) :
undefined;
}(this, function (exports, d3Path) {
'use strict';
function constant(x) {
return function constant() {
return x;
};
}
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);
}
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 < 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) / 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) * sqrt(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)
};
}
function arc() {
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant(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) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0;
if (!context)
context = buffer = d3Path.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 > epsilon))
context.moveTo(0, 0);
// Or is it a circle or annulus?
else if (da > tau - epsilon) {
context.moveTo(r1 * cos(a0), r1 * sin(a0));
context.arc(0, 0, r1, a0, a1, !cw);
if (r0 > epsilon) {
context.moveTo(r0 * cos(a1), r0 * 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 > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min(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 > epsilon) {
var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
if ((da0 -= p0 * 2) > epsilon)
p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
else
da0 = 0, a00 = a10 = (a0 + a1) / 2;
if ((da1 -= p1 * 2) > epsilon)
p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
else
da1 = 0, a01 = a11 = (a0 + a1) / 2;
}
var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
// Apply rounded corners?
if (rc > epsilon) {
var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
// Restrict the corner radius according to the sector angle.
if (da < 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 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
rc0 = min(rc, (r0 - lc) / (kc - 1));
rc1 = min(rc, (r1 - lc) / (kc + 1));
}
}
// Is the sector collapsed to a line?
if (!(da1 > epsilon))
context.moveTo(x01, y01);
// Does the sectors outer ring have rounded corners?
else if (rc1 > 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, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), 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 its a circular sector?
// Or perhaps its an annular sector collapsed due to padding?
if (!(r0 > epsilon) || !(da0 > epsilon))
context.lineTo(x10, y10);
// Does the sectors inner ring (or point) have rounded corners?
else if (rc0 > 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, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), 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 - pi / 2;
return [cos(a) * r, sin(a) * r];
};
arc.innerRadius = function (_) {
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
};
arc.outerRadius = function (_) {
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
};
arc.cornerRadius = function (_) {
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
};
arc.padRadius = function (_) {
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
};
arc.startAngle = function (_) {
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
};
arc.endAngle = function (_) {
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
};
arc.padAngle = function (_) {
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
};
arc.context = function (_) {
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
};
return arc;
}
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;
}
}
};
function curveLinear(context) {
return new Linear(context);
}
function x(p) {
return p[0];
}
function y(p) {
return p[1];
}
function line() {
var x$1 = x, y$1 = y, defined = constant(true), context = null, curve = curveLinear, output = null;
function line(data) {
var i, n = data.length, d, defined0 = false, buffer;
if (context == null)
output = curve(buffer = d3Path.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$1(d, i, data), +y$1(d, i, data));
}
if (buffer)
return output = null, buffer + "" || null;
}
line.x = function (_) {
return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1;
};
line.y = function (_) {
return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1;
};
line.defined = function (_) {
return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), 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;
}
function area() {
var x0 = x, x1 = null, y0 = constant(0), y1 = y, defined = constant(true), context = null, curve = curveLinear, 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 = d3Path.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 line().defined(defined).curve(curve).context(context);
}
area.x = function (_) {
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), x1 = null, area) : x0;
};
area.x0 = function (_) {
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), area) : x0;
};
area.x1 = function (_) {
return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : x1;
};
area.y = function (_) {
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), y1 = null, area) : y0;
};
area.y0 = function (_) {
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), area) : y0;
};
area.y1 = function (_) {
return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), 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" ? _ : constant(!!_), 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;
}
function descending(a, b) {
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
}
function identity(d) {
return d;
}
function pie() {
var value = identity, sortValues = descending, sort = null, startAngle = constant(0), endAngle = constant(tau), padAngle = constant(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(tau, Math.max(-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" ? _ : constant(+_), 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" ? _ : constant(+_), pie) : startAngle;
};
pie.endAngle = function (_) {
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle;
};
pie.padAngle = function (_) {
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle;
};
return pie;
}
var curveRadialLinear = curveRadial(curveLinear);
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;
}
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(curveRadial(_)) : c()._curve;
};
return l;
}
function lineRadial$1() {
return lineRadial(line().curve(curveRadialLinear));
}
function areaRadial() {
var a = area().curve(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 lineRadial(x0()); }, delete a.lineX0;
a.lineEndAngle = function () { return lineRadial(x1()); }, delete a.lineX1;
a.lineInnerRadius = function () { return lineRadial(y0()); }, delete a.lineY0;
a.lineOuterRadius = function () { return lineRadial(y1()); }, delete a.lineY1;
a.curve = function (_) {
return arguments.length ? c(curveRadial(_)) : c()._curve;
};
return a;
}
function pointRadial(x, y) {
return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];
}
var slice = Array.prototype.slice;
function linkSource(d) {
return d.source;
}
function linkTarget(d) {
return d.target;
}
function link(curve) {
var source = linkSource, target = linkTarget, x$1 = x, y$1 = y, context = null;
function link() {
var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
if (!context)
context = buffer = d3Path.path();
curve(context, +x$1.apply(this, (argv[0] = s, argv)), +y$1.apply(this, argv), +x$1.apply(this, (argv[0] = t, argv)), +y$1.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$1 = typeof _ === "function" ? _ : constant(+_), link) : x$1;
};
link.y = function (_) {
return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), link) : y$1;
};
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$1(context, x0, y0, x1, y1) {
var p0 = pointRadial(x0, y0), p1 = pointRadial(x0, y0 = (y0 + y1) / 2), p2 = pointRadial(x1, y0), p3 = pointRadial(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$1);
l.angle = l.x, delete l.x;
l.radius = l.y, delete l.y;
return l;
}
var circle = {
draw: function (context, size) {
var r = Math.sqrt(size / pi);
context.moveTo(r, 0);
context.arc(0, 0, r, 0, tau);
}
};
var cross = {
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();
}
};
var tan30 = Math.sqrt(1 / 3), tan30_2 = tan30 * 2;
var diamond = {
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();
}
};
var ka = 0.89081309152928522810, kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10), kx = Math.sin(tau / 10) * kr, ky = -Math.cos(tau / 10) * kr;
var star = {
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 = 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();
}
};
var square = {
draw: function (context, size) {
var w = Math.sqrt(size), x = -w / 2;
context.rect(x, x, w, w);
}
};
var sqrt3 = Math.sqrt(3);
var triangle = {
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();
}
};
var c = -0.5, s = Math.sqrt(3) / 2, k = 1 / Math.sqrt(12), a = (k / 2 + 1) * 3;
var wye = {
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();
}
};
var symbols = [
circle,
cross,
diamond,
square,
star,
triangle,
wye
];
function symbol() {
var type = constant(circle), size = constant(64), context = null;
function symbol() {
var buffer;
if (!context)
context = buffer = d3Path.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" ? _ : constant(_), symbol) : type;
};
symbol.size = function (_) {
return arguments.length ? (size = typeof _ === "function" ? _ : constant(+_), symbol) : size;
};
symbol.context = function (_) {
return arguments.length ? (context = _ == null ? null : _, symbol) : context;
};
return symbol;
}
function noop() { }
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;
}
};
function basis(context) {
return new Basis(context);
}
function BasisClosed(context) {
this._context = context;
}
BasisClosed.prototype = {
areaStart: noop,
areaEnd: noop,
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:
point(this, x, y);
break;
}
this._x0 = this._x1, this._x1 = x;
this._y0 = this._y1, this._y1 = y;
}
};
function basisClosed(context) {
return new BasisClosed(context);
}
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:
point(this, x, y);
break;
}
this._x0 = this._x1, this._x1 = x;
this._y0 = this._y1, this._y1 = y;
}
};
function basisOpen(context) {
return new BasisOpen(context);
}
function Bundle(context, beta) {
this._basis = new 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);
}
};
var bundle = (function custom(beta) {
function bundle(context) {
return beta === 1 ? new Basis(context) : new Bundle(context, beta);
}
bundle.beta = function (beta) {
return custom(+beta);
};
return bundle;
})(0.85);
function point$1(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$1(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$1(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;
}
};
var cardinal = (function custom(tension) {
function cardinal(context) {
return new Cardinal(context, tension);
}
cardinal.tension = function (tension) {
return custom(+tension);
};
return cardinal;
})(0);
function CardinalClosed(context, tension) {
this._context = context;
this._k = (1 - tension) / 6;
}
CardinalClosed.prototype = {
areaStart: noop,
areaEnd: noop,
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:
point$1(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;
}
};
var cardinalClosed = (function custom(tension) {
function cardinal(context) {
return new CardinalClosed(context, tension);
}
cardinal.tension = function (tension) {
return custom(+tension);
};
return cardinal;
})(0);
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:
point$1(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;
}
};
var cardinalOpen = (function custom(tension) {
function cardinal(context) {
return new CardinalOpen(context, tension);
}
cardinal.tension = function (tension) {
return custom(+tension);
};
return cardinal;
})(0);
function point$2(that, x, y) {
var x1 = that._x1, y1 = that._y1, x2 = that._x2, y2 = that._y2;
if (that._l01_a > 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 > 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$2(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;
}
};
var catmullRom = (function custom(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
}
catmullRom.alpha = function (alpha) {
return custom(+alpha);
};
return catmullRom;
})(0.5);
function CatmullRomClosed(context, alpha) {
this._context = context;
this._alpha = alpha;
}
CatmullRomClosed.prototype = {
areaStart: noop,
areaEnd: noop,
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:
point$2(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;
}
};
var catmullRomClosed = (function custom(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
}
catmullRom.alpha = function (alpha) {
return custom(+alpha);
};
return catmullRom;
})(0.5);
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:
point$2(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;
}
};
var catmullRomOpen = (function custom(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
}
catmullRom.alpha = function (alpha) {
return custom(+alpha);
};
return catmullRom;
})(0.5);
function LinearClosed(context) {
this._context = context;
}
LinearClosed.prototype = {
areaStart: noop,
areaEnd: noop,
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);
}
};
function linearClosed(context) {
return new LinearClosed(context);
}
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$3(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$3(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$3(this, slope2(this, t1 = slope3(this, x, y)), t1);
break;
default:
point$3(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);
}
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];
}
function natural(context) {
return new Natural(context);
}
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;
}
};
function step(context) {
return new Step(context, 0.5);
}
function stepBefore(context) {
return new Step(context, 0);
}
function stepAfter(context) {
return new Step(context, 1);
}
function none(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];
}
}
}
function none$1(series) {
var n = series.length, o = new Array(n);
while (--n >= 0)
o[n] = n;
return o;
}
function stackValue(d, key) {
return d[key];
}
function stack() {
var keys = constant([]), order = none$1, offset = none, 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" ? _ : constant(slice.call(_)), stack) : keys;
};
stack.value = function (_) {
return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value;
};
stack.order = function (_) {
return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice.call(_)), stack) : order;
};
stack.offset = function (_) {
return arguments.length ? (offset = _ == null ? none : _, stack) : offset;
};
return stack;
}
function expand(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;
}
none(series, order);
}
function diverging(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;
}
}
}
}
function silhouette(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;
}
none(series, order);
}
function wiggle(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;
none(series, order);
}
function appearance(series) {
var peaks = series.map(peak);
return none$1(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;
}
function ascending(series) {
var sums = series.map(sum);
return none$1(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;
}
function descending$1(series) {
return ascending(series).reverse();
}
function insideOut(series) {
var n = series.length, i, j, sums = series.map(sum), order = appearance(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);
}
function reverse(series) {
return none$1(series).reverse();
}
exports.arc = arc;
exports.area = area;
exports.areaRadial = areaRadial;
exports.curveBasis = basis;
exports.curveBasisClosed = basisClosed;
exports.curveBasisOpen = basisOpen;
exports.curveBundle = bundle;
exports.curveCardinal = cardinal;
exports.curveCardinalClosed = cardinalClosed;
exports.curveCardinalOpen = cardinalOpen;
exports.curveCatmullRom = catmullRom;
exports.curveCatmullRomClosed = catmullRomClosed;
exports.curveCatmullRomOpen = catmullRomOpen;
exports.curveLinear = curveLinear;
exports.curveLinearClosed = linearClosed;
exports.curveMonotoneX = monotoneX;
exports.curveMonotoneY = monotoneY;
exports.curveNatural = natural;
exports.curveStep = step;
exports.curveStepAfter = stepAfter;
exports.curveStepBefore = stepBefore;
exports.line = line;
exports.lineRadial = lineRadial$1;
exports.linkHorizontal = linkHorizontal;
exports.linkRadial = linkRadial;
exports.linkVertical = linkVertical;
exports.pie = pie;
exports.pointRadial = pointRadial;
exports.radialArea = areaRadial;
exports.radialLine = lineRadial$1;
exports.stack = stack;
exports.stackOffsetDiverging = diverging;
exports.stackOffsetExpand = expand;
exports.stackOffsetNone = none;
exports.stackOffsetSilhouette = silhouette;
exports.stackOffsetWiggle = wiggle;
exports.stackOrderAppearance = appearance;
exports.stackOrderAscending = ascending;
exports.stackOrderDescending = descending$1;
exports.stackOrderInsideOut = insideOut;
exports.stackOrderNone = none$1;
exports.stackOrderReverse = reverse;
exports.symbol = symbol;
exports.symbolCircle = circle;
exports.symbolCross = cross;
exports.symbolDiamond = diamond;
exports.symbolSquare = square;
exports.symbolStar = star;
exports.symbolTriangle = triangle;
exports.symbolWye = wye;
exports.symbols = symbols;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/***/ "./node_modules/_d3-voronoi@1.1.4@d3-voronoi/dist/d3-voronoi.js":
/*!**********************************************************************!*\
!*** ./node_modules/_d3-voronoi@1.1.4@d3-voronoi/dist/d3-voronoi.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org/d3-voronoi/ v1.1.4 Copyright 2018 Mike Bostock
(function (global, factory) {
true ? factory(exports) :
undefined;
}(this, (function (exports) {
'use strict';
function constant(x) {
return function () {
return x;
};
}
function x(d) {
return d[0];
}
function y(d) {
return d[1];
}
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;
}
function createEdge(left, right, v0, v1) {
var edge = [null, null], index = edges.push(edge) - 1;
edge.left = left;
edge.right = right;
if (v0)
setEdgeEnd(edge, left, right, v0);
if (v1)
setEdgeEnd(edge, right, left, v1);
cells[left.index].halfedges.push(index);
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;
}
}
// LiangBarsky 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 = edges.length, edge;
while (i--) {
if (!connectEdge(edge = edges[i], x0, y0, x1, y1)
|| !clipEdge(edge, x0, y0, x1, y1)
|| !(Math.abs(edge[0][0] - edge[1][0]) > epsilon
|| Math.abs(edge[0][1] - edge[1][1]) > epsilon)) {
delete edges[i];
}
}
}
function createCell(site) {
return 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 = cells.length, cell, halfedges, j, m; i < n; ++i) {
if ((cell = 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, 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 = cells.length, iCell, cell, site, iHalfedge, halfedges, nHalfedges, start, startX, startY, end, endX, endY, cover = true;
for (iCell = 0; iCell < nCells; ++iCell) {
if (cell = cells[iCell]) {
site = cell.site;
halfedges = cell.halfedges;
iHalfedge = halfedges.length;
// Remove any dangling clipped edges.
while (iHalfedge--) {
if (!edges[halfedges[iHalfedge]]) {
halfedges.splice(iHalfedge, 1);
}
}
// Insert any border edges as necessary.
iHalfedge = 0, nHalfedges = halfedges.length;
while (iHalfedge < nHalfedges) {
end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];
start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];
if (Math.abs(endX - startX) > epsilon || Math.abs(endY - startY) > epsilon) {
halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end, Math.abs(endX - x0) < epsilon && y1 - endY > epsilon ? [x0, Math.abs(startX - x0) < epsilon ? startY : y1]
: Math.abs(endY - y1) < epsilon && x1 - endX > epsilon ? [Math.abs(startY - y1) < epsilon ? startX : x1, y1]
: Math.abs(endX - x1) < epsilon && endY - y0 > epsilon ? [x1, Math.abs(startX - x1) < epsilon ? startY : y0]
: Math.abs(endY - y0) < epsilon && endX - x0 > epsilon ? [Math.abs(startY - y0) < epsilon ? startX : x0, y0]
: null)) - 1);
++nHalfedges;
}
}
if (nHalfedges)
cover = false;
}
}
// If there werent any edges, have the closest site cover the extent.
// It doesnt 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 = 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(edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1, edges.push(createBorderEdge(site, v01, v11)) - 1, edges.push(createBorderEdge(site, v11, v10)) - 1, edges.push(createBorderEdge(site, v10, v00)) - 1);
}
}
// Lastly delete any cells with no edges; these were entirely clipped.
for (iCell = 0; iCell < nCells; ++iCell) {
if (cell = cells[iCell]) {
if (!cell.halfedges.length) {
delete cells[iCell];
}
}
}
}
var circlePool = [];
var firstCircle;
function Circle() {
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 >= -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 = 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;
}
}
}
circles.insert(before, circle);
if (!before)
firstCircle = circle;
}
function detachCircle(arc) {
var circle = arc.circle;
if (circle) {
if (!circle.P)
firstCircle = circle.N;
circles.remove(circle);
circlePool.push(circle);
RedBlackNode(circle);
arc.circle = null;
}
}
var beachPool = [];
function Beach() {
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) {
detachCircle(beach);
beaches.remove(beach);
beachPool.push(beach);
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) < epsilon
&& Math.abs(y - lArc.circle.cy) < epsilon) {
previous = lArc.P;
disappearing.unshift(lArc);
detachBeach(lArc);
lArc = previous;
}
disappearing.unshift(lArc);
detachCircle(lArc);
var rArc = next;
while (rArc.circle
&& Math.abs(x - rArc.circle.x) < epsilon
&& Math.abs(y - rArc.circle.cy) < epsilon) {
next = rArc.N;
disappearing.push(rArc);
detachBeach(rArc);
rArc = next;
}
disappearing.push(rArc);
detachCircle(rArc);
var nArcs = disappearing.length, iArc;
for (iArc = 1; iArc < nArcs; ++iArc) {
rArc = disappearing[iArc];
lArc = disappearing[iArc - 1];
setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
}
lArc = disappearing[0];
rArc = disappearing[nArcs - 1];
rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);
attachCircle(lArc);
attachCircle(rArc);
}
function addBeach(site) {
var x = site[0], directrix = site[1], lArc, rArc, dxl, dxr, node = beaches._;
while (node) {
dxl = leftBreakPoint(node, directrix) - x;
if (dxl > epsilon)
node = node.L;
else {
dxr = x - rightBreakPoint(node, directrix);
if (dxr > epsilon) {
if (!node.R) {
lArc = node;
break;
}
node = node.R;
}
else {
if (dxl > -epsilon) {
lArc = node.P;
rArc = node;
}
else if (dxr > -epsilon) {
lArc = node;
rArc = node.N;
}
else {
lArc = rArc = node;
}
break;
}
}
}
createCell(site);
var newArc = createBeach(site);
beaches.insert(lArc, newArc);
if (!lArc && !rArc)
return;
if (lArc === rArc) {
detachCircle(lArc);
rArc = createBeach(lArc.site);
beaches.insert(newArc, rArc);
newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);
attachCircle(lArc);
attachCircle(rArc);
return;
}
if (!rArc) { // && lArc
newArc.edge = createEdge(lArc.site, newArc.site);
return;
}
// else lArc !== rArc
detachCircle(lArc);
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];
setEdgeEnd(rArc.edge, lSite, rSite, vertex);
newArc.edge = createEdge(lSite, site, null, vertex);
rArc.edge = createEdge(site, rSite, null, vertex);
attachCircle(lArc);
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;
}
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;
circles = new RedBlackTree;
while (true) {
circle = firstCircle;
if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {
if (site[0] !== x || site[1] !== y) {
addBeach(site);
x = site[0], y = site[1];
}
site = sites.pop();
}
else if (circle) {
removeBeach(circle.arc);
}
else {
break;
}
}
sortCellHalfedges();
if (extent) {
var x0 = +extent[0][0], y0 = +extent[0][1], x1 = +extent[1][0], y1 = +extent[1][1];
clipEdges(x0, y0, x1, y1);
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 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;
}
};
function voronoi() {
var x$$1 = x, y$$1 = y, extent = null;
function voronoi(data) {
return new Diagram(data.map(function (d, i) {
var s = [Math.round(x$$1(d, i, data) / epsilon) * epsilon, Math.round(y$$1(d, i, data) / epsilon) * 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$$1 = typeof _ === "function" ? _ : constant(+_), voronoi) : x$$1;
};
voronoi.y = function (_) {
return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant(+_), voronoi) : y$$1;
};
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;
}
exports.voronoi = voronoi;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/index.js":
/*!**************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/index.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/*
Copyright (c) 2012-2014 Chris Pettitt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
module.exports = {
graphlib: __webpack_require__(/*! ./lib/graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js"),
layout: __webpack_require__(/*! ./lib/layout */ "./node_modules/_dagre@0.8.5@dagre/lib/layout.js"),
debug: __webpack_require__(/*! ./lib/debug */ "./node_modules/_dagre@0.8.5@dagre/lib/debug.js"),
util: {
time: __webpack_require__(/*! ./lib/util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js").time,
notime: __webpack_require__(/*! ./lib/util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js").notime
},
version: __webpack_require__(/*! ./lib/version */ "./node_modules/_dagre@0.8.5@dagre/lib/version.js")
};
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/acyclic.js":
/*!********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/acyclic.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var greedyFAS = __webpack_require__(/*! ./greedy-fas */ "./node_modules/_dagre@0.8.5@dagre/lib/greedy-fas.js");
module.exports = {
run: run,
undo: undo
};
function run(g) {
var fas = (g.graph().acyclicer === "greedy"
? greedyFAS(g, weightFn(g))
: dfsFAS(g));
_.forEach(fas, function(e) {
var label = g.edge(e);
g.removeEdge(e);
label.forwardName = e.name;
label.reversed = true;
g.setEdge(e.w, e.v, label, _.uniqueId("rev"));
});
function weightFn(g) {
return function(e) {
return g.edge(e).weight;
};
}
}
function dfsFAS(g) {
var fas = [];
var stack = {};
var visited = {};
function dfs(v) {
if (_.has(visited, v)) {
return;
}
visited[v] = true;
stack[v] = true;
_.forEach(g.outEdges(v), function(e) {
if (_.has(stack, e.w)) {
fas.push(e);
} else {
dfs(e.w);
}
});
delete stack[v];
}
_.forEach(g.nodes(), dfs);
return fas;
}
function undo(g) {
_.forEach(g.edges(), function(e) {
var label = g.edge(e);
if (label.reversed) {
g.removeEdge(e);
var forwardName = label.forwardName;
delete label.reversed;
delete label.forwardName;
g.setEdge(e.w, e.v, label, forwardName);
}
});
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/add-border-segments.js":
/*!********************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/add-border-segments.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var util = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
module.exports = addBorderSegments;
function addBorderSegments(g) {
function dfs(v) {
var children = g.children(v);
var node = g.node(v);
if (children.length) {
_.forEach(children, dfs);
}
if (_.has(node, "minRank")) {
node.borderLeft = [];
node.borderRight = [];
for (var rank = node.minRank, maxRank = node.maxRank + 1;
rank < maxRank;
++rank) {
addBorderNode(g, "borderLeft", "_bl", v, node, rank);
addBorderNode(g, "borderRight", "_br", v, node, rank);
}
}
}
_.forEach(g.children(), dfs);
}
function addBorderNode(g, prop, prefix, sg, sgNode, rank) {
var label = { width: 0, height: 0, rank: rank, borderType: prop };
var prev = sgNode[prop][rank - 1];
var curr = util.addDummyNode(g, "border", label, prefix);
sgNode[prop][rank] = curr;
g.setParent(curr, sg);
if (prev) {
g.setEdge(prev, curr, { weight: 1 });
}
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/coordinate-system.js":
/*!******************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/coordinate-system.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = {
adjust: adjust,
undo: undo
};
function adjust(g) {
var rankDir = g.graph().rankdir.toLowerCase();
if (rankDir === "lr" || rankDir === "rl") {
swapWidthHeight(g);
}
}
function undo(g) {
var rankDir = g.graph().rankdir.toLowerCase();
if (rankDir === "bt" || rankDir === "rl") {
reverseY(g);
}
if (rankDir === "lr" || rankDir === "rl") {
swapXY(g);
swapWidthHeight(g);
}
}
function swapWidthHeight(g) {
_.forEach(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); });
_.forEach(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); });
}
function swapWidthHeightOne(attrs) {
var w = attrs.width;
attrs.width = attrs.height;
attrs.height = w;
}
function reverseY(g) {
_.forEach(g.nodes(), function(v) { reverseYOne(g.node(v)); });
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
_.forEach(edge.points, reverseYOne);
if (_.has(edge, "y")) {
reverseYOne(edge);
}
});
}
function reverseYOne(attrs) {
attrs.y = -attrs.y;
}
function swapXY(g) {
_.forEach(g.nodes(), function(v) { swapXYOne(g.node(v)); });
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
_.forEach(edge.points, swapXYOne);
if (_.has(edge, "x")) {
swapXYOne(edge);
}
});
}
function swapXYOne(attrs) {
var x = attrs.x;
attrs.x = attrs.y;
attrs.y = x;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/data/list.js":
/*!**********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/data/list.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/*
* Simple doubly linked list implementation derived from Cormen, et al.,
* "Introduction to Algorithms".
*/
module.exports = List;
function List() {
var sentinel = {};
sentinel._next = sentinel._prev = sentinel;
this._sentinel = sentinel;
}
List.prototype.dequeue = function() {
var sentinel = this._sentinel;
var entry = sentinel._prev;
if (entry !== sentinel) {
unlink(entry);
return entry;
}
};
List.prototype.enqueue = function(entry) {
var sentinel = this._sentinel;
if (entry._prev && entry._next) {
unlink(entry);
}
entry._next = sentinel._next;
sentinel._next._prev = entry;
sentinel._next = entry;
entry._prev = sentinel;
};
List.prototype.toString = function() {
var strs = [];
var sentinel = this._sentinel;
var curr = sentinel._prev;
while (curr !== sentinel) {
strs.push(JSON.stringify(curr, filterOutLinks));
curr = curr._prev;
}
return "[" + strs.join(", ") + "]";
};
function unlink(entry) {
entry._prev._next = entry._next;
entry._next._prev = entry._prev;
delete entry._next;
delete entry._prev;
}
function filterOutLinks(k, v) {
if (k !== "_next" && k !== "_prev") {
return v;
}
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/debug.js":
/*!******************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/debug.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var util = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
var Graph = __webpack_require__(/*! ./graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
module.exports = {
debugOrdering: debugOrdering
};
/* istanbul ignore next */
function debugOrdering(g) {
var layerMatrix = util.buildLayerMatrix(g);
var h = new Graph({ compound: true, multigraph: true }).setGraph({});
_.forEach(g.nodes(), function(v) {
h.setNode(v, { label: v });
h.setParent(v, "layer" + g.node(v).rank);
});
_.forEach(g.edges(), function(e) {
h.setEdge(e.v, e.w, {}, e.name);
});
_.forEach(layerMatrix, function(layer, i) {
var layerV = "layer" + i;
h.setNode(layerV, { rank: "same" });
_.reduce(layer, function(u, v) {
h.setEdge(u, v, { style: "invis" });
return v;
});
});
return h;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js":
/*!*********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* global window */
var graphlib;
if (true) {
try {
graphlib = __webpack_require__(/*! graphlib */ "./node_modules/_graphlib@2.1.8@graphlib/index.js");
} catch (e) {
// continue regardless of error
}
}
if (!graphlib) {
graphlib = window.graphlib;
}
module.exports = graphlib;
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/greedy-fas.js":
/*!***********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/greedy-fas.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var Graph = __webpack_require__(/*! ./graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
var List = __webpack_require__(/*! ./data/list */ "./node_modules/_dagre@0.8.5@dagre/lib/data/list.js");
/*
* A greedy heuristic for finding a feedback arc set for a graph. A feedback
* arc set is a set of edges that can be removed to make a graph acyclic.
* The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and
* effective heuristic for the feedback arc set problem." This implementation
* adjusts that from the paper to allow for weighted edges.
*/
module.exports = greedyFAS;
var DEFAULT_WEIGHT_FN = _.constant(1);
function greedyFAS(g, weightFn) {
if (g.nodeCount() <= 1) {
return [];
}
var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);
var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx);
// Expand multi-edges
return _.flatten(_.map(results, function(e) {
return g.outEdges(e.v, e.w);
}), true);
}
function doGreedyFAS(g, buckets, zeroIdx) {
var results = [];
var sources = buckets[buckets.length - 1];
var sinks = buckets[0];
var entry;
while (g.nodeCount()) {
while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }
while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }
if (g.nodeCount()) {
for (var i = buckets.length - 2; i > 0; --i) {
entry = buckets[i].dequeue();
if (entry) {
results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));
break;
}
}
}
}
return results;
}
function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) {
var results = collectPredecessors ? [] : undefined;
_.forEach(g.inEdges(entry.v), function(edge) {
var weight = g.edge(edge);
var uEntry = g.node(edge.v);
if (collectPredecessors) {
results.push({ v: edge.v, w: edge.w });
}
uEntry.out -= weight;
assignBucket(buckets, zeroIdx, uEntry);
});
_.forEach(g.outEdges(entry.v), function(edge) {
var weight = g.edge(edge);
var w = edge.w;
var wEntry = g.node(w);
wEntry["in"] -= weight;
assignBucket(buckets, zeroIdx, wEntry);
});
g.removeNode(entry.v);
return results;
}
function buildState(g, weightFn) {
var fasGraph = new Graph();
var maxIn = 0;
var maxOut = 0;
_.forEach(g.nodes(), function(v) {
fasGraph.setNode(v, { v: v, "in": 0, out: 0 });
});
// Aggregate weights on nodes, but also sum the weights across multi-edges
// into a single edge for the fasGraph.
_.forEach(g.edges(), function(e) {
var prevWeight = fasGraph.edge(e.v, e.w) || 0;
var weight = weightFn(e);
var edgeWeight = prevWeight + weight;
fasGraph.setEdge(e.v, e.w, edgeWeight);
maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight);
maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight);
});
var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); });
var zeroIdx = maxIn + 1;
_.forEach(fasGraph.nodes(), function(v) {
assignBucket(buckets, zeroIdx, fasGraph.node(v));
});
return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx };
}
function assignBucket(buckets, zeroIdx, entry) {
if (!entry.out) {
buckets[0].enqueue(entry);
} else if (!entry["in"]) {
buckets[buckets.length - 1].enqueue(entry);
} else {
buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry);
}
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/layout.js":
/*!*******************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/layout.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var acyclic = __webpack_require__(/*! ./acyclic */ "./node_modules/_dagre@0.8.5@dagre/lib/acyclic.js");
var normalize = __webpack_require__(/*! ./normalize */ "./node_modules/_dagre@0.8.5@dagre/lib/normalize.js");
var rank = __webpack_require__(/*! ./rank */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/index.js");
var normalizeRanks = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js").normalizeRanks;
var parentDummyChains = __webpack_require__(/*! ./parent-dummy-chains */ "./node_modules/_dagre@0.8.5@dagre/lib/parent-dummy-chains.js");
var removeEmptyRanks = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js").removeEmptyRanks;
var nestingGraph = __webpack_require__(/*! ./nesting-graph */ "./node_modules/_dagre@0.8.5@dagre/lib/nesting-graph.js");
var addBorderSegments = __webpack_require__(/*! ./add-border-segments */ "./node_modules/_dagre@0.8.5@dagre/lib/add-border-segments.js");
var coordinateSystem = __webpack_require__(/*! ./coordinate-system */ "./node_modules/_dagre@0.8.5@dagre/lib/coordinate-system.js");
var order = __webpack_require__(/*! ./order */ "./node_modules/_dagre@0.8.5@dagre/lib/order/index.js");
var position = __webpack_require__(/*! ./position */ "./node_modules/_dagre@0.8.5@dagre/lib/position/index.js");
var util = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
var Graph = __webpack_require__(/*! ./graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
module.exports = layout;
function layout(g, opts) {
var time = opts && opts.debugTiming ? util.time : util.notime;
time("layout", function() {
var layoutGraph =
time(" buildLayoutGraph", function() { return buildLayoutGraph(g); });
time(" runLayout", function() { runLayout(layoutGraph, time); });
time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); });
});
}
function runLayout(g, time) {
time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); });
time(" removeSelfEdges", function() { removeSelfEdges(g); });
time(" acyclic", function() { acyclic.run(g); });
time(" nestingGraph.run", function() { nestingGraph.run(g); });
time(" rank", function() { rank(util.asNonCompoundGraph(g)); });
time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); });
time(" removeEmptyRanks", function() { removeEmptyRanks(g); });
time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); });
time(" normalizeRanks", function() { normalizeRanks(g); });
time(" assignRankMinMax", function() { assignRankMinMax(g); });
time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); });
time(" normalize.run", function() { normalize.run(g); });
time(" parentDummyChains", function() { parentDummyChains(g); });
time(" addBorderSegments", function() { addBorderSegments(g); });
time(" order", function() { order(g); });
time(" insertSelfEdges", function() { insertSelfEdges(g); });
time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); });
time(" position", function() { position(g); });
time(" positionSelfEdges", function() { positionSelfEdges(g); });
time(" removeBorderNodes", function() { removeBorderNodes(g); });
time(" normalize.undo", function() { normalize.undo(g); });
time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); });
time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); });
time(" translateGraph", function() { translateGraph(g); });
time(" assignNodeIntersects", function() { assignNodeIntersects(g); });
time(" reversePoints", function() { reversePointsForReversedEdges(g); });
time(" acyclic.undo", function() { acyclic.undo(g); });
}
/*
* Copies final layout information from the layout graph back to the input
* graph. This process only copies whitelisted attributes from the layout graph
* to the input graph, so it serves as a good place to determine what
* attributes can influence layout.
*/
function updateInputGraph(inputGraph, layoutGraph) {
_.forEach(inputGraph.nodes(), function(v) {
var inputLabel = inputGraph.node(v);
var layoutLabel = layoutGraph.node(v);
if (inputLabel) {
inputLabel.x = layoutLabel.x;
inputLabel.y = layoutLabel.y;
if (layoutGraph.children(v).length) {
inputLabel.width = layoutLabel.width;
inputLabel.height = layoutLabel.height;
}
}
});
_.forEach(inputGraph.edges(), function(e) {
var inputLabel = inputGraph.edge(e);
var layoutLabel = layoutGraph.edge(e);
inputLabel.points = layoutLabel.points;
if (_.has(layoutLabel, "x")) {
inputLabel.x = layoutLabel.x;
inputLabel.y = layoutLabel.y;
}
});
inputGraph.graph().width = layoutGraph.graph().width;
inputGraph.graph().height = layoutGraph.graph().height;
}
var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"];
var graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" };
var graphAttrs = ["acyclicer", "ranker", "rankdir", "align"];
var nodeNumAttrs = ["width", "height"];
var nodeDefaults = { width: 0, height: 0 };
var edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"];
var edgeDefaults = {
minlen: 1, weight: 1, width: 0, height: 0,
labeloffset: 10, labelpos: "r"
};
var edgeAttrs = ["labelpos"];
/*
* Constructs a new graph from the input graph, which can be used for layout.
* This process copies only whitelisted attributes from the input graph to the
* layout graph. Thus this function serves as a good place to determine what
* attributes can influence layout.
*/
function buildLayoutGraph(inputGraph) {
var g = new Graph({ multigraph: true, compound: true });
var graph = canonicalize(inputGraph.graph());
g.setGraph(_.merge({},
graphDefaults,
selectNumberAttrs(graph, graphNumAttrs),
_.pick(graph, graphAttrs)));
_.forEach(inputGraph.nodes(), function(v) {
var node = canonicalize(inputGraph.node(v));
g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults));
g.setParent(v, inputGraph.parent(v));
});
_.forEach(inputGraph.edges(), function(e) {
var edge = canonicalize(inputGraph.edge(e));
g.setEdge(e, _.merge({},
edgeDefaults,
selectNumberAttrs(edge, edgeNumAttrs),
_.pick(edge, edgeAttrs)));
});
return g;
}
/*
* This idea comes from the Gansner paper: to account for edge labels in our
* layout we split each rank in half by doubling minlen and halving ranksep.
* Then we can place labels at these mid-points between nodes.
*
* We also add some minimal padding to the width to push the label for the edge
* away from the edge itself a bit.
*/
function makeSpaceForEdgeLabels(g) {
var graph = g.graph();
graph.ranksep /= 2;
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
edge.minlen *= 2;
if (edge.labelpos.toLowerCase() !== "c") {
if (graph.rankdir === "TB" || graph.rankdir === "BT") {
edge.width += edge.labeloffset;
} else {
edge.height += edge.labeloffset;
}
}
});
}
/*
* Creates temporary dummy nodes that capture the rank in which each edge's
* label is going to, if it has one of non-zero width and height. We do this
* so that we can safely remove empty ranks while preserving balance for the
* label's position.
*/
function injectEdgeLabelProxies(g) {
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
if (edge.width && edge.height) {
var v = g.node(e.v);
var w = g.node(e.w);
var label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e };
util.addDummyNode(g, "edge-proxy", label, "_ep");
}
});
}
function assignRankMinMax(g) {
var maxRank = 0;
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
if (node.borderTop) {
node.minRank = g.node(node.borderTop).rank;
node.maxRank = g.node(node.borderBottom).rank;
maxRank = _.max(maxRank, node.maxRank);
}
});
g.graph().maxRank = maxRank;
}
function removeEdgeLabelProxies(g) {
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
if (node.dummy === "edge-proxy") {
g.edge(node.e).labelRank = node.rank;
g.removeNode(v);
}
});
}
function translateGraph(g) {
var minX = Number.POSITIVE_INFINITY;
var maxX = 0;
var minY = Number.POSITIVE_INFINITY;
var maxY = 0;
var graphLabel = g.graph();
var marginX = graphLabel.marginx || 0;
var marginY = graphLabel.marginy || 0;
function getExtremes(attrs) {
var x = attrs.x;
var y = attrs.y;
var w = attrs.width;
var h = attrs.height;
minX = Math.min(minX, x - w / 2);
maxX = Math.max(maxX, x + w / 2);
minY = Math.min(minY, y - h / 2);
maxY = Math.max(maxY, y + h / 2);
}
_.forEach(g.nodes(), function(v) { getExtremes(g.node(v)); });
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
if (_.has(edge, "x")) {
getExtremes(edge);
}
});
minX -= marginX;
minY -= marginY;
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
node.x -= minX;
node.y -= minY;
});
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
_.forEach(edge.points, function(p) {
p.x -= minX;
p.y -= minY;
});
if (_.has(edge, "x")) { edge.x -= minX; }
if (_.has(edge, "y")) { edge.y -= minY; }
});
graphLabel.width = maxX - minX + marginX;
graphLabel.height = maxY - minY + marginY;
}
function assignNodeIntersects(g) {
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
var nodeV = g.node(e.v);
var nodeW = g.node(e.w);
var p1, p2;
if (!edge.points) {
edge.points = [];
p1 = nodeW;
p2 = nodeV;
} else {
p1 = edge.points[0];
p2 = edge.points[edge.points.length - 1];
}
edge.points.unshift(util.intersectRect(nodeV, p1));
edge.points.push(util.intersectRect(nodeW, p2));
});
}
function fixupEdgeLabelCoords(g) {
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
if (_.has(edge, "x")) {
if (edge.labelpos === "l" || edge.labelpos === "r") {
edge.width -= edge.labeloffset;
}
switch (edge.labelpos) {
case "l": edge.x -= edge.width / 2 + edge.labeloffset; break;
case "r": edge.x += edge.width / 2 + edge.labeloffset; break;
}
}
});
}
function reversePointsForReversedEdges(g) {
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
if (edge.reversed) {
edge.points.reverse();
}
});
}
function removeBorderNodes(g) {
_.forEach(g.nodes(), function(v) {
if (g.children(v).length) {
var node = g.node(v);
var t = g.node(node.borderTop);
var b = g.node(node.borderBottom);
var l = g.node(_.last(node.borderLeft));
var r = g.node(_.last(node.borderRight));
node.width = Math.abs(r.x - l.x);
node.height = Math.abs(b.y - t.y);
node.x = l.x + node.width / 2;
node.y = t.y + node.height / 2;
}
});
_.forEach(g.nodes(), function(v) {
if (g.node(v).dummy === "border") {
g.removeNode(v);
}
});
}
function removeSelfEdges(g) {
_.forEach(g.edges(), function(e) {
if (e.v === e.w) {
var node = g.node(e.v);
if (!node.selfEdges) {
node.selfEdges = [];
}
node.selfEdges.push({ e: e, label: g.edge(e) });
g.removeEdge(e);
}
});
}
function insertSelfEdges(g) {
var layers = util.buildLayerMatrix(g);
_.forEach(layers, function(layer) {
var orderShift = 0;
_.forEach(layer, function(v, i) {
var node = g.node(v);
node.order = i + orderShift;
_.forEach(node.selfEdges, function(selfEdge) {
util.addDummyNode(g, "selfedge", {
width: selfEdge.label.width,
height: selfEdge.label.height,
rank: node.rank,
order: i + (++orderShift),
e: selfEdge.e,
label: selfEdge.label
}, "_se");
});
delete node.selfEdges;
});
});
}
function positionSelfEdges(g) {
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
if (node.dummy === "selfedge") {
var selfNode = g.node(node.e.v);
var x = selfNode.x + selfNode.width / 2;
var y = selfNode.y;
var dx = node.x - x;
var dy = selfNode.height / 2;
g.setEdge(node.e, node.label);
g.removeNode(v);
node.label.points = [
{ x: x + 2 * dx / 3, y: y - dy },
{ x: x + 5 * dx / 6, y: y - dy },
{ x: x + dx , y: y },
{ x: x + 5 * dx / 6, y: y + dy },
{ x: x + 2 * dx / 3, y: y + dy }
];
node.label.x = node.x;
node.label.y = node.y;
}
});
}
function selectNumberAttrs(obj, attrs) {
return _.mapValues(_.pick(obj, attrs), Number);
}
function canonicalize(attrs) {
var newAttrs = {};
_.forEach(attrs, function(v, k) {
newAttrs[k.toLowerCase()] = v;
});
return newAttrs;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js":
/*!*******************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/lodash.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* global window */
var lodash;
if (true) {
try {
lodash = {
cloneDeep: __webpack_require__(/*! lodash/cloneDeep */ "./node_modules/_lodash@4.17.20@lodash/cloneDeep.js"),
constant: __webpack_require__(/*! lodash/constant */ "./node_modules/_lodash@4.17.20@lodash/constant.js"),
defaults: __webpack_require__(/*! lodash/defaults */ "./node_modules/_lodash@4.17.20@lodash/defaults.js"),
each: __webpack_require__(/*! lodash/each */ "./node_modules/_lodash@4.17.20@lodash/each.js"),
filter: __webpack_require__(/*! lodash/filter */ "./node_modules/_lodash@4.17.20@lodash/filter.js"),
find: __webpack_require__(/*! lodash/find */ "./node_modules/_lodash@4.17.20@lodash/find.js"),
flatten: __webpack_require__(/*! lodash/flatten */ "./node_modules/_lodash@4.17.20@lodash/flatten.js"),
forEach: __webpack_require__(/*! lodash/forEach */ "./node_modules/_lodash@4.17.20@lodash/forEach.js"),
forIn: __webpack_require__(/*! lodash/forIn */ "./node_modules/_lodash@4.17.20@lodash/forIn.js"),
has: __webpack_require__(/*! lodash/has */ "./node_modules/_lodash@4.17.20@lodash/has.js"),
isUndefined: __webpack_require__(/*! lodash/isUndefined */ "./node_modules/_lodash@4.17.20@lodash/isUndefined.js"),
last: __webpack_require__(/*! lodash/last */ "./node_modules/_lodash@4.17.20@lodash/last.js"),
map: __webpack_require__(/*! lodash/map */ "./node_modules/_lodash@4.17.20@lodash/map.js"),
mapValues: __webpack_require__(/*! lodash/mapValues */ "./node_modules/_lodash@4.17.20@lodash/mapValues.js"),
max: __webpack_require__(/*! lodash/max */ "./node_modules/_lodash@4.17.20@lodash/max.js"),
merge: __webpack_require__(/*! lodash/merge */ "./node_modules/_lodash@4.17.20@lodash/merge.js"),
min: __webpack_require__(/*! lodash/min */ "./node_modules/_lodash@4.17.20@lodash/min.js"),
minBy: __webpack_require__(/*! lodash/minBy */ "./node_modules/_lodash@4.17.20@lodash/minBy.js"),
now: __webpack_require__(/*! lodash/now */ "./node_modules/_lodash@4.17.20@lodash/now.js"),
pick: __webpack_require__(/*! lodash/pick */ "./node_modules/_lodash@4.17.20@lodash/pick.js"),
range: __webpack_require__(/*! lodash/range */ "./node_modules/_lodash@4.17.20@lodash/range.js"),
reduce: __webpack_require__(/*! lodash/reduce */ "./node_modules/_lodash@4.17.20@lodash/reduce.js"),
sortBy: __webpack_require__(/*! lodash/sortBy */ "./node_modules/_lodash@4.17.20@lodash/sortBy.js"),
uniqueId: __webpack_require__(/*! lodash/uniqueId */ "./node_modules/_lodash@4.17.20@lodash/uniqueId.js"),
values: __webpack_require__(/*! lodash/values */ "./node_modules/_lodash@4.17.20@lodash/values.js"),
zipObject: __webpack_require__(/*! lodash/zipObject */ "./node_modules/_lodash@4.17.20@lodash/zipObject.js"),
};
} catch (e) {
// continue regardless of error
}
}
if (!lodash) {
lodash = window._;
}
module.exports = lodash;
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/nesting-graph.js":
/*!**************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/nesting-graph.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var util = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
module.exports = {
run: run,
cleanup: cleanup
};
/*
* A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,
* adds appropriate edges to ensure that all cluster nodes are placed between
* these boundries, and ensures that the graph is connected.
*
* In addition we ensure, through the use of the minlen property, that nodes
* and subgraph border nodes to not end up on the same rank.
*
* Preconditions:
*
* 1. Input graph is a DAG
* 2. Nodes in the input graph has a minlen attribute
*
* Postconditions:
*
* 1. Input graph is connected.
* 2. Dummy nodes are added for the tops and bottoms of subgraphs.
* 3. The minlen attribute for nodes is adjusted to ensure nodes do not
* get placed on the same rank as subgraph border nodes.
*
* The nesting graph idea comes from Sander, "Layout of Compound Directed
* Graphs."
*/
function run(g) {
var root = util.addDummyNode(g, "root", {}, "_root");
var depths = treeDepths(g);
var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array
var nodeSep = 2 * height + 1;
g.graph().nestingRoot = root;
// Multiply minlen by nodeSep to align nodes on non-border ranks.
_.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });
// Calculate a weight that is sufficient to keep subgraphs vertically compact
var weight = sumWeights(g) + 1;
// Create border nodes and link them up
_.forEach(g.children(), function(child) {
dfs(g, root, nodeSep, weight, height, depths, child);
});
// Save the multiplier for node layers for later removal of empty border
// layers.
g.graph().nodeRankFactor = nodeSep;
}
function dfs(g, root, nodeSep, weight, height, depths, v) {
var children = g.children(v);
if (!children.length) {
if (v !== root) {
g.setEdge(root, v, { weight: 0, minlen: nodeSep });
}
return;
}
var top = util.addBorderNode(g, "_bt");
var bottom = util.addBorderNode(g, "_bb");
var label = g.node(v);
g.setParent(top, v);
label.borderTop = top;
g.setParent(bottom, v);
label.borderBottom = bottom;
_.forEach(children, function(child) {
dfs(g, root, nodeSep, weight, height, depths, child);
var childNode = g.node(child);
var childTop = childNode.borderTop ? childNode.borderTop : child;
var childBottom = childNode.borderBottom ? childNode.borderBottom : child;
var thisWeight = childNode.borderTop ? weight : 2 * weight;
var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;
g.setEdge(top, childTop, {
weight: thisWeight,
minlen: minlen,
nestingEdge: true
});
g.setEdge(childBottom, bottom, {
weight: thisWeight,
minlen: minlen,
nestingEdge: true
});
});
if (!g.parent(v)) {
g.setEdge(root, top, { weight: 0, minlen: height + depths[v] });
}
}
function treeDepths(g) {
var depths = {};
function dfs(v, depth) {
var children = g.children(v);
if (children && children.length) {
_.forEach(children, function(child) {
dfs(child, depth + 1);
});
}
depths[v] = depth;
}
_.forEach(g.children(), function(v) { dfs(v, 1); });
return depths;
}
function sumWeights(g) {
return _.reduce(g.edges(), function(acc, e) {
return acc + g.edge(e).weight;
}, 0);
}
function cleanup(g) {
var graphLabel = g.graph();
g.removeNode(graphLabel.nestingRoot);
delete graphLabel.nestingRoot;
_.forEach(g.edges(), function(e) {
var edge = g.edge(e);
if (edge.nestingEdge) {
g.removeEdge(e);
}
});
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/normalize.js":
/*!**********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/normalize.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var util = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
module.exports = {
run: run,
undo: undo
};
/*
* Breaks any long edges in the graph into short segments that span 1 layer
* each. This operation is undoable with the denormalize function.
*
* Pre-conditions:
*
* 1. The input graph is a DAG.
* 2. Each node in the graph has a "rank" property.
*
* Post-condition:
*
* 1. All edges in the graph have a length of 1.
* 2. Dummy nodes are added where edges have been split into segments.
* 3. The graph is augmented with a "dummyChains" attribute which contains
* the first dummy in each chain of dummy nodes produced.
*/
function run(g) {
g.graph().dummyChains = [];
_.forEach(g.edges(), function(edge) { normalizeEdge(g, edge); });
}
function normalizeEdge(g, e) {
var v = e.v;
var vRank = g.node(v).rank;
var w = e.w;
var wRank = g.node(w).rank;
var name = e.name;
var edgeLabel = g.edge(e);
var labelRank = edgeLabel.labelRank;
if (wRank === vRank + 1) return;
g.removeEdge(e);
var dummy, attrs, i;
for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {
edgeLabel.points = [];
attrs = {
width: 0, height: 0,
edgeLabel: edgeLabel, edgeObj: e,
rank: vRank
};
dummy = util.addDummyNode(g, "edge", attrs, "_d");
if (vRank === labelRank) {
attrs.width = edgeLabel.width;
attrs.height = edgeLabel.height;
attrs.dummy = "edge-label";
attrs.labelpos = edgeLabel.labelpos;
}
g.setEdge(v, dummy, { weight: edgeLabel.weight }, name);
if (i === 0) {
g.graph().dummyChains.push(dummy);
}
v = dummy;
}
g.setEdge(v, w, { weight: edgeLabel.weight }, name);
}
function undo(g) {
_.forEach(g.graph().dummyChains, function(v) {
var node = g.node(v);
var origLabel = node.edgeLabel;
var w;
g.setEdge(node.edgeObj, origLabel);
while (node.dummy) {
w = g.successors(v)[0];
g.removeNode(v);
origLabel.points.push({ x: node.x, y: node.y });
if (node.dummy === "edge-label") {
origLabel.x = node.x;
origLabel.y = node.y;
origLabel.width = node.width;
origLabel.height = node.height;
}
v = w;
node = g.node(v);
}
});
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/add-subgraph-constraints.js":
/*!*******************************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/add-subgraph-constraints.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = addSubgraphConstraints;
function addSubgraphConstraints(g, cg, vs) {
var prev = {},
rootPrev;
_.forEach(vs, function(v) {
var child = g.parent(v),
parent,
prevChild;
while (child) {
parent = g.parent(child);
if (parent) {
prevChild = prev[parent];
prev[parent] = child;
} else {
prevChild = rootPrev;
rootPrev = child;
}
if (prevChild && prevChild !== child) {
cg.setEdge(prevChild, child);
return;
}
child = parent;
}
});
/*
function dfs(v) {
var children = v ? g.children(v) : g.children();
if (children.length) {
var min = Number.POSITIVE_INFINITY,
subgraphs = [];
_.each(children, function(child) {
var childMin = dfs(child);
if (g.children(child).length) {
subgraphs.push({ v: child, order: childMin });
}
min = Math.min(min, childMin);
});
_.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) {
cg.setEdge(prev.v, curr.v);
return curr;
});
return min;
}
return g.node(v).order;
}
dfs(undefined);
*/
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/barycenter.js":
/*!*****************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/barycenter.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = barycenter;
function barycenter(g, movable) {
return _.map(movable, function(v) {
var inV = g.inEdges(v);
if (!inV.length) {
return { v: v };
} else {
var result = _.reduce(inV, function(acc, e) {
var edge = g.edge(e),
nodeU = g.node(e.v);
return {
sum: acc.sum + (edge.weight * nodeU.order),
weight: acc.weight + edge.weight
};
}, { sum: 0, weight: 0 });
return {
v: v,
barycenter: result.sum / result.weight,
weight: result.weight
};
}
});
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/build-layer-graph.js":
/*!************************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/build-layer-graph.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var Graph = __webpack_require__(/*! ../graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
module.exports = buildLayerGraph;
/*
* Constructs a graph that can be used to sort a layer of nodes. The graph will
* contain all base and subgraph nodes from the request layer in their original
* hierarchy and any edges that are incident on these nodes and are of the type
* requested by the "relationship" parameter.
*
* Nodes from the requested rank that do not have parents are assigned a root
* node in the output graph, which is set in the root graph attribute. This
* makes it easy to walk the hierarchy of movable nodes during ordering.
*
* Pre-conditions:
*
* 1. Input graph is a DAG
* 2. Base nodes in the input graph have a rank attribute
* 3. Subgraph nodes in the input graph has minRank and maxRank attributes
* 4. Edges have an assigned weight
*
* Post-conditions:
*
* 1. Output graph has all nodes in the movable rank with preserved
* hierarchy.
* 2. Root nodes in the movable layer are made children of the node
* indicated by the root attribute of the graph.
* 3. Non-movable nodes incident on movable nodes, selected by the
* relationship parameter, are included in the graph (without hierarchy).
* 4. Edges incident on movable nodes, selected by the relationship
* parameter, are added to the output graph.
* 5. The weights for copied edges are aggregated as need, since the output
* graph is not a multi-graph.
*/
function buildLayerGraph(g, rank, relationship) {
var root = createRootNode(g),
result = new Graph({ compound: true }).setGraph({ root: root })
.setDefaultNodeLabel(function(v) { return g.node(v); });
_.forEach(g.nodes(), function(v) {
var node = g.node(v),
parent = g.parent(v);
if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) {
result.setNode(v);
result.setParent(v, parent || root);
// This assumes we have only short edges!
_.forEach(g[relationship](v), function(e) {
var u = e.v === v ? e.w : e.v,
edge = result.edge(u, v),
weight = !_.isUndefined(edge) ? edge.weight : 0;
result.setEdge(u, v, { weight: g.edge(e).weight + weight });
});
if (_.has(node, "minRank")) {
result.setNode(v, {
borderLeft: node.borderLeft[rank],
borderRight: node.borderRight[rank]
});
}
}
});
return result;
}
function createRootNode(g) {
var v;
while (g.hasNode((v = _.uniqueId("_root"))));
return v;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/cross-count.js":
/*!******************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/cross-count.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = crossCount;
/*
* A function that takes a layering (an array of layers, each with an array of
* ordererd nodes) and a graph and returns a weighted crossing count.
*
* Pre-conditions:
*
* 1. Input graph must be simple (not a multigraph), directed, and include
* only simple edges.
* 2. Edges in the input graph must have assigned weights.
*
* Post-conditions:
*
* 1. The graph and layering matrix are left unchanged.
*
* This algorithm is derived from Barth, et al., "Bilayer Cross Counting."
*/
function crossCount(g, layering) {
var cc = 0;
for (var i = 1; i < layering.length; ++i) {
cc += twoLayerCrossCount(g, layering[i-1], layering[i]);
}
return cc;
}
function twoLayerCrossCount(g, northLayer, southLayer) {
// Sort all of the edges between the north and south layers by their position
// in the north layer and then the south. Map these edges to the position of
// their head in the south layer.
var southPos = _.zipObject(southLayer,
_.map(southLayer, function (v, i) { return i; }));
var southEntries = _.flatten(_.map(northLayer, function(v) {
return _.sortBy(_.map(g.outEdges(v), function(e) {
return { pos: southPos[e.w], weight: g.edge(e).weight };
}), "pos");
}), true);
// Build the accumulator tree
var firstIndex = 1;
while (firstIndex < southLayer.length) firstIndex <<= 1;
var treeSize = 2 * firstIndex - 1;
firstIndex -= 1;
var tree = _.map(new Array(treeSize), function() { return 0; });
// Calculate the weighted crossings
var cc = 0;
_.forEach(southEntries.forEach(function(entry) {
var index = entry.pos + firstIndex;
tree[index] += entry.weight;
var weightSum = 0;
while (index > 0) {
if (index % 2) {
weightSum += tree[index + 1];
}
index = (index - 1) >> 1;
tree[index] += entry.weight;
}
cc += entry.weight * weightSum;
}));
return cc;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/index.js":
/*!************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/index.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var initOrder = __webpack_require__(/*! ./init-order */ "./node_modules/_dagre@0.8.5@dagre/lib/order/init-order.js");
var crossCount = __webpack_require__(/*! ./cross-count */ "./node_modules/_dagre@0.8.5@dagre/lib/order/cross-count.js");
var sortSubgraph = __webpack_require__(/*! ./sort-subgraph */ "./node_modules/_dagre@0.8.5@dagre/lib/order/sort-subgraph.js");
var buildLayerGraph = __webpack_require__(/*! ./build-layer-graph */ "./node_modules/_dagre@0.8.5@dagre/lib/order/build-layer-graph.js");
var addSubgraphConstraints = __webpack_require__(/*! ./add-subgraph-constraints */ "./node_modules/_dagre@0.8.5@dagre/lib/order/add-subgraph-constraints.js");
var Graph = __webpack_require__(/*! ../graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
var util = __webpack_require__(/*! ../util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
module.exports = order;
/*
* Applies heuristics to minimize edge crossings in the graph and sets the best
* order solution as an order attribute on each node.
*
* Pre-conditions:
*
* 1. Graph must be DAG
* 2. Graph nodes must be objects with a "rank" attribute
* 3. Graph edges must have the "weight" attribute
*
* Post-conditions:
*
* 1. Graph nodes will have an "order" attribute based on the results of the
* algorithm.
*/
function order(g) {
var maxRank = util.maxRank(g),
downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"),
upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges");
var layering = initOrder(g);
assignOrder(g, layering);
var bestCC = Number.POSITIVE_INFINITY,
best;
for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {
sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2);
layering = util.buildLayerMatrix(g);
var cc = crossCount(g, layering);
if (cc < bestCC) {
lastBest = 0;
best = _.cloneDeep(layering);
bestCC = cc;
}
}
assignOrder(g, best);
}
function buildLayerGraphs(g, ranks, relationship) {
return _.map(ranks, function(rank) {
return buildLayerGraph(g, rank, relationship);
});
}
function sweepLayerGraphs(layerGraphs, biasRight) {
var cg = new Graph();
_.forEach(layerGraphs, function(lg) {
var root = lg.graph().root;
var sorted = sortSubgraph(lg, root, cg, biasRight);
_.forEach(sorted.vs, function(v, i) {
lg.node(v).order = i;
});
addSubgraphConstraints(lg, cg, sorted.vs);
});
}
function assignOrder(g, layering) {
_.forEach(layering, function(layer) {
_.forEach(layer, function(v, i) {
g.node(v).order = i;
});
});
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/init-order.js":
/*!*****************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/init-order.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = initOrder;
/*
* Assigns an initial order value for each node by performing a DFS search
* starting from nodes in the first rank. Nodes are assigned an order in their
* rank as they are first visited.
*
* This approach comes from Gansner, et al., "A Technique for Drawing Directed
* Graphs."
*
* Returns a layering matrix with an array per layer and each layer sorted by
* the order of its nodes.
*/
function initOrder(g) {
var visited = {};
var simpleNodes = _.filter(g.nodes(), function(v) {
return !g.children(v).length;
});
var maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; }));
var layers = _.map(_.range(maxRank + 1), function() { return []; });
function dfs(v) {
if (_.has(visited, v)) return;
visited[v] = true;
var node = g.node(v);
layers[node.rank].push(v);
_.forEach(g.successors(v), dfs);
}
var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; });
_.forEach(orderedVs, dfs);
return layers;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/resolve-conflicts.js":
/*!************************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/resolve-conflicts.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = resolveConflicts;
/*
* Given a list of entries of the form {v, barycenter, weight} and a
* constraint graph this function will resolve any conflicts between the
* constraint graph and the barycenters for the entries. If the barycenters for
* an entry would violate a constraint in the constraint graph then we coalesce
* the nodes in the conflict into a new node that respects the contraint and
* aggregates barycenter and weight information.
*
* This implementation is based on the description in Forster, "A Fast and
* Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it
* differs in some specific details.
*
* Pre-conditions:
*
* 1. Each entry has the form {v, barycenter, weight}, or if the node has
* no barycenter, then {v}.
*
* Returns:
*
* A new list of entries of the form {vs, i, barycenter, weight}. The list
* `vs` may either be a singleton or it may be an aggregation of nodes
* ordered such that they do not violate constraints from the constraint
* graph. The property `i` is the lowest original index of any of the
* elements in `vs`.
*/
function resolveConflicts(entries, cg) {
var mappedEntries = {};
_.forEach(entries, function(entry, i) {
var tmp = mappedEntries[entry.v] = {
indegree: 0,
"in": [],
out: [],
vs: [entry.v],
i: i
};
if (!_.isUndefined(entry.barycenter)) {
tmp.barycenter = entry.barycenter;
tmp.weight = entry.weight;
}
});
_.forEach(cg.edges(), function(e) {
var entryV = mappedEntries[e.v];
var entryW = mappedEntries[e.w];
if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) {
entryW.indegree++;
entryV.out.push(mappedEntries[e.w]);
}
});
var sourceSet = _.filter(mappedEntries, function(entry) {
return !entry.indegree;
});
return doResolveConflicts(sourceSet);
}
function doResolveConflicts(sourceSet) {
var entries = [];
function handleIn(vEntry) {
return function(uEntry) {
if (uEntry.merged) {
return;
}
if (_.isUndefined(uEntry.barycenter) ||
_.isUndefined(vEntry.barycenter) ||
uEntry.barycenter >= vEntry.barycenter) {
mergeEntries(vEntry, uEntry);
}
};
}
function handleOut(vEntry) {
return function(wEntry) {
wEntry["in"].push(vEntry);
if (--wEntry.indegree === 0) {
sourceSet.push(wEntry);
}
};
}
while (sourceSet.length) {
var entry = sourceSet.pop();
entries.push(entry);
_.forEach(entry["in"].reverse(), handleIn(entry));
_.forEach(entry.out, handleOut(entry));
}
return _.map(_.filter(entries, function(entry) { return !entry.merged; }),
function(entry) {
return _.pick(entry, ["vs", "i", "barycenter", "weight"]);
});
}
function mergeEntries(target, source) {
var sum = 0;
var weight = 0;
if (target.weight) {
sum += target.barycenter * target.weight;
weight += target.weight;
}
if (source.weight) {
sum += source.barycenter * source.weight;
weight += source.weight;
}
target.vs = source.vs.concat(target.vs);
target.barycenter = sum / weight;
target.weight = weight;
target.i = Math.min(source.i, target.i);
source.merged = true;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/sort-subgraph.js":
/*!********************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/sort-subgraph.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var barycenter = __webpack_require__(/*! ./barycenter */ "./node_modules/_dagre@0.8.5@dagre/lib/order/barycenter.js");
var resolveConflicts = __webpack_require__(/*! ./resolve-conflicts */ "./node_modules/_dagre@0.8.5@dagre/lib/order/resolve-conflicts.js");
var sort = __webpack_require__(/*! ./sort */ "./node_modules/_dagre@0.8.5@dagre/lib/order/sort.js");
module.exports = sortSubgraph;
function sortSubgraph(g, v, cg, biasRight) {
var movable = g.children(v);
var node = g.node(v);
var bl = node ? node.borderLeft : undefined;
var br = node ? node.borderRight: undefined;
var subgraphs = {};
if (bl) {
movable = _.filter(movable, function(w) {
return w !== bl && w !== br;
});
}
var barycenters = barycenter(g, movable);
_.forEach(barycenters, function(entry) {
if (g.children(entry.v).length) {
var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight);
subgraphs[entry.v] = subgraphResult;
if (_.has(subgraphResult, "barycenter")) {
mergeBarycenters(entry, subgraphResult);
}
}
});
var entries = resolveConflicts(barycenters, cg);
expandSubgraphs(entries, subgraphs);
var result = sort(entries, biasRight);
if (bl) {
result.vs = _.flatten([bl, result.vs, br], true);
if (g.predecessors(bl).length) {
var blPred = g.node(g.predecessors(bl)[0]),
brPred = g.node(g.predecessors(br)[0]);
if (!_.has(result, "barycenter")) {
result.barycenter = 0;
result.weight = 0;
}
result.barycenter = (result.barycenter * result.weight +
blPred.order + brPred.order) / (result.weight + 2);
result.weight += 2;
}
}
return result;
}
function expandSubgraphs(entries, subgraphs) {
_.forEach(entries, function(entry) {
entry.vs = _.flatten(entry.vs.map(function(v) {
if (subgraphs[v]) {
return subgraphs[v].vs;
}
return v;
}), true);
});
}
function mergeBarycenters(target, other) {
if (!_.isUndefined(target.barycenter)) {
target.barycenter = (target.barycenter * target.weight +
other.barycenter * other.weight) /
(target.weight + other.weight);
target.weight += other.weight;
} else {
target.barycenter = other.barycenter;
target.weight = other.weight;
}
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/order/sort.js":
/*!***********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/order/sort.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var util = __webpack_require__(/*! ../util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
module.exports = sort;
function sort(entries, biasRight) {
var parts = util.partition(entries, function(entry) {
return _.has(entry, "barycenter");
});
var sortable = parts.lhs,
unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }),
vs = [],
sum = 0,
weight = 0,
vsIndex = 0;
sortable.sort(compareWithBias(!!biasRight));
vsIndex = consumeUnsortable(vs, unsortable, vsIndex);
_.forEach(sortable, function (entry) {
vsIndex += entry.vs.length;
vs.push(entry.vs);
sum += entry.barycenter * entry.weight;
weight += entry.weight;
vsIndex = consumeUnsortable(vs, unsortable, vsIndex);
});
var result = { vs: _.flatten(vs, true) };
if (weight) {
result.barycenter = sum / weight;
result.weight = weight;
}
return result;
}
function consumeUnsortable(vs, unsortable, index) {
var last;
while (unsortable.length && (last = _.last(unsortable)).i <= index) {
unsortable.pop();
vs.push(last.vs);
index++;
}
return index;
}
function compareWithBias(bias) {
return function(entryV, entryW) {
if (entryV.barycenter < entryW.barycenter) {
return -1;
} else if (entryV.barycenter > entryW.barycenter) {
return 1;
}
return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;
};
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/parent-dummy-chains.js":
/*!********************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/parent-dummy-chains.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = parentDummyChains;
function parentDummyChains(g) {
var postorderNums = postorder(g);
_.forEach(g.graph().dummyChains, function(v) {
var node = g.node(v);
var edgeObj = node.edgeObj;
var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);
var path = pathData.path;
var lca = pathData.lca;
var pathIdx = 0;
var pathV = path[pathIdx];
var ascending = true;
while (v !== edgeObj.w) {
node = g.node(v);
if (ascending) {
while ((pathV = path[pathIdx]) !== lca &&
g.node(pathV).maxRank < node.rank) {
pathIdx++;
}
if (pathV === lca) {
ascending = false;
}
}
if (!ascending) {
while (pathIdx < path.length - 1 &&
g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) {
pathIdx++;
}
pathV = path[pathIdx];
}
g.setParent(v, pathV);
v = g.successors(v)[0];
}
});
}
// Find a path from v to w through the lowest common ancestor (LCA). Return the
// full path and the LCA.
function findPath(g, postorderNums, v, w) {
var vPath = [];
var wPath = [];
var low = Math.min(postorderNums[v].low, postorderNums[w].low);
var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim);
var parent;
var lca;
// Traverse up from v to find the LCA
parent = v;
do {
parent = g.parent(parent);
vPath.push(parent);
} while (parent &&
(postorderNums[parent].low > low || lim > postorderNums[parent].lim));
lca = parent;
// Traverse from w to LCA
parent = w;
while ((parent = g.parent(parent)) !== lca) {
wPath.push(parent);
}
return { path: vPath.concat(wPath.reverse()), lca: lca };
}
function postorder(g) {
var result = {};
var lim = 0;
function dfs(v) {
var low = lim;
_.forEach(g.children(v), dfs);
result[v] = { low: low, lim: lim++ };
}
_.forEach(g.children(), dfs);
return result;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/position/bk.js":
/*!************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/position/bk.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var Graph = __webpack_require__(/*! ../graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
var util = __webpack_require__(/*! ../util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
/*
* This module provides coordinate assignment based on Brandes and Köpf, "Fast
* and Simple Horizontal Coordinate Assignment."
*/
module.exports = {
positionX: positionX,
findType1Conflicts: findType1Conflicts,
findType2Conflicts: findType2Conflicts,
addConflict: addConflict,
hasConflict: hasConflict,
verticalAlignment: verticalAlignment,
horizontalCompaction: horizontalCompaction,
alignCoordinates: alignCoordinates,
findSmallestWidthAlignment: findSmallestWidthAlignment,
balance: balance
};
/*
* Marks all edges in the graph with a type-1 conflict with the "type1Conflict"
* property. A type-1 conflict is one where a non-inner segment crosses an
* inner segment. An inner segment is an edge with both incident nodes marked
* with the "dummy" property.
*
* This algorithm scans layer by layer, starting with the second, for type-1
* conflicts between the current layer and the previous layer. For each layer
* it scans the nodes from left to right until it reaches one that is incident
* on an inner segment. It then scans predecessors to determine if they have
* edges that cross that inner segment. At the end a final scan is done for all
* nodes on the current rank to see if they cross the last visited inner
* segment.
*
* This algorithm (safely) assumes that a dummy node will only be incident on a
* single node in the layers being scanned.
*/
function findType1Conflicts(g, layering) {
var conflicts = {};
function visitLayer(prevLayer, layer) {
var
// last visited node in the previous layer that is incident on an inner
// segment.
k0 = 0,
// Tracks the last node in this layer scanned for crossings with a type-1
// segment.
scanPos = 0,
prevLayerLength = prevLayer.length,
lastNode = _.last(layer);
_.forEach(layer, function(v, i) {
var w = findOtherInnerSegmentNode(g, v),
k1 = w ? g.node(w).order : prevLayerLength;
if (w || v === lastNode) {
_.forEach(layer.slice(scanPos, i +1), function(scanNode) {
_.forEach(g.predecessors(scanNode), function(u) {
var uLabel = g.node(u),
uPos = uLabel.order;
if ((uPos < k0 || k1 < uPos) &&
!(uLabel.dummy && g.node(scanNode).dummy)) {
addConflict(conflicts, u, scanNode);
}
});
});
scanPos = i + 1;
k0 = k1;
}
});
return layer;
}
_.reduce(layering, visitLayer);
return conflicts;
}
function findType2Conflicts(g, layering) {
var conflicts = {};
function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {
var v;
_.forEach(_.range(southPos, southEnd), function(i) {
v = south[i];
if (g.node(v).dummy) {
_.forEach(g.predecessors(v), function(u) {
var uNode = g.node(u);
if (uNode.dummy &&
(uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {
addConflict(conflicts, u, v);
}
});
}
});
}
function visitLayer(north, south) {
var prevNorthPos = -1,
nextNorthPos,
southPos = 0;
_.forEach(south, function(v, southLookahead) {
if (g.node(v).dummy === "border") {
var predecessors = g.predecessors(v);
if (predecessors.length) {
nextNorthPos = g.node(predecessors[0]).order;
scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);
southPos = southLookahead;
prevNorthPos = nextNorthPos;
}
}
scan(south, southPos, south.length, nextNorthPos, north.length);
});
return south;
}
_.reduce(layering, visitLayer);
return conflicts;
}
function findOtherInnerSegmentNode(g, v) {
if (g.node(v).dummy) {
return _.find(g.predecessors(v), function(u) {
return g.node(u).dummy;
});
}
}
function addConflict(conflicts, v, w) {
if (v > w) {
var tmp = v;
v = w;
w = tmp;
}
var conflictsV = conflicts[v];
if (!conflictsV) {
conflicts[v] = conflictsV = {};
}
conflictsV[w] = true;
}
function hasConflict(conflicts, v, w) {
if (v > w) {
var tmp = v;
v = w;
w = tmp;
}
return _.has(conflicts[v], w);
}
/*
* Try to align nodes into vertical "blocks" where possible. This algorithm
* attempts to align a node with one of its median neighbors. If the edge
* connecting a neighbor is a type-1 conflict then we ignore that possibility.
* If a previous node has already formed a block with a node after the node
* we're trying to form a block with, we also ignore that possibility - our
* blocks would be split in that scenario.
*/
function verticalAlignment(g, layering, conflicts, neighborFn) {
var root = {},
align = {},
pos = {};
// We cache the position here based on the layering because the graph and
// layering may be out of sync. The layering matrix is manipulated to
// generate different extreme alignments.
_.forEach(layering, function(layer) {
_.forEach(layer, function(v, order) {
root[v] = v;
align[v] = v;
pos[v] = order;
});
});
_.forEach(layering, function(layer) {
var prevIdx = -1;
_.forEach(layer, function(v) {
var ws = neighborFn(v);
if (ws.length) {
ws = _.sortBy(ws, function(w) { return pos[w]; });
var mp = (ws.length - 1) / 2;
for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {
var w = ws[i];
if (align[v] === v &&
prevIdx < pos[w] &&
!hasConflict(conflicts, v, w)) {
align[w] = v;
align[v] = root[v] = root[w];
prevIdx = pos[w];
}
}
}
});
});
return { root: root, align: align };
}
function horizontalCompaction(g, layering, root, align, reverseSep) {
// This portion of the algorithm differs from BK due to a number of problems.
// Instead of their algorithm we construct a new block graph and do two
// sweeps. The first sweep places blocks with the smallest possible
// coordinates. The second sweep removes unused space by moving blocks to the
// greatest coordinates without violating separation.
var xs = {},
blockG = buildBlockGraph(g, layering, root, reverseSep),
borderType = reverseSep ? "borderLeft" : "borderRight";
function iterate(setXsFunc, nextNodesFunc) {
var stack = blockG.nodes();
var elem = stack.pop();
var visited = {};
while (elem) {
if (visited[elem]) {
setXsFunc(elem);
} else {
visited[elem] = true;
stack.push(elem);
stack = stack.concat(nextNodesFunc(elem));
}
elem = stack.pop();
}
}
// First pass, assign smallest coordinates
function pass1(elem) {
xs[elem] = blockG.inEdges(elem).reduce(function(acc, e) {
return Math.max(acc, xs[e.v] + blockG.edge(e));
}, 0);
}
// Second pass, assign greatest coordinates
function pass2(elem) {
var min = blockG.outEdges(elem).reduce(function(acc, e) {
return Math.min(acc, xs[e.w] - blockG.edge(e));
}, Number.POSITIVE_INFINITY);
var node = g.node(elem);
if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {
xs[elem] = Math.max(xs[elem], min);
}
}
iterate(pass1, blockG.predecessors.bind(blockG));
iterate(pass2, blockG.successors.bind(blockG));
// Assign x coordinates to all nodes
_.forEach(align, function(v) {
xs[v] = xs[root[v]];
});
return xs;
}
function buildBlockGraph(g, layering, root, reverseSep) {
var blockGraph = new Graph(),
graphLabel = g.graph(),
sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);
_.forEach(layering, function(layer) {
var u;
_.forEach(layer, function(v) {
var vRoot = root[v];
blockGraph.setNode(vRoot);
if (u) {
var uRoot = root[u],
prevMax = blockGraph.edge(uRoot, vRoot);
blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));
}
u = v;
});
});
return blockGraph;
}
/*
* Returns the alignment that has the smallest width of the given alignments.
*/
function findSmallestWidthAlignment(g, xss) {
return _.minBy(_.values(xss), function (xs) {
var max = Number.NEGATIVE_INFINITY;
var min = Number.POSITIVE_INFINITY;
_.forIn(xs, function (x, v) {
var halfWidth = width(g, v) / 2;
max = Math.max(x + halfWidth, max);
min = Math.min(x - halfWidth, min);
});
return max - min;
});
}
/*
* Align the coordinates of each of the layout alignments such that
* left-biased alignments have their minimum coordinate at the same point as
* the minimum coordinate of the smallest width alignment and right-biased
* alignments have their maximum coordinate at the same point as the maximum
* coordinate of the smallest width alignment.
*/
function alignCoordinates(xss, alignTo) {
var alignToVals = _.values(alignTo),
alignToMin = _.min(alignToVals),
alignToMax = _.max(alignToVals);
_.forEach(["u", "d"], function(vert) {
_.forEach(["l", "r"], function(horiz) {
var alignment = vert + horiz,
xs = xss[alignment],
delta;
if (xs === alignTo) return;
var xsVals = _.values(xs);
delta = horiz === "l" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);
if (delta) {
xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });
}
});
});
}
function balance(xss, align) {
return _.mapValues(xss.ul, function(ignore, v) {
if (align) {
return xss[align.toLowerCase()][v];
} else {
var xs = _.sortBy(_.map(xss, v));
return (xs[1] + xs[2]) / 2;
}
});
}
function positionX(g) {
var layering = util.buildLayerMatrix(g);
var conflicts = _.merge(
findType1Conflicts(g, layering),
findType2Conflicts(g, layering));
var xss = {};
var adjustedLayering;
_.forEach(["u", "d"], function(vert) {
adjustedLayering = vert === "u" ? layering : _.values(layering).reverse();
_.forEach(["l", "r"], function(horiz) {
if (horiz === "r") {
adjustedLayering = _.map(adjustedLayering, function(inner) {
return _.values(inner).reverse();
});
}
var neighborFn = (vert === "u" ? g.predecessors : g.successors).bind(g);
var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);
var xs = horizontalCompaction(g, adjustedLayering,
align.root, align.align, horiz === "r");
if (horiz === "r") {
xs = _.mapValues(xs, function(x) { return -x; });
}
xss[vert + horiz] = xs;
});
});
var smallestWidth = findSmallestWidthAlignment(g, xss);
alignCoordinates(xss, smallestWidth);
return balance(xss, g.graph().align);
}
function sep(nodeSep, edgeSep, reverseSep) {
return function(g, v, w) {
var vLabel = g.node(v);
var wLabel = g.node(w);
var sum = 0;
var delta;
sum += vLabel.width / 2;
if (_.has(vLabel, "labelpos")) {
switch (vLabel.labelpos.toLowerCase()) {
case "l": delta = -vLabel.width / 2; break;
case "r": delta = vLabel.width / 2; break;
}
}
if (delta) {
sum += reverseSep ? delta : -delta;
}
delta = 0;
sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;
sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;
sum += wLabel.width / 2;
if (_.has(wLabel, "labelpos")) {
switch (wLabel.labelpos.toLowerCase()) {
case "l": delta = wLabel.width / 2; break;
case "r": delta = -wLabel.width / 2; break;
}
}
if (delta) {
sum += reverseSep ? delta : -delta;
}
delta = 0;
return sum;
};
}
function width(g, v) {
return g.node(v).width;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/position/index.js":
/*!***************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/position/index.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var util = __webpack_require__(/*! ../util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js");
var positionX = __webpack_require__(/*! ./bk */ "./node_modules/_dagre@0.8.5@dagre/lib/position/bk.js").positionX;
module.exports = position;
function position(g) {
g = util.asNonCompoundGraph(g);
positionY(g);
_.forEach(positionX(g), function(x, v) {
g.node(v).x = x;
});
}
function positionY(g) {
var layering = util.buildLayerMatrix(g);
var rankSep = g.graph().ranksep;
var prevY = 0;
_.forEach(layering, function(layer) {
var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; }));
_.forEach(layer, function(v) {
g.node(v).y = prevY + maxHeight / 2;
});
prevY += maxHeight + rankSep;
});
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/rank/feasible-tree.js":
/*!*******************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/rank/feasible-tree.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var Graph = __webpack_require__(/*! ../graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
var slack = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/util.js").slack;
module.exports = feasibleTree;
/*
* Constructs a spanning tree with tight edges and adjusted the input node's
* ranks to achieve this. A tight edge is one that is has a length that matches
* its "minlen" attribute.
*
* The basic structure for this function is derived from Gansner, et al., "A
* Technique for Drawing Directed Graphs."
*
* Pre-conditions:
*
* 1. Graph must be a DAG.
* 2. Graph must be connected.
* 3. Graph must have at least one node.
* 5. Graph nodes must have been previously assigned a "rank" property that
* respects the "minlen" property of incident edges.
* 6. Graph edges must have a "minlen" property.
*
* Post-conditions:
*
* - Graph nodes will have their rank adjusted to ensure that all edges are
* tight.
*
* Returns a tree (undirected graph) that is constructed using only "tight"
* edges.
*/
function feasibleTree(g) {
var t = new Graph({ directed: false });
// Choose arbitrary node from which to start our tree
var start = g.nodes()[0];
var size = g.nodeCount();
t.setNode(start, {});
var edge, delta;
while (tightTree(t, g) < size) {
edge = findMinSlackEdge(t, g);
delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge);
shiftRanks(t, g, delta);
}
return t;
}
/*
* Finds a maximal tree of tight edges and returns the number of nodes in the
* tree.
*/
function tightTree(t, g) {
function dfs(v) {
_.forEach(g.nodeEdges(v), function(e) {
var edgeV = e.v,
w = (v === edgeV) ? e.w : edgeV;
if (!t.hasNode(w) && !slack(g, e)) {
t.setNode(w, {});
t.setEdge(v, w, {});
dfs(w);
}
});
}
_.forEach(t.nodes(), dfs);
return t.nodeCount();
}
/*
* Finds the edge with the smallest slack that is incident on tree and returns
* it.
*/
function findMinSlackEdge(t, g) {
return _.minBy(g.edges(), function(e) {
if (t.hasNode(e.v) !== t.hasNode(e.w)) {
return slack(g, e);
}
});
}
function shiftRanks(t, g, delta) {
_.forEach(t.nodes(), function(v) {
g.node(v).rank += delta;
});
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/rank/index.js":
/*!***********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/rank/index.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var rankUtil = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/util.js");
var longestPath = rankUtil.longestPath;
var feasibleTree = __webpack_require__(/*! ./feasible-tree */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/feasible-tree.js");
var networkSimplex = __webpack_require__(/*! ./network-simplex */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/network-simplex.js");
module.exports = rank;
/*
* Assigns a rank to each node in the input graph that respects the "minlen"
* constraint specified on edges between nodes.
*
* This basic structure is derived from Gansner, et al., "A Technique for
* Drawing Directed Graphs."
*
* Pre-conditions:
*
* 1. Graph must be a connected DAG
* 2. Graph nodes must be objects
* 3. Graph edges must have "weight" and "minlen" attributes
*
* Post-conditions:
*
* 1. Graph nodes will have a "rank" attribute based on the results of the
* algorithm. Ranks can start at any index (including negative), we'll
* fix them up later.
*/
function rank(g) {
switch(g.graph().ranker) {
case "network-simplex": networkSimplexRanker(g); break;
case "tight-tree": tightTreeRanker(g); break;
case "longest-path": longestPathRanker(g); break;
default: networkSimplexRanker(g);
}
}
// A fast and simple ranker, but results are far from optimal.
var longestPathRanker = longestPath;
function tightTreeRanker(g) {
longestPath(g);
feasibleTree(g);
}
function networkSimplexRanker(g) {
networkSimplex(g);
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/rank/network-simplex.js":
/*!*********************************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/rank/network-simplex.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var feasibleTree = __webpack_require__(/*! ./feasible-tree */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/feasible-tree.js");
var slack = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/util.js").slack;
var initRank = __webpack_require__(/*! ./util */ "./node_modules/_dagre@0.8.5@dagre/lib/rank/util.js").longestPath;
var preorder = __webpack_require__(/*! ../graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").alg.preorder;
var postorder = __webpack_require__(/*! ../graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").alg.postorder;
var simplify = __webpack_require__(/*! ../util */ "./node_modules/_dagre@0.8.5@dagre/lib/util.js").simplify;
module.exports = networkSimplex;
// Expose some internals for testing purposes
networkSimplex.initLowLimValues = initLowLimValues;
networkSimplex.initCutValues = initCutValues;
networkSimplex.calcCutValue = calcCutValue;
networkSimplex.leaveEdge = leaveEdge;
networkSimplex.enterEdge = enterEdge;
networkSimplex.exchangeEdges = exchangeEdges;
/*
* The network simplex algorithm assigns ranks to each node in the input graph
* and iteratively improves the ranking to reduce the length of edges.
*
* Preconditions:
*
* 1. The input graph must be a DAG.
* 2. All nodes in the graph must have an object value.
* 3. All edges in the graph must have "minlen" and "weight" attributes.
*
* Postconditions:
*
* 1. All nodes in the graph will have an assigned "rank" attribute that has
* been optimized by the network simplex algorithm. Ranks start at 0.
*
*
* A rough sketch of the algorithm is as follows:
*
* 1. Assign initial ranks to each node. We use the longest path algorithm,
* which assigns ranks to the lowest position possible. In general this
* leads to very wide bottom ranks and unnecessarily long edges.
* 2. Construct a feasible tight tree. A tight tree is one such that all
* edges in the tree have no slack (difference between length of edge
* and minlen for the edge). This by itself greatly improves the assigned
* rankings by shorting edges.
* 3. Iteratively find edges that have negative cut values. Generally a
* negative cut value indicates that the edge could be removed and a new
* tree edge could be added to produce a more compact graph.
*
* Much of the algorithms here are derived from Gansner, et al., "A Technique
* for Drawing Directed Graphs." The structure of the file roughly follows the
* structure of the overall algorithm.
*/
function networkSimplex(g) {
g = simplify(g);
initRank(g);
var t = feasibleTree(g);
initLowLimValues(t);
initCutValues(t, g);
var e, f;
while ((e = leaveEdge(t))) {
f = enterEdge(t, g, e);
exchangeEdges(t, g, e, f);
}
}
/*
* Initializes cut values for all edges in the tree.
*/
function initCutValues(t, g) {
var vs = postorder(t, t.nodes());
vs = vs.slice(0, vs.length - 1);
_.forEach(vs, function(v) {
assignCutValue(t, g, v);
});
}
function assignCutValue(t, g, child) {
var childLab = t.node(child);
var parent = childLab.parent;
t.edge(child, parent).cutvalue = calcCutValue(t, g, child);
}
/*
* Given the tight tree, its graph, and a child in the graph calculate and
* return the cut value for the edge between the child and its parent.
*/
function calcCutValue(t, g, child) {
var childLab = t.node(child);
var parent = childLab.parent;
// True if the child is on the tail end of the edge in the directed graph
var childIsTail = true;
// The graph's view of the tree edge we're inspecting
var graphEdge = g.edge(child, parent);
// The accumulated cut value for the edge between this node and its parent
var cutValue = 0;
if (!graphEdge) {
childIsTail = false;
graphEdge = g.edge(parent, child);
}
cutValue = graphEdge.weight;
_.forEach(g.nodeEdges(child), function(e) {
var isOutEdge = e.v === child,
other = isOutEdge ? e.w : e.v;
if (other !== parent) {
var pointsToHead = isOutEdge === childIsTail,
otherWeight = g.edge(e).weight;
cutValue += pointsToHead ? otherWeight : -otherWeight;
if (isTreeEdge(t, child, other)) {
var otherCutValue = t.edge(child, other).cutvalue;
cutValue += pointsToHead ? -otherCutValue : otherCutValue;
}
}
});
return cutValue;
}
function initLowLimValues(tree, root) {
if (arguments.length < 2) {
root = tree.nodes()[0];
}
dfsAssignLowLim(tree, {}, 1, root);
}
function dfsAssignLowLim(tree, visited, nextLim, v, parent) {
var low = nextLim;
var label = tree.node(v);
visited[v] = true;
_.forEach(tree.neighbors(v), function(w) {
if (!_.has(visited, w)) {
nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v);
}
});
label.low = low;
label.lim = nextLim++;
if (parent) {
label.parent = parent;
} else {
// TODO should be able to remove this when we incrementally update low lim
delete label.parent;
}
return nextLim;
}
function leaveEdge(tree) {
return _.find(tree.edges(), function(e) {
return tree.edge(e).cutvalue < 0;
});
}
function enterEdge(t, g, edge) {
var v = edge.v;
var w = edge.w;
// For the rest of this function we assume that v is the tail and w is the
// head, so if we don't have this edge in the graph we should flip it to
// match the correct orientation.
if (!g.hasEdge(v, w)) {
v = edge.w;
w = edge.v;
}
var vLabel = t.node(v);
var wLabel = t.node(w);
var tailLabel = vLabel;
var flip = false;
// If the root is in the tail of the edge then we need to flip the logic that
// checks for the head and tail nodes in the candidates function below.
if (vLabel.lim > wLabel.lim) {
tailLabel = wLabel;
flip = true;
}
var candidates = _.filter(g.edges(), function(edge) {
return flip === isDescendant(t, t.node(edge.v), tailLabel) &&
flip !== isDescendant(t, t.node(edge.w), tailLabel);
});
return _.minBy(candidates, function(edge) { return slack(g, edge); });
}
function exchangeEdges(t, g, e, f) {
var v = e.v;
var w = e.w;
t.removeEdge(v, w);
t.setEdge(f.v, f.w, {});
initLowLimValues(t);
initCutValues(t, g);
updateRanks(t, g);
}
function updateRanks(t, g) {
var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; });
var vs = preorder(t, root);
vs = vs.slice(1);
_.forEach(vs, function(v) {
var parent = t.node(v).parent,
edge = g.edge(v, parent),
flipped = false;
if (!edge) {
edge = g.edge(parent, v);
flipped = true;
}
g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);
});
}
/*
* Returns true if the edge is in the tree.
*/
function isTreeEdge(tree, u, v) {
return tree.hasEdge(u, v);
}
/*
* Returns true if the specified node is descendant of the root node per the
* assigned low and lim attributes in the tree.
*/
function isDescendant(tree, vLabel, rootLabel) {
return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/rank/util.js":
/*!**********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/rank/util.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
module.exports = {
longestPath: longestPath,
slack: slack
};
/*
* Initializes ranks for the input graph using the longest path algorithm. This
* algorithm scales well and is fast in practice, it yields rather poor
* solutions. Nodes are pushed to the lowest layer possible, leaving the bottom
* ranks wide and leaving edges longer than necessary. However, due to its
* speed, this algorithm is good for getting an initial ranking that can be fed
* into other algorithms.
*
* This algorithm does not normalize layers because it will be used by other
* algorithms in most cases. If using this algorithm directly, be sure to
* run normalize at the end.
*
* Pre-conditions:
*
* 1. Input graph is a DAG.
* 2. Input graph node labels can be assigned properties.
*
* Post-conditions:
*
* 1. Each node will be assign an (unnormalized) "rank" property.
*/
function longestPath(g) {
var visited = {};
function dfs(v) {
var label = g.node(v);
if (_.has(visited, v)) {
return label.rank;
}
visited[v] = true;
var rank = _.min(_.map(g.outEdges(v), function(e) {
return dfs(e.w) - g.edge(e).minlen;
}));
if (rank === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
rank === undefined || // return value of _.map([]) for Lodash 4
rank === null) { // return value of _.map([null])
rank = 0;
}
return (label.rank = rank);
}
_.forEach(g.sources(), dfs);
}
/*
* Returns the amount of slack for the given edge. The slack is defined as the
* difference between the length of the edge and its minimum length.
*/
function slack(g, e) {
return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/util.js":
/*!*****************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/util.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint "no-console": off */
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_dagre@0.8.5@dagre/lib/lodash.js");
var Graph = __webpack_require__(/*! ./graphlib */ "./node_modules/_dagre@0.8.5@dagre/lib/graphlib.js").Graph;
module.exports = {
addDummyNode: addDummyNode,
simplify: simplify,
asNonCompoundGraph: asNonCompoundGraph,
successorWeights: successorWeights,
predecessorWeights: predecessorWeights,
intersectRect: intersectRect,
buildLayerMatrix: buildLayerMatrix,
normalizeRanks: normalizeRanks,
removeEmptyRanks: removeEmptyRanks,
addBorderNode: addBorderNode,
maxRank: maxRank,
partition: partition,
time: time,
notime: notime
};
/*
* Adds a dummy node to the graph and return v.
*/
function addDummyNode(g, type, attrs, name) {
var v;
do {
v = _.uniqueId(name);
} while (g.hasNode(v));
attrs.dummy = type;
g.setNode(v, attrs);
return v;
}
/*
* Returns a new graph with only simple edges. Handles aggregation of data
* associated with multi-edges.
*/
function simplify(g) {
var simplified = new Graph().setGraph(g.graph());
_.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });
_.forEach(g.edges(), function(e) {
var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };
var label = g.edge(e);
simplified.setEdge(e.v, e.w, {
weight: simpleLabel.weight + label.weight,
minlen: Math.max(simpleLabel.minlen, label.minlen)
});
});
return simplified;
}
function asNonCompoundGraph(g) {
var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph());
_.forEach(g.nodes(), function(v) {
if (!g.children(v).length) {
simplified.setNode(v, g.node(v));
}
});
_.forEach(g.edges(), function(e) {
simplified.setEdge(e, g.edge(e));
});
return simplified;
}
function successorWeights(g) {
var weightMap = _.map(g.nodes(), function(v) {
var sucs = {};
_.forEach(g.outEdges(v), function(e) {
sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight;
});
return sucs;
});
return _.zipObject(g.nodes(), weightMap);
}
function predecessorWeights(g) {
var weightMap = _.map(g.nodes(), function(v) {
var preds = {};
_.forEach(g.inEdges(v), function(e) {
preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight;
});
return preds;
});
return _.zipObject(g.nodes(), weightMap);
}
/*
* Finds where a line starting at point ({x, y}) would intersect a rectangle
* ({x, y, width, height}) if it were pointing at the rectangle's center.
*/
function intersectRect(rect, point) {
var x = rect.x;
var y = rect.y;
// Rectangle intersection algorithm from:
// http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes
var dx = point.x - x;
var dy = point.y - y;
var w = rect.width / 2;
var h = rect.height / 2;
if (!dx && !dy) {
throw new Error("Not possible to find intersection inside of the rectangle");
}
var sx, sy;
if (Math.abs(dy) * w > Math.abs(dx) * h) {
// Intersection is top or bottom of rect.
if (dy < 0) {
h = -h;
}
sx = h * dx / dy;
sy = h;
} else {
// Intersection is left or right of rect.
if (dx < 0) {
w = -w;
}
sx = w;
sy = w * dy / dx;
}
return { x: x + sx, y: y + sy };
}
/*
* Given a DAG with each node assigned "rank" and "order" properties, this
* function will produce a matrix with the ids of each node.
*/
function buildLayerMatrix(g) {
var layering = _.map(_.range(maxRank(g) + 1), function() { return []; });
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
var rank = node.rank;
if (!_.isUndefined(rank)) {
layering[rank][node.order] = v;
}
});
return layering;
}
/*
* Adjusts the ranks for all nodes in the graph such that all nodes v have
* rank(v) >= 0 and at least one node w has rank(w) = 0.
*/
function normalizeRanks(g) {
var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
if (_.has(node, "rank")) {
node.rank -= min;
}
});
}
function removeEmptyRanks(g) {
// Ranks may not start at 0, so we need to offset them
var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
var layers = [];
_.forEach(g.nodes(), function(v) {
var rank = g.node(v).rank - offset;
if (!layers[rank]) {
layers[rank] = [];
}
layers[rank].push(v);
});
var delta = 0;
var nodeRankFactor = g.graph().nodeRankFactor;
_.forEach(layers, function(vs, i) {
if (_.isUndefined(vs) && i % nodeRankFactor !== 0) {
--delta;
} else if (delta) {
_.forEach(vs, function(v) { g.node(v).rank += delta; });
}
});
}
function addBorderNode(g, prefix, rank, order) {
var node = {
width: 0,
height: 0
};
if (arguments.length >= 4) {
node.rank = rank;
node.order = order;
}
return addDummyNode(g, "border", node, prefix);
}
function maxRank(g) {
return _.max(_.map(g.nodes(), function(v) {
var rank = g.node(v).rank;
if (!_.isUndefined(rank)) {
return rank;
}
}));
}
/*
* Partition a collection into two groups: `lhs` and `rhs`. If the supplied
* function returns true for an entry it goes into `lhs`. Otherwise it goes
* into `rhs.
*/
function partition(collection, fn) {
var result = { lhs: [], rhs: [] };
_.forEach(collection, function(value) {
if (fn(value)) {
result.lhs.push(value);
} else {
result.rhs.push(value);
}
});
return result;
}
/*
* Returns a new function that wraps `fn` with a timer. The wrapper logs the
* time it takes to execute the function.
*/
function time(name, fn) {
var start = _.now();
try {
return fn();
} finally {
console.log(name + " time: " + (_.now() - start) + "ms");
}
}
function notime(name, fn) {
return fn();
}
/***/ }),
/***/ "./node_modules/_dagre@0.8.5@dagre/lib/version.js":
/*!********************************************************!*\
!*** ./node_modules/_dagre@0.8.5@dagre/lib/version.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "0.8.5";
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/index.js":
/*!********************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/index.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014, Chris Pettitt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var lib = __webpack_require__(/*! ./lib */ "./node_modules/_graphlib@2.1.8@graphlib/lib/index.js");
module.exports = {
Graph: lib.Graph,
json: __webpack_require__(/*! ./lib/json */ "./node_modules/_graphlib@2.1.8@graphlib/lib/json.js"),
alg: __webpack_require__(/*! ./lib/alg */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/index.js"),
version: lib.version
};
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/components.js":
/*!*********************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/components.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = components;
function components(g) {
var visited = {};
var cmpts = [];
var cmpt;
function dfs(v) {
if (_.has(visited, v)) return;
visited[v] = true;
cmpt.push(v);
_.each(g.successors(v), dfs);
_.each(g.predecessors(v), dfs);
}
_.each(g.nodes(), function(v) {
cmpt = [];
dfs(v);
if (cmpt.length) {
cmpts.push(cmpt);
}
});
return cmpts;
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dfs.js":
/*!**************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dfs.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = dfs;
/*
* A helper that preforms a pre- or post-order traversal on the input graph
* and returns the nodes in the order they were visited. If the graph is
* undirected then this algorithm will navigate using neighbors. If the graph
* is directed then this algorithm will navigate using successors.
*
* Order must be one of "pre" or "post".
*/
function dfs(g, vs, order) {
if (!_.isArray(vs)) {
vs = [vs];
}
var navigation = (g.isDirected() ? g.successors : g.neighbors).bind(g);
var acc = [];
var visited = {};
_.each(vs, function(v) {
if (!g.hasNode(v)) {
throw new Error("Graph does not have node: " + v);
}
doDfs(g, v, order === "post", visited, navigation, acc);
});
return acc;
}
function doDfs(g, v, postorder, visited, navigation, acc) {
if (!_.has(visited, v)) {
visited[v] = true;
if (!postorder) { acc.push(v); }
_.each(navigation(v), function(w) {
doDfs(g, w, postorder, visited, navigation, acc);
});
if (postorder) { acc.push(v); }
}
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dijkstra-all.js":
/*!***********************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dijkstra-all.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var dijkstra = __webpack_require__(/*! ./dijkstra */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dijkstra.js");
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = dijkstraAll;
function dijkstraAll(g, weightFunc, edgeFunc) {
return _.transform(g.nodes(), function(acc, v) {
acc[v] = dijkstra(g, v, weightFunc, edgeFunc);
}, {});
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dijkstra.js":
/*!*******************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dijkstra.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
var PriorityQueue = __webpack_require__(/*! ../data/priority-queue */ "./node_modules/_graphlib@2.1.8@graphlib/lib/data/priority-queue.js");
module.exports = dijkstra;
var DEFAULT_WEIGHT_FUNC = _.constant(1);
function dijkstra(g, source, weightFn, edgeFn) {
return runDijkstra(g, String(source),
weightFn || DEFAULT_WEIGHT_FUNC,
edgeFn || function(v) { return g.outEdges(v); });
}
function runDijkstra(g, source, weightFn, edgeFn) {
var results = {};
var pq = new PriorityQueue();
var v, vEntry;
var updateNeighbors = function(edge) {
var w = edge.v !== v ? edge.v : edge.w;
var wEntry = results[w];
var weight = weightFn(edge);
var distance = vEntry.distance + weight;
if (weight < 0) {
throw new Error("dijkstra does not allow negative edge weights. " +
"Bad edge: " + edge + " Weight: " + weight);
}
if (distance < wEntry.distance) {
wEntry.distance = distance;
wEntry.predecessor = v;
pq.decrease(w, distance);
}
};
g.nodes().forEach(function(v) {
var distance = v === source ? 0 : Number.POSITIVE_INFINITY;
results[v] = { distance: distance };
pq.add(v, distance);
});
while (pq.size() > 0) {
v = pq.removeMin();
vEntry = results[v];
if (vEntry.distance === Number.POSITIVE_INFINITY) {
break;
}
edgeFn(v).forEach(updateNeighbors);
}
return results;
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/find-cycles.js":
/*!**********************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/find-cycles.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
var tarjan = __webpack_require__(/*! ./tarjan */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/tarjan.js");
module.exports = findCycles;
function findCycles(g) {
return _.filter(tarjan(g), function(cmpt) {
return cmpt.length > 1 || (cmpt.length === 1 && g.hasEdge(cmpt[0], cmpt[0]));
});
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/floyd-warshall.js":
/*!*************************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/floyd-warshall.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = floydWarshall;
var DEFAULT_WEIGHT_FUNC = _.constant(1);
function floydWarshall(g, weightFn, edgeFn) {
return runFloydWarshall(g,
weightFn || DEFAULT_WEIGHT_FUNC,
edgeFn || function(v) { return g.outEdges(v); });
}
function runFloydWarshall(g, weightFn, edgeFn) {
var results = {};
var nodes = g.nodes();
nodes.forEach(function(v) {
results[v] = {};
results[v][v] = { distance: 0 };
nodes.forEach(function(w) {
if (v !== w) {
results[v][w] = { distance: Number.POSITIVE_INFINITY };
}
});
edgeFn(v).forEach(function(edge) {
var w = edge.v === v ? edge.w : edge.v;
var d = weightFn(edge);
results[v][w] = { distance: d, predecessor: v };
});
});
nodes.forEach(function(k) {
var rowK = results[k];
nodes.forEach(function(i) {
var rowI = results[i];
nodes.forEach(function(j) {
var ik = rowI[k];
var kj = rowK[j];
var ij = rowI[j];
var altDistance = ik.distance + kj.distance;
if (altDistance < ij.distance) {
ij.distance = altDistance;
ij.predecessor = kj.predecessor;
}
});
});
});
return results;
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/index.js":
/*!****************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/index.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = {
components: __webpack_require__(/*! ./components */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/components.js"),
dijkstra: __webpack_require__(/*! ./dijkstra */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dijkstra.js"),
dijkstraAll: __webpack_require__(/*! ./dijkstra-all */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dijkstra-all.js"),
findCycles: __webpack_require__(/*! ./find-cycles */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/find-cycles.js"),
floydWarshall: __webpack_require__(/*! ./floyd-warshall */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/floyd-warshall.js"),
isAcyclic: __webpack_require__(/*! ./is-acyclic */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/is-acyclic.js"),
postorder: __webpack_require__(/*! ./postorder */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/postorder.js"),
preorder: __webpack_require__(/*! ./preorder */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/preorder.js"),
prim: __webpack_require__(/*! ./prim */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/prim.js"),
tarjan: __webpack_require__(/*! ./tarjan */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/tarjan.js"),
topsort: __webpack_require__(/*! ./topsort */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/topsort.js")
};
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/is-acyclic.js":
/*!*********************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/is-acyclic.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var topsort = __webpack_require__(/*! ./topsort */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/topsort.js");
module.exports = isAcyclic;
function isAcyclic(g) {
try {
topsort(g);
} catch (e) {
if (e instanceof topsort.CycleException) {
return false;
}
throw e;
}
return true;
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/postorder.js":
/*!********************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/postorder.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var dfs = __webpack_require__(/*! ./dfs */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dfs.js");
module.exports = postorder;
function postorder(g, vs) {
return dfs(g, vs, "post");
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/preorder.js":
/*!*******************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/preorder.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var dfs = __webpack_require__(/*! ./dfs */ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/dfs.js");
module.exports = preorder;
function preorder(g, vs) {
return dfs(g, vs, "pre");
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/prim.js":
/*!***************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/prim.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
var Graph = __webpack_require__(/*! ../graph */ "./node_modules/_graphlib@2.1.8@graphlib/lib/graph.js");
var PriorityQueue = __webpack_require__(/*! ../data/priority-queue */ "./node_modules/_graphlib@2.1.8@graphlib/lib/data/priority-queue.js");
module.exports = prim;
function prim(g, weightFunc) {
var result = new Graph();
var parents = {};
var pq = new PriorityQueue();
var v;
function updateNeighbors(edge) {
var w = edge.v === v ? edge.w : edge.v;
var pri = pq.priority(w);
if (pri !== undefined) {
var edgeWeight = weightFunc(edge);
if (edgeWeight < pri) {
parents[w] = v;
pq.decrease(w, edgeWeight);
}
}
}
if (g.nodeCount() === 0) {
return result;
}
_.each(g.nodes(), function(v) {
pq.add(v, Number.POSITIVE_INFINITY);
result.setNode(v);
});
// Start from an arbitrary node
pq.decrease(g.nodes()[0], 0);
var init = false;
while (pq.size() > 0) {
v = pq.removeMin();
if (_.has(parents, v)) {
result.setEdge(v, parents[v]);
} else if (init) {
throw new Error("Input graph is not connected: " + g);
} else {
init = true;
}
g.nodeEdges(v).forEach(updateNeighbors);
}
return result;
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/tarjan.js":
/*!*****************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/tarjan.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = tarjan;
function tarjan(g) {
var index = 0;
var stack = [];
var visited = {}; // node id -> { onStack, lowlink, index }
var results = [];
function dfs(v) {
var entry = visited[v] = {
onStack: true,
lowlink: index,
index: index++
};
stack.push(v);
g.successors(v).forEach(function(w) {
if (!_.has(visited, w)) {
dfs(w);
entry.lowlink = Math.min(entry.lowlink, visited[w].lowlink);
} else if (visited[w].onStack) {
entry.lowlink = Math.min(entry.lowlink, visited[w].index);
}
});
if (entry.lowlink === entry.index) {
var cmpt = [];
var w;
do {
w = stack.pop();
visited[w].onStack = false;
cmpt.push(w);
} while (v !== w);
results.push(cmpt);
}
}
g.nodes().forEach(function(v) {
if (!_.has(visited, v)) {
dfs(v);
}
});
return results;
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/alg/topsort.js":
/*!******************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/alg/topsort.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = topsort;
topsort.CycleException = CycleException;
function topsort(g) {
var visited = {};
var stack = {};
var results = [];
function visit(node) {
if (_.has(stack, node)) {
throw new CycleException();
}
if (!_.has(visited, node)) {
stack[node] = true;
visited[node] = true;
_.each(g.predecessors(node), visit);
delete stack[node];
results.push(node);
}
}
_.each(g.sinks(), visit);
if (_.size(visited) !== g.nodeCount()) {
throw new CycleException();
}
return results;
}
function CycleException() {}
CycleException.prototype = new Error(); // must be an instance of Error to pass testing
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/data/priority-queue.js":
/*!**************************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/data/priority-queue.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ../lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = PriorityQueue;
/**
* A min-priority queue data structure. This algorithm is derived from Cormen,
* et al., "Introduction to Algorithms". The basic idea of a min-priority
* queue is that you can efficiently (in O(1) time) get the smallest key in
* the queue. Adding and removing elements takes O(log n) time. A key can
* have its priority decreased in O(log n) time.
*/
function PriorityQueue() {
this._arr = [];
this._keyIndices = {};
}
/**
* Returns the number of elements in the queue. Takes `O(1)` time.
*/
PriorityQueue.prototype.size = function() {
return this._arr.length;
};
/**
* Returns the keys that are in the queue. Takes `O(n)` time.
*/
PriorityQueue.prototype.keys = function() {
return this._arr.map(function(x) { return x.key; });
};
/**
* Returns `true` if **key** is in the queue and `false` if not.
*/
PriorityQueue.prototype.has = function(key) {
return _.has(this._keyIndices, key);
};
/**
* Returns the priority for **key**. If **key** is not present in the queue
* then this function returns `undefined`. Takes `O(1)` time.
*
* @param {Object} key
*/
PriorityQueue.prototype.priority = function(key) {
var index = this._keyIndices[key];
if (index !== undefined) {
return this._arr[index].priority;
}
};
/**
* Returns the key for the minimum element in this queue. If the queue is
* empty this function throws an Error. Takes `O(1)` time.
*/
PriorityQueue.prototype.min = function() {
if (this.size() === 0) {
throw new Error("Queue underflow");
}
return this._arr[0].key;
};
/**
* Inserts a new key into the priority queue. If the key already exists in
* the queue this function returns `false`; otherwise it will return `true`.
* Takes `O(n)` time.
*
* @param {Object} key the key to add
* @param {Number} priority the initial priority for the key
*/
PriorityQueue.prototype.add = function(key, priority) {
var keyIndices = this._keyIndices;
key = String(key);
if (!_.has(keyIndices, key)) {
var arr = this._arr;
var index = arr.length;
keyIndices[key] = index;
arr.push({key: key, priority: priority});
this._decrease(index);
return true;
}
return false;
};
/**
* Removes and returns the smallest key in the queue. Takes `O(log n)` time.
*/
PriorityQueue.prototype.removeMin = function() {
this._swap(0, this._arr.length - 1);
var min = this._arr.pop();
delete this._keyIndices[min.key];
this._heapify(0);
return min.key;
};
/**
* Decreases the priority for **key** to **priority**. If the new priority is
* greater than the previous priority, this function will throw an Error.
*
* @param {Object} key the key for which to raise priority
* @param {Number} priority the new priority for the key
*/
PriorityQueue.prototype.decrease = function(key, priority) {
var index = this._keyIndices[key];
if (priority > this._arr[index].priority) {
throw new Error("New priority is greater than current priority. " +
"Key: " + key + " Old: " + this._arr[index].priority + " New: " + priority);
}
this._arr[index].priority = priority;
this._decrease(index);
};
PriorityQueue.prototype._heapify = function(i) {
var arr = this._arr;
var l = 2 * i;
var r = l + 1;
var largest = i;
if (l < arr.length) {
largest = arr[l].priority < arr[largest].priority ? l : largest;
if (r < arr.length) {
largest = arr[r].priority < arr[largest].priority ? r : largest;
}
if (largest !== i) {
this._swap(i, largest);
this._heapify(largest);
}
}
};
PriorityQueue.prototype._decrease = function(index) {
var arr = this._arr;
var priority = arr[index].priority;
var parent;
while (index !== 0) {
parent = index >> 1;
if (arr[parent].priority < priority) {
break;
}
this._swap(index, parent);
index = parent;
}
};
PriorityQueue.prototype._swap = function(i, j) {
var arr = this._arr;
var keyIndices = this._keyIndices;
var origArrI = arr[i];
var origArrJ = arr[j];
arr[i] = origArrJ;
arr[j] = origArrI;
keyIndices[origArrJ.key] = i;
keyIndices[origArrI.key] = j;
};
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/graph.js":
/*!************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/graph.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
module.exports = Graph;
var DEFAULT_EDGE_NAME = "\x00";
var GRAPH_NODE = "\x00";
var EDGE_KEY_DELIM = "\x01";
// Implementation notes:
//
// * Node id query functions should return string ids for the nodes
// * Edge id query functions should return an "edgeObj", edge object, that is
// composed of enough information to uniquely identify an edge: {v, w, name}.
// * Internally we use an "edgeId", a stringified form of the edgeObj, to
// reference edges. This is because we need a performant way to look these
// edges up and, object properties, which have string keys, are the closest
// we're going to get to a performant hashtable in JavaScript.
function Graph(opts) {
this._isDirected = _.has(opts, "directed") ? opts.directed : true;
this._isMultigraph = _.has(opts, "multigraph") ? opts.multigraph : false;
this._isCompound = _.has(opts, "compound") ? opts.compound : false;
// Label for the graph itself
this._label = undefined;
// Defaults to be set when creating a new node
this._defaultNodeLabelFn = _.constant(undefined);
// Defaults to be set when creating a new edge
this._defaultEdgeLabelFn = _.constant(undefined);
// v -> label
this._nodes = {};
if (this._isCompound) {
// v -> parent
this._parent = {};
// v -> children
this._children = {};
this._children[GRAPH_NODE] = {};
}
// v -> edgeObj
this._in = {};
// u -> v -> Number
this._preds = {};
// v -> edgeObj
this._out = {};
// v -> w -> Number
this._sucs = {};
// e -> edgeObj
this._edgeObjs = {};
// e -> label
this._edgeLabels = {};
}
/* Number of nodes in the graph. Should only be changed by the implementation. */
Graph.prototype._nodeCount = 0;
/* Number of edges in the graph. Should only be changed by the implementation. */
Graph.prototype._edgeCount = 0;
/* === Graph functions ========= */
Graph.prototype.isDirected = function() {
return this._isDirected;
};
Graph.prototype.isMultigraph = function() {
return this._isMultigraph;
};
Graph.prototype.isCompound = function() {
return this._isCompound;
};
Graph.prototype.setGraph = function(label) {
this._label = label;
return this;
};
Graph.prototype.graph = function() {
return this._label;
};
/* === Node functions ========== */
Graph.prototype.setDefaultNodeLabel = function(newDefault) {
if (!_.isFunction(newDefault)) {
newDefault = _.constant(newDefault);
}
this._defaultNodeLabelFn = newDefault;
return this;
};
Graph.prototype.nodeCount = function() {
return this._nodeCount;
};
Graph.prototype.nodes = function() {
return _.keys(this._nodes);
};
Graph.prototype.sources = function() {
var self = this;
return _.filter(this.nodes(), function(v) {
return _.isEmpty(self._in[v]);
});
};
Graph.prototype.sinks = function() {
var self = this;
return _.filter(this.nodes(), function(v) {
return _.isEmpty(self._out[v]);
});
};
Graph.prototype.setNodes = function(vs, value) {
var args = arguments;
var self = this;
_.each(vs, function(v) {
if (args.length > 1) {
self.setNode(v, value);
} else {
self.setNode(v);
}
});
return this;
};
Graph.prototype.setNode = function(v, value) {
if (_.has(this._nodes, v)) {
if (arguments.length > 1) {
this._nodes[v] = value;
}
return this;
}
this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);
if (this._isCompound) {
this._parent[v] = GRAPH_NODE;
this._children[v] = {};
this._children[GRAPH_NODE][v] = true;
}
this._in[v] = {};
this._preds[v] = {};
this._out[v] = {};
this._sucs[v] = {};
++this._nodeCount;
return this;
};
Graph.prototype.node = function(v) {
return this._nodes[v];
};
Graph.prototype.hasNode = function(v) {
return _.has(this._nodes, v);
};
Graph.prototype.removeNode = function(v) {
var self = this;
if (_.has(this._nodes, v)) {
var removeEdge = function(e) { self.removeEdge(self._edgeObjs[e]); };
delete this._nodes[v];
if (this._isCompound) {
this._removeFromParentsChildList(v);
delete this._parent[v];
_.each(this.children(v), function(child) {
self.setParent(child);
});
delete this._children[v];
}
_.each(_.keys(this._in[v]), removeEdge);
delete this._in[v];
delete this._preds[v];
_.each(_.keys(this._out[v]), removeEdge);
delete this._out[v];
delete this._sucs[v];
--this._nodeCount;
}
return this;
};
Graph.prototype.setParent = function(v, parent) {
if (!this._isCompound) {
throw new Error("Cannot set parent in a non-compound graph");
}
if (_.isUndefined(parent)) {
parent = GRAPH_NODE;
} else {
// Coerce parent to string
parent += "";
for (var ancestor = parent;
!_.isUndefined(ancestor);
ancestor = this.parent(ancestor)) {
if (ancestor === v) {
throw new Error("Setting " + parent+ " as parent of " + v +
" would create a cycle");
}
}
this.setNode(parent);
}
this.setNode(v);
this._removeFromParentsChildList(v);
this._parent[v] = parent;
this._children[parent][v] = true;
return this;
};
Graph.prototype._removeFromParentsChildList = function(v) {
delete this._children[this._parent[v]][v];
};
Graph.prototype.parent = function(v) {
if (this._isCompound) {
var parent = this._parent[v];
if (parent !== GRAPH_NODE) {
return parent;
}
}
};
Graph.prototype.children = function(v) {
if (_.isUndefined(v)) {
v = GRAPH_NODE;
}
if (this._isCompound) {
var children = this._children[v];
if (children) {
return _.keys(children);
}
} else if (v === GRAPH_NODE) {
return this.nodes();
} else if (this.hasNode(v)) {
return [];
}
};
Graph.prototype.predecessors = function(v) {
var predsV = this._preds[v];
if (predsV) {
return _.keys(predsV);
}
};
Graph.prototype.successors = function(v) {
var sucsV = this._sucs[v];
if (sucsV) {
return _.keys(sucsV);
}
};
Graph.prototype.neighbors = function(v) {
var preds = this.predecessors(v);
if (preds) {
return _.union(preds, this.successors(v));
}
};
Graph.prototype.isLeaf = function (v) {
var neighbors;
if (this.isDirected()) {
neighbors = this.successors(v);
} else {
neighbors = this.neighbors(v);
}
return neighbors.length === 0;
};
Graph.prototype.filterNodes = function(filter) {
var copy = new this.constructor({
directed: this._isDirected,
multigraph: this._isMultigraph,
compound: this._isCompound
});
copy.setGraph(this.graph());
var self = this;
_.each(this._nodes, function(value, v) {
if (filter(v)) {
copy.setNode(v, value);
}
});
_.each(this._edgeObjs, function(e) {
if (copy.hasNode(e.v) && copy.hasNode(e.w)) {
copy.setEdge(e, self.edge(e));
}
});
var parents = {};
function findParent(v) {
var parent = self.parent(v);
if (parent === undefined || copy.hasNode(parent)) {
parents[v] = parent;
return parent;
} else if (parent in parents) {
return parents[parent];
} else {
return findParent(parent);
}
}
if (this._isCompound) {
_.each(copy.nodes(), function(v) {
copy.setParent(v, findParent(v));
});
}
return copy;
};
/* === Edge functions ========== */
Graph.prototype.setDefaultEdgeLabel = function(newDefault) {
if (!_.isFunction(newDefault)) {
newDefault = _.constant(newDefault);
}
this._defaultEdgeLabelFn = newDefault;
return this;
};
Graph.prototype.edgeCount = function() {
return this._edgeCount;
};
Graph.prototype.edges = function() {
return _.values(this._edgeObjs);
};
Graph.prototype.setPath = function(vs, value) {
var self = this;
var args = arguments;
_.reduce(vs, function(v, w) {
if (args.length > 1) {
self.setEdge(v, w, value);
} else {
self.setEdge(v, w);
}
return w;
});
return this;
};
/*
* setEdge(v, w, [value, [name]])
* setEdge({ v, w, [name] }, [value])
*/
Graph.prototype.setEdge = function() {
var v, w, name, value;
var valueSpecified = false;
var arg0 = arguments[0];
if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) {
v = arg0.v;
w = arg0.w;
name = arg0.name;
if (arguments.length === 2) {
value = arguments[1];
valueSpecified = true;
}
} else {
v = arg0;
w = arguments[1];
name = arguments[3];
if (arguments.length > 2) {
value = arguments[2];
valueSpecified = true;
}
}
v = "" + v;
w = "" + w;
if (!_.isUndefined(name)) {
name = "" + name;
}
var e = edgeArgsToId(this._isDirected, v, w, name);
if (_.has(this._edgeLabels, e)) {
if (valueSpecified) {
this._edgeLabels[e] = value;
}
return this;
}
if (!_.isUndefined(name) && !this._isMultigraph) {
throw new Error("Cannot set a named edge when isMultigraph = false");
}
// It didn't exist, so we need to create it.
// First ensure the nodes exist.
this.setNode(v);
this.setNode(w);
this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);
var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);
// Ensure we add undirected edges in a consistent way.
v = edgeObj.v;
w = edgeObj.w;
Object.freeze(edgeObj);
this._edgeObjs[e] = edgeObj;
incrementOrInitEntry(this._preds[w], v);
incrementOrInitEntry(this._sucs[v], w);
this._in[w][e] = edgeObj;
this._out[v][e] = edgeObj;
this._edgeCount++;
return this;
};
Graph.prototype.edge = function(v, w, name) {
var e = (arguments.length === 1
? edgeObjToId(this._isDirected, arguments[0])
: edgeArgsToId(this._isDirected, v, w, name));
return this._edgeLabels[e];
};
Graph.prototype.hasEdge = function(v, w, name) {
var e = (arguments.length === 1
? edgeObjToId(this._isDirected, arguments[0])
: edgeArgsToId(this._isDirected, v, w, name));
return _.has(this._edgeLabels, e);
};
Graph.prototype.removeEdge = function(v, w, name) {
var e = (arguments.length === 1
? edgeObjToId(this._isDirected, arguments[0])
: edgeArgsToId(this._isDirected, v, w, name));
var edge = this._edgeObjs[e];
if (edge) {
v = edge.v;
w = edge.w;
delete this._edgeLabels[e];
delete this._edgeObjs[e];
decrementOrRemoveEntry(this._preds[w], v);
decrementOrRemoveEntry(this._sucs[v], w);
delete this._in[w][e];
delete this._out[v][e];
this._edgeCount--;
}
return this;
};
Graph.prototype.inEdges = function(v, u) {
var inV = this._in[v];
if (inV) {
var edges = _.values(inV);
if (!u) {
return edges;
}
return _.filter(edges, function(edge) { return edge.v === u; });
}
};
Graph.prototype.outEdges = function(v, w) {
var outV = this._out[v];
if (outV) {
var edges = _.values(outV);
if (!w) {
return edges;
}
return _.filter(edges, function(edge) { return edge.w === w; });
}
};
Graph.prototype.nodeEdges = function(v, w) {
var inEdges = this.inEdges(v, w);
if (inEdges) {
return inEdges.concat(this.outEdges(v, w));
}
};
function incrementOrInitEntry(map, k) {
if (map[k]) {
map[k]++;
} else {
map[k] = 1;
}
}
function decrementOrRemoveEntry(map, k) {
if (!--map[k]) { delete map[k]; }
}
function edgeArgsToId(isDirected, v_, w_, name) {
var v = "" + v_;
var w = "" + w_;
if (!isDirected && v > w) {
var tmp = v;
v = w;
w = tmp;
}
return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM +
(_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);
}
function edgeArgsToObj(isDirected, v_, w_, name) {
var v = "" + v_;
var w = "" + w_;
if (!isDirected && v > w) {
var tmp = v;
v = w;
w = tmp;
}
var edgeObj = { v: v, w: w };
if (name) {
edgeObj.name = name;
}
return edgeObj;
}
function edgeObjToId(isDirected, edgeObj) {
return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/index.js":
/*!************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/index.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// Includes only the "core" of graphlib
module.exports = {
Graph: __webpack_require__(/*! ./graph */ "./node_modules/_graphlib@2.1.8@graphlib/lib/graph.js"),
version: __webpack_require__(/*! ./version */ "./node_modules/_graphlib@2.1.8@graphlib/lib/version.js")
};
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/json.js":
/*!***********************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/json.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(/*! ./lodash */ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js");
var Graph = __webpack_require__(/*! ./graph */ "./node_modules/_graphlib@2.1.8@graphlib/lib/graph.js");
module.exports = {
write: write,
read: read
};
function write(g) {
var json = {
options: {
directed: g.isDirected(),
multigraph: g.isMultigraph(),
compound: g.isCompound()
},
nodes: writeNodes(g),
edges: writeEdges(g)
};
if (!_.isUndefined(g.graph())) {
json.value = _.clone(g.graph());
}
return json;
}
function writeNodes(g) {
return _.map(g.nodes(), function(v) {
var nodeValue = g.node(v);
var parent = g.parent(v);
var node = { v: v };
if (!_.isUndefined(nodeValue)) {
node.value = nodeValue;
}
if (!_.isUndefined(parent)) {
node.parent = parent;
}
return node;
});
}
function writeEdges(g) {
return _.map(g.edges(), function(e) {
var edgeValue = g.edge(e);
var edge = { v: e.v, w: e.w };
if (!_.isUndefined(e.name)) {
edge.name = e.name;
}
if (!_.isUndefined(edgeValue)) {
edge.value = edgeValue;
}
return edge;
});
}
function read(json) {
var g = new Graph(json.options).setGraph(json.value);
_.each(json.nodes, function(entry) {
g.setNode(entry.v, entry.value);
if (entry.parent) {
g.setParent(entry.v, entry.parent);
}
});
_.each(json.edges, function(entry) {
g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);
});
return g;
}
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js":
/*!*************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/lodash.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* global window */
var lodash;
if (true) {
try {
lodash = {
clone: __webpack_require__(/*! lodash/clone */ "./node_modules/_lodash@4.17.20@lodash/clone.js"),
constant: __webpack_require__(/*! lodash/constant */ "./node_modules/_lodash@4.17.20@lodash/constant.js"),
each: __webpack_require__(/*! lodash/each */ "./node_modules/_lodash@4.17.20@lodash/each.js"),
filter: __webpack_require__(/*! lodash/filter */ "./node_modules/_lodash@4.17.20@lodash/filter.js"),
has: __webpack_require__(/*! lodash/has */ "./node_modules/_lodash@4.17.20@lodash/has.js"),
isArray: __webpack_require__(/*! lodash/isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isEmpty: __webpack_require__(/*! lodash/isEmpty */ "./node_modules/_lodash@4.17.20@lodash/isEmpty.js"),
isFunction: __webpack_require__(/*! lodash/isFunction */ "./node_modules/_lodash@4.17.20@lodash/isFunction.js"),
isUndefined: __webpack_require__(/*! lodash/isUndefined */ "./node_modules/_lodash@4.17.20@lodash/isUndefined.js"),
keys: __webpack_require__(/*! lodash/keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js"),
map: __webpack_require__(/*! lodash/map */ "./node_modules/_lodash@4.17.20@lodash/map.js"),
reduce: __webpack_require__(/*! lodash/reduce */ "./node_modules/_lodash@4.17.20@lodash/reduce.js"),
size: __webpack_require__(/*! lodash/size */ "./node_modules/_lodash@4.17.20@lodash/size.js"),
transform: __webpack_require__(/*! lodash/transform */ "./node_modules/_lodash@4.17.20@lodash/transform.js"),
union: __webpack_require__(/*! lodash/union */ "./node_modules/_lodash@4.17.20@lodash/union.js"),
values: __webpack_require__(/*! lodash/values */ "./node_modules/_lodash@4.17.20@lodash/values.js")
};
} catch (e) {
// continue regardless of error
}
}
if (!lodash) {
lodash = window._;
}
module.exports = lodash;
/***/ }),
/***/ "./node_modules/_graphlib@2.1.8@graphlib/lib/version.js":
/*!**************************************************************!*\
!*** ./node_modules/_graphlib@2.1.8@graphlib/lib/version.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = '2.1.8';
/***/ }),
/***/ "./node_modules/_isarray@0.0.1@isarray/index.js":
/*!******************************************************!*\
!*** ./node_modules/_isarray@0.0.1@isarray/index.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_DataView.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_DataView.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/_lodash@4.17.20@lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_Hash.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_Hash.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(/*! ./_hashClear */ "./node_modules/_lodash@4.17.20@lodash/_hashClear.js"),
hashDelete = __webpack_require__(/*! ./_hashDelete */ "./node_modules/_lodash@4.17.20@lodash/_hashDelete.js"),
hashGet = __webpack_require__(/*! ./_hashGet */ "./node_modules/_lodash@4.17.20@lodash/_hashGet.js"),
hashHas = __webpack_require__(/*! ./_hashHas */ "./node_modules/_lodash@4.17.20@lodash/_hashHas.js"),
hashSet = __webpack_require__(/*! ./_hashSet */ "./node_modules/_lodash@4.17.20@lodash/_hashSet.js");
/**
* 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]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_ListCache.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_ListCache.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "./node_modules/_lodash@4.17.20@lodash/_listCacheClear.js"),
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "./node_modules/_lodash@4.17.20@lodash/_listCacheDelete.js"),
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "./node_modules/_lodash@4.17.20@lodash/_listCacheGet.js"),
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "./node_modules/_lodash@4.17.20@lodash/_listCacheHas.js"),
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "./node_modules/_lodash@4.17.20@lodash/_listCacheSet.js");
/**
* 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]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_Map.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_Map.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/_lodash@4.17.20@lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_MapCache.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_MapCache.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "./node_modules/_lodash@4.17.20@lodash/_mapCacheClear.js"),
mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "./node_modules/_lodash@4.17.20@lodash/_mapCacheDelete.js"),
mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "./node_modules/_lodash@4.17.20@lodash/_mapCacheGet.js"),
mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "./node_modules/_lodash@4.17.20@lodash/_mapCacheHas.js"),
mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "./node_modules/_lodash@4.17.20@lodash/_mapCacheSet.js");
/**
* 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]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_Promise.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_Promise.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/_lodash@4.17.20@lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_Set.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_Set.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/_lodash@4.17.20@lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_SetCache.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_SetCache.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/_lodash@4.17.20@lodash/_MapCache.js"),
setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "./node_modules/_lodash@4.17.20@lodash/_setCacheAdd.js"),
setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "./node_modules/_lodash@4.17.20@lodash/_setCacheHas.js");
/**
*
* 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]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_Stack.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_Stack.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/_lodash@4.17.20@lodash/_ListCache.js"),
stackClear = __webpack_require__(/*! ./_stackClear */ "./node_modules/_lodash@4.17.20@lodash/_stackClear.js"),
stackDelete = __webpack_require__(/*! ./_stackDelete */ "./node_modules/_lodash@4.17.20@lodash/_stackDelete.js"),
stackGet = __webpack_require__(/*! ./_stackGet */ "./node_modules/_lodash@4.17.20@lodash/_stackGet.js"),
stackHas = __webpack_require__(/*! ./_stackHas */ "./node_modules/_lodash@4.17.20@lodash/_stackHas.js"),
stackSet = __webpack_require__(/*! ./_stackSet */ "./node_modules/_lodash@4.17.20@lodash/_stackSet.js");
/**
* 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;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_Symbol.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_Symbol.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_Uint8Array.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_Uint8Array.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_WeakMap.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_WeakMap.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/_lodash@4.17.20@lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_apply.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_apply.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {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);
}
module.exports = apply;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayEach.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayEach.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayEach;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayFilter.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayFilter.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayFilter;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayIncludes.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayIncludes.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/_lodash@4.17.20@lodash/_baseIndexOf.js");
/**
* 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;
}
module.exports = arrayIncludes;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayIncludesWith.js":
/*!*******************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayIncludesWith.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayIncludesWith;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayLikeKeys.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayLikeKeys.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/_lodash@4.17.20@lodash/_baseTimes.js"),
isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/_lodash@4.17.20@lodash/isArguments.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/_lodash@4.17.20@lodash/isBuffer.js"),
isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/_lodash@4.17.20@lodash/_isIndex.js"),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/_lodash@4.17.20@lodash/isTypedArray.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the 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;
}
module.exports = arrayLikeKeys;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayMap.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayMap.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayMap;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayPush.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayPush.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayPush;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arrayReduce.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arrayReduce.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayReduce;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_arraySome.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_arraySome.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arraySome;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_asciiSize.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_asciiSize.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(/*! ./_baseProperty */ "./node_modules/_lodash@4.17.20@lodash/_baseProperty.js");
/**
* Gets the size of an ASCII `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
var asciiSize = baseProperty('length');
module.exports = asciiSize;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_assignMergeValue.js":
/*!******************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_assignMergeValue.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/_lodash@4.17.20@lodash/_baseAssignValue.js"),
eq = __webpack_require__(/*! ./eq */ "./node_modules/_lodash@4.17.20@lodash/eq.js");
/**
* 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);
}
}
module.exports = assignMergeValue;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_assignValue.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_assignValue.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/_lodash@4.17.20@lodash/_baseAssignValue.js"),
eq = __webpack_require__(/*! ./eq */ "./node_modules/_lodash@4.17.20@lodash/eq.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/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);
}
}
module.exports = assignValue;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_assocIndexOf.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_assocIndexOf.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(/*! ./eq */ "./node_modules/_lodash@4.17.20@lodash/eq.js");
/**
* 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;
}
module.exports = assocIndexOf;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseAssign.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseAssign.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/_lodash@4.17.20@lodash/_copyObject.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js");
/**
* 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);
}
module.exports = baseAssign;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseAssignIn.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseAssignIn.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/_lodash@4.17.20@lodash/_copyObject.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/_lodash@4.17.20@lodash/keysIn.js");
/**
* 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);
}
module.exports = baseAssignIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseAssignValue.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseAssignValue.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/_lodash@4.17.20@lodash/_defineProperty.js");
/**
* 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;
}
}
module.exports = baseAssignValue;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseClone.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseClone.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/_lodash@4.17.20@lodash/_Stack.js"),
arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/_lodash@4.17.20@lodash/_arrayEach.js"),
assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/_lodash@4.17.20@lodash/_assignValue.js"),
baseAssign = __webpack_require__(/*! ./_baseAssign */ "./node_modules/_lodash@4.17.20@lodash/_baseAssign.js"),
baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "./node_modules/_lodash@4.17.20@lodash/_baseAssignIn.js"),
cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/_lodash@4.17.20@lodash/_cloneBuffer.js"),
copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/_lodash@4.17.20@lodash/_copyArray.js"),
copySymbols = __webpack_require__(/*! ./_copySymbols */ "./node_modules/_lodash@4.17.20@lodash/_copySymbols.js"),
copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "./node_modules/_lodash@4.17.20@lodash/_copySymbolsIn.js"),
getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/_lodash@4.17.20@lodash/_getAllKeys.js"),
getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/_lodash@4.17.20@lodash/_getAllKeysIn.js"),
getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/_lodash@4.17.20@lodash/_getTag.js"),
initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "./node_modules/_lodash@4.17.20@lodash/_initCloneArray.js"),
initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "./node_modules/_lodash@4.17.20@lodash/_initCloneByTag.js"),
initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/_lodash@4.17.20@lodash/_initCloneObject.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/_lodash@4.17.20@lodash/isBuffer.js"),
isMap = __webpack_require__(/*! ./isMap */ "./node_modules/_lodash@4.17.20@lodash/isMap.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
isSet = __webpack_require__(/*! ./isSet */ "./node_modules/_lodash@4.17.20@lodash/isSet.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/_lodash@4.17.20@lodash/keysIn.js");
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
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 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;
/**
* 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;
}
module.exports = baseClone;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseCreate.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseCreate.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js");
/** Built-in value references. */
var objectCreate = Object.create;
/**
* 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;
};
}());
module.exports = baseCreate;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseEach.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseEach.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/_lodash@4.17.20@lodash/_baseForOwn.js"),
createBaseEach = __webpack_require__(/*! ./_createBaseEach */ "./node_modules/_lodash@4.17.20@lodash/_createBaseEach.js");
/**
* 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);
module.exports = baseEach;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseExtremum.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseExtremum.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/_lodash@4.17.20@lodash/isSymbol.js");
/**
* 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;
}
module.exports = baseExtremum;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseFilter.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseFilter.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/_lodash@4.17.20@lodash/_baseEach.js");
/**
* 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;
}
module.exports = baseFilter;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseFindIndex.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseFindIndex.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseFindIndex;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseFlatten.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseFlatten.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/_lodash@4.17.20@lodash/_arrayPush.js"),
isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/_lodash@4.17.20@lodash/_isFlattenable.js");
/**
* 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;
}
module.exports = baseFlatten;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseFor.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseFor.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "./node_modules/_lodash@4.17.20@lodash/_createBaseFor.js");
/**
* 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();
module.exports = baseFor;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseForOwn.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseForOwn.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/_lodash@4.17.20@lodash/_baseFor.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js");
/**
* 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);
}
module.exports = baseForOwn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseGet.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseGet.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/_lodash@4.17.20@lodash/_castPath.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/_lodash@4.17.20@lodash/_toKey.js");
/**
* 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;
}
module.exports = baseGet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseGetAllKeys.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseGetAllKeys.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/_lodash@4.17.20@lodash/_arrayPush.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js");
/**
* 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));
}
module.exports = baseGetAllKeys;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/_lodash@4.17.20@lodash/_Symbol.js"),
getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/_lodash@4.17.20@lodash/_getRawTag.js"),
objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/_lodash@4.17.20@lodash/_objectToString.js");
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* 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);
}
module.exports = baseGetTag;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseGt.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseGt.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseGt;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseHas.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseHas.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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);
}
module.exports = baseHas;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseHasIn.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseHasIn.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = baseHasIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIndexOf.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIndexOf.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/_lodash@4.17.20@lodash/_baseFindIndex.js"),
baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ "./node_modules/_lodash@4.17.20@lodash/_baseIsNaN.js"),
strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ "./node_modules/_lodash@4.17.20@lodash/_strictIndexOf.js");
/**
* 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);
}
module.exports = baseIndexOf;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsArguments.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsArguments.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* 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;
}
module.exports = baseIsArguments;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsEqual.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsEqual.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "./node_modules/_lodash@4.17.20@lodash/_baseIsEqualDeep.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/**
* 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);
}
module.exports = baseIsEqual;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsEqualDeep.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsEqualDeep.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/_lodash@4.17.20@lodash/_Stack.js"),
equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/_lodash@4.17.20@lodash/_equalArrays.js"),
equalByTag = __webpack_require__(/*! ./_equalByTag */ "./node_modules/_lodash@4.17.20@lodash/_equalByTag.js"),
equalObjects = __webpack_require__(/*! ./_equalObjects */ "./node_modules/_lodash@4.17.20@lodash/_equalObjects.js"),
getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/_lodash@4.17.20@lodash/_getTag.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/_lodash@4.17.20@lodash/isBuffer.js"),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/_lodash@4.17.20@lodash/isTypedArray.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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);
}
module.exports = baseIsEqualDeep;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsMap.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsMap.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/_lodash@4.17.20@lodash/_getTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** `Object#toString` result references. */
var mapTag = '[object Map]';
/**
* 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;
}
module.exports = baseIsMap;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsMatch.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsMatch.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/_lodash@4.17.20@lodash/_Stack.js"),
baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/_lodash@4.17.20@lodash/_baseIsEqual.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* 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;
}
module.exports = baseIsMatch;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsNaN.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsNaN.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseIsNaN;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsNative.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsNative.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/_lodash@4.17.20@lodash/isFunction.js"),
isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/_lodash@4.17.20@lodash/_isMasked.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/_lodash@4.17.20@lodash/_toSource.js");
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** 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 detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* 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));
}
module.exports = baseIsNative;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsSet.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsSet.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/_lodash@4.17.20@lodash/_getTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** `Object#toString` result references. */
var setTag = '[object Set]';
/**
* 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;
}
module.exports = baseIsSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIsTypedArray.js":
/*!******************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIsTypedArray.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js"),
isLength = __webpack_require__(/*! ./isLength */ "./node_modules/_lodash@4.17.20@lodash/isLength.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
weakMapTag = '[object WeakMap]';
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 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;
/**
* 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)];
}
module.exports = baseIsTypedArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__(/*! ./_baseMatches */ "./node_modules/_lodash@4.17.20@lodash/_baseMatches.js"),
baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ "./node_modules/_lodash@4.17.20@lodash/_baseMatchesProperty.js"),
identity = __webpack_require__(/*! ./identity */ "./node_modules/_lodash@4.17.20@lodash/identity.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
property = __webpack_require__(/*! ./property */ "./node_modules/_lodash@4.17.20@lodash/property.js");
/**
* 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);
}
module.exports = baseIteratee;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseKeys.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseKeys.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/_lodash@4.17.20@lodash/_isPrototype.js"),
nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "./node_modules/_lodash@4.17.20@lodash/_nativeKeys.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = baseKeys;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseKeysIn.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseKeysIn.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/_lodash@4.17.20@lodash/_isPrototype.js"),
nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "./node_modules/_lodash@4.17.20@lodash/_nativeKeysIn.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = baseKeysIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseLt.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseLt.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseLt;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseMap.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseMap.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/_lodash@4.17.20@lodash/_baseEach.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js");
/**
* 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;
}
module.exports = baseMap;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseMatches.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseMatches.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ "./node_modules/_lodash@4.17.20@lodash/_baseIsMatch.js"),
getMatchData = __webpack_require__(/*! ./_getMatchData */ "./node_modules/_lodash@4.17.20@lodash/_getMatchData.js"),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/_lodash@4.17.20@lodash/_matchesStrictComparable.js");
/**
* 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);
};
}
module.exports = baseMatches;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseMatchesProperty.js":
/*!*********************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseMatchesProperty.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/_lodash@4.17.20@lodash/_baseIsEqual.js"),
get = __webpack_require__(/*! ./get */ "./node_modules/_lodash@4.17.20@lodash/get.js"),
hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/_lodash@4.17.20@lodash/hasIn.js"),
isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/_lodash@4.17.20@lodash/_isKey.js"),
isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/_lodash@4.17.20@lodash/_isStrictComparable.js"),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/_lodash@4.17.20@lodash/_matchesStrictComparable.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/_lodash@4.17.20@lodash/_toKey.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* 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);
};
}
module.exports = baseMatchesProperty;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseMerge.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseMerge.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/_lodash@4.17.20@lodash/_Stack.js"),
assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ "./node_modules/_lodash@4.17.20@lodash/_assignMergeValue.js"),
baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/_lodash@4.17.20@lodash/_baseFor.js"),
baseMergeDeep = __webpack_require__(/*! ./_baseMergeDeep */ "./node_modules/_lodash@4.17.20@lodash/_baseMergeDeep.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/_lodash@4.17.20@lodash/keysIn.js"),
safeGet = __webpack_require__(/*! ./_safeGet */ "./node_modules/_lodash@4.17.20@lodash/_safeGet.js");
/**
* 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);
}
module.exports = baseMerge;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseMergeDeep.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseMergeDeep.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ "./node_modules/_lodash@4.17.20@lodash/_assignMergeValue.js"),
cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/_lodash@4.17.20@lodash/_cloneBuffer.js"),
cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "./node_modules/_lodash@4.17.20@lodash/_cloneTypedArray.js"),
copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/_lodash@4.17.20@lodash/_copyArray.js"),
initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/_lodash@4.17.20@lodash/_initCloneObject.js"),
isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/_lodash@4.17.20@lodash/isArguments.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/_lodash@4.17.20@lodash/isArrayLikeObject.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/_lodash@4.17.20@lodash/isBuffer.js"),
isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/_lodash@4.17.20@lodash/isFunction.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
isPlainObject = __webpack_require__(/*! ./isPlainObject */ "./node_modules/_lodash@4.17.20@lodash/isPlainObject.js"),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/_lodash@4.17.20@lodash/isTypedArray.js"),
safeGet = __webpack_require__(/*! ./_safeGet */ "./node_modules/_lodash@4.17.20@lodash/_safeGet.js"),
toPlainObject = __webpack_require__(/*! ./toPlainObject */ "./node_modules/_lodash@4.17.20@lodash/toPlainObject.js");
/**
* 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);
}
module.exports = baseMergeDeep;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseOrderBy.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseOrderBy.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/_lodash@4.17.20@lodash/_arrayMap.js"),
baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/_lodash@4.17.20@lodash/_baseGet.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/_lodash@4.17.20@lodash/_baseMap.js"),
baseSortBy = __webpack_require__(/*! ./_baseSortBy */ "./node_modules/_lodash@4.17.20@lodash/_baseSortBy.js"),
baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/_lodash@4.17.20@lodash/_baseUnary.js"),
compareMultiple = __webpack_require__(/*! ./_compareMultiple */ "./node_modules/_lodash@4.17.20@lodash/_compareMultiple.js"),
identity = __webpack_require__(/*! ./identity */ "./node_modules/_lodash@4.17.20@lodash/identity.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js");
/**
* 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(baseIteratee));
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);
});
}
module.exports = baseOrderBy;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_basePick.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_basePick.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var basePickBy = __webpack_require__(/*! ./_basePickBy */ "./node_modules/_lodash@4.17.20@lodash/_basePickBy.js"),
hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/_lodash@4.17.20@lodash/hasIn.js");
/**
* 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);
});
}
module.exports = basePick;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_basePickBy.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_basePickBy.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/_lodash@4.17.20@lodash/_baseGet.js"),
baseSet = __webpack_require__(/*! ./_baseSet */ "./node_modules/_lodash@4.17.20@lodash/_baseSet.js"),
castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/_lodash@4.17.20@lodash/_castPath.js");
/**
* 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;
}
module.exports = basePickBy;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseProperty.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseProperty.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_basePropertyDeep.js":
/*!******************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_basePropertyDeep.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/_lodash@4.17.20@lodash/_baseGet.js");
/**
* 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);
};
}
module.exports = basePropertyDeep;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseRange.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseRange.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeMax = Math.max;
/**
* 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;
}
module.exports = baseRange;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseReduce.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseReduce.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseReduce;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseRest.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseRest.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ "./node_modules/_lodash@4.17.20@lodash/identity.js"),
overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/_lodash@4.17.20@lodash/_overRest.js"),
setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/_lodash@4.17.20@lodash/_setToString.js");
/**
* 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 + '');
}
module.exports = baseRest;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseSet.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseSet.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/_lodash@4.17.20@lodash/_assignValue.js"),
castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/_lodash@4.17.20@lodash/_castPath.js"),
isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/_lodash@4.17.20@lodash/_isIndex.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/_lodash@4.17.20@lodash/_toKey.js");
/**
* 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;
}
module.exports = baseSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseSetToString.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseSetToString.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var constant = __webpack_require__(/*! ./constant */ "./node_modules/_lodash@4.17.20@lodash/constant.js"),
defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/_lodash@4.17.20@lodash/_defineProperty.js"),
identity = __webpack_require__(/*! ./identity */ "./node_modules/_lodash@4.17.20@lodash/identity.js");
/**
* 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
});
};
module.exports = baseSetToString;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseSortBy.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseSortBy.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseSortBy;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseTimes.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseTimes.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
module.exports = baseTimes;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseToString.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseToString.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/_lodash@4.17.20@lodash/_Symbol.js"),
arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/_lodash@4.17.20@lodash/_arrayMap.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/_lodash@4.17.20@lodash/isSymbol.js");
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* 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;
}
module.exports = baseToString;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseUnary.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseUnary.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
};
}
module.exports = baseUnary;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseUniq.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseUniq.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/_lodash@4.17.20@lodash/_SetCache.js"),
arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/_lodash@4.17.20@lodash/_arrayIncludes.js"),
arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "./node_modules/_lodash@4.17.20@lodash/_arrayIncludesWith.js"),
cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/_lodash@4.17.20@lodash/_cacheHas.js"),
createSet = __webpack_require__(/*! ./_createSet */ "./node_modules/_lodash@4.17.20@lodash/_createSet.js"),
setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/_lodash@4.17.20@lodash/_setToArray.js");
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* 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;
}
module.exports = baseUniq;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseValues.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseValues.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/_lodash@4.17.20@lodash/_arrayMap.js");
/**
* 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];
});
}
module.exports = baseValues;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_baseZipObject.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_baseZipObject.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseZipObject;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_cacheHas.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_cacheHas.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = cacheHas;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_castFunction.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_castFunction.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ "./node_modules/_lodash@4.17.20@lodash/identity.js");
/**
* 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;
}
module.exports = castFunction;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_castPath.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_castPath.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/_lodash@4.17.20@lodash/_isKey.js"),
stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/_lodash@4.17.20@lodash/_stringToPath.js"),
toString = __webpack_require__(/*! ./toString */ "./node_modules/_lodash@4.17.20@lodash/toString.js");
/**
* 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));
}
module.exports = castPath;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_cloneArrayBuffer.js":
/*!******************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_cloneArrayBuffer.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/_lodash@4.17.20@lodash/_Uint8Array.js");
/**
* 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;
}
module.exports = cloneArrayBuffer;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_cloneBuffer.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_cloneBuffer.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/** 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;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
/**
* 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;
}
module.exports = cloneBuffer;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_webpack@4.44.2@webpack/buildin/module.js */ "./node_modules/_webpack@4.44.2@webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_cloneDataView.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_cloneDataView.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/_lodash@4.17.20@lodash/_cloneArrayBuffer.js");
/**
* 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);
}
module.exports = cloneDataView;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_cloneRegExp.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_cloneRegExp.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* 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;
}
module.exports = cloneRegExp;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_cloneSymbol.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_cloneSymbol.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/_lodash@4.17.20@lodash/_Symbol.js");
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* 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)) : {};
}
module.exports = cloneSymbol;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_cloneTypedArray.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_cloneTypedArray.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/_lodash@4.17.20@lodash/_cloneArrayBuffer.js");
/**
* 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);
}
module.exports = cloneTypedArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_compareAscending.js":
/*!******************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_compareAscending.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/_lodash@4.17.20@lodash/isSymbol.js");
/**
* 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;
}
module.exports = compareAscending;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_compareMultiple.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_compareMultiple.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var compareAscending = __webpack_require__(/*! ./_compareAscending */ "./node_modules/_lodash@4.17.20@lodash/_compareAscending.js");
/**
* 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;
}
module.exports = compareMultiple;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_copyArray.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_copyArray.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = copyArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_copyObject.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_copyObject.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/_lodash@4.17.20@lodash/_assignValue.js"),
baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/_lodash@4.17.20@lodash/_baseAssignValue.js");
/**
* 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;
}
module.exports = copyObject;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_copySymbols.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_copySymbols.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/_lodash@4.17.20@lodash/_copyObject.js"),
getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/_lodash@4.17.20@lodash/_getSymbols.js");
/**
* 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);
}
module.exports = copySymbols;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_copySymbolsIn.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_copySymbolsIn.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/_lodash@4.17.20@lodash/_copyObject.js"),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/_lodash@4.17.20@lodash/_getSymbolsIn.js");
/**
* 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);
}
module.exports = copySymbolsIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_coreJsData.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_coreJsData.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_createAssigner.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_createAssigner.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/_lodash@4.17.20@lodash/_baseRest.js"),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/_lodash@4.17.20@lodash/_isIterateeCall.js");
/**
* 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;
});
}
module.exports = createAssigner;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_createBaseEach.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_createBaseEach.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js");
/**
* 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;
};
}
module.exports = createBaseEach;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_createBaseFor.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_createBaseFor.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
};
}
module.exports = createBaseFor;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_createFind.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_createFind.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js");
/**
* 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 = baseIteratee(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;
};
}
module.exports = createFind;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_createRange.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_createRange.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseRange = __webpack_require__(/*! ./_baseRange */ "./node_modules/_lodash@4.17.20@lodash/_baseRange.js"),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/_lodash@4.17.20@lodash/_isIterateeCall.js"),
toFinite = __webpack_require__(/*! ./toFinite */ "./node_modules/_lodash@4.17.20@lodash/toFinite.js");
/**
* 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);
};
}
module.exports = createRange;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_createSet.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_createSet.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Set = __webpack_require__(/*! ./_Set */ "./node_modules/_lodash@4.17.20@lodash/_Set.js"),
noop = __webpack_require__(/*! ./noop */ "./node_modules/_lodash@4.17.20@lodash/noop.js"),
setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/_lodash@4.17.20@lodash/_setToArray.js");
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* 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);
};
module.exports = createSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_defineProperty.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_defineProperty.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/_lodash@4.17.20@lodash/_getNative.js");
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_equalArrays.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_equalArrays.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/_lodash@4.17.20@lodash/_SetCache.js"),
arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/_lodash@4.17.20@lodash/_arraySome.js"),
cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/_lodash@4.17.20@lodash/_cacheHas.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* 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;
}
module.exports = equalArrays;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_equalByTag.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_equalByTag.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/_lodash@4.17.20@lodash/_Symbol.js"),
Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/_lodash@4.17.20@lodash/_Uint8Array.js"),
eq = __webpack_require__(/*! ./eq */ "./node_modules/_lodash@4.17.20@lodash/eq.js"),
equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/_lodash@4.17.20@lodash/_equalArrays.js"),
mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/_lodash@4.17.20@lodash/_mapToArray.js"),
setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/_lodash@4.17.20@lodash/_setToArray.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* 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;
}
module.exports = equalByTag;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_equalObjects.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_equalObjects.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/_lodash@4.17.20@lodash/_getAllKeys.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = equalObjects;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_flatRest.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_flatRest.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var flatten = __webpack_require__(/*! ./flatten */ "./node_modules/_lodash@4.17.20@lodash/flatten.js"),
overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/_lodash@4.17.20@lodash/_overRest.js"),
setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/_lodash@4.17.20@lodash/_setToString.js");
/**
* 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 + '');
}
module.exports = flatRest;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_freeGlobal.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_freeGlobal.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_webpack@4.44.2@webpack/buildin/global.js */ "./node_modules/_webpack@4.44.2@webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getAllKeys.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getAllKeys.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/_lodash@4.17.20@lodash/_baseGetAllKeys.js"),
getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/_lodash@4.17.20@lodash/_getSymbols.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js");
/**
* 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);
}
module.exports = getAllKeys;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getAllKeysIn.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getAllKeysIn.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/_lodash@4.17.20@lodash/_baseGetAllKeys.js"),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/_lodash@4.17.20@lodash/_getSymbolsIn.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/_lodash@4.17.20@lodash/keysIn.js");
/**
* 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);
}
module.exports = getAllKeysIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getMapData.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getMapData.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(/*! ./_isKeyable */ "./node_modules/_lodash@4.17.20@lodash/_isKeyable.js");
/**
* 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;
}
module.exports = getMapData;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getMatchData.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getMatchData.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/_lodash@4.17.20@lodash/_isStrictComparable.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js");
/**
* 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;
}
module.exports = getMatchData;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getNative.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getNative.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "./node_modules/_lodash@4.17.20@lodash/_baseIsNative.js"),
getValue = __webpack_require__(/*! ./_getValue */ "./node_modules/_lodash@4.17.20@lodash/_getValue.js");
/**
* 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;
}
module.exports = getNative;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getPrototype.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getPrototype.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/_lodash@4.17.20@lodash/_overArg.js");
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getRawTag.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getRawTag.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/_lodash@4.17.20@lodash/_Symbol.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : 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;
}
module.exports = getRawTag;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getSymbols.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getSymbols.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/_lodash@4.17.20@lodash/_arrayFilter.js"),
stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/_lodash@4.17.20@lodash/stubArray.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* 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);
});
};
module.exports = getSymbols;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getSymbolsIn.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getSymbolsIn.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/_lodash@4.17.20@lodash/_arrayPush.js"),
getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/_lodash@4.17.20@lodash/_getPrototype.js"),
getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/_lodash@4.17.20@lodash/_getSymbols.js"),
stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/_lodash@4.17.20@lodash/stubArray.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* 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;
};
module.exports = getSymbolsIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getTag.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getTag.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(/*! ./_DataView */ "./node_modules/_lodash@4.17.20@lodash/_DataView.js"),
Map = __webpack_require__(/*! ./_Map */ "./node_modules/_lodash@4.17.20@lodash/_Map.js"),
Promise = __webpack_require__(/*! ./_Promise */ "./node_modules/_lodash@4.17.20@lodash/_Promise.js"),
Set = __webpack_require__(/*! ./_Set */ "./node_modules/_lodash@4.17.20@lodash/_Set.js"),
WeakMap = __webpack_require__(/*! ./_WeakMap */ "./node_modules/_lodash@4.17.20@lodash/_WeakMap.js"),
baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js"),
toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/_lodash@4.17.20@lodash/_toSource.js");
/** `Object#toString` result references. */
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* 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;
};
}
module.exports = getTag;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_getValue.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_getValue.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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];
}
module.exports = getValue;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_hasPath.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_hasPath.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/_lodash@4.17.20@lodash/_castPath.js"),
isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/_lodash@4.17.20@lodash/isArguments.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/_lodash@4.17.20@lodash/_isIndex.js"),
isLength = __webpack_require__(/*! ./isLength */ "./node_modules/_lodash@4.17.20@lodash/isLength.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/_lodash@4.17.20@lodash/_toKey.js");
/**
* 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));
}
module.exports = hasPath;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_hasUnicode.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_hasUnicode.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsVarRange = '\\ufe0e\\ufe0f';
/** Used to compose unicode capture groups. */
var rsZWJ = '\\u200d';
/** 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 + ']');
/**
* 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);
}
module.exports = hasUnicode;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_hashClear.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_hashClear.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/_lodash@4.17.20@lodash/_nativeCreate.js");
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_hashDelete.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_hashDelete.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = hashDelete;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_hashGet.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_hashGet.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/_lodash@4.17.20@lodash/_nativeCreate.js");
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = hashGet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_hashHas.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_hashHas.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/_lodash@4.17.20@lodash/_nativeCreate.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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);
}
module.exports = hashHas;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_hashSet.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_hashSet.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/_lodash@4.17.20@lodash/_nativeCreate.js");
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* 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;
}
module.exports = hashSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_initCloneArray.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_initCloneArray.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = initCloneArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_initCloneByTag.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_initCloneByTag.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/_lodash@4.17.20@lodash/_cloneArrayBuffer.js"),
cloneDataView = __webpack_require__(/*! ./_cloneDataView */ "./node_modules/_lodash@4.17.20@lodash/_cloneDataView.js"),
cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ "./node_modules/_lodash@4.17.20@lodash/_cloneRegExp.js"),
cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ "./node_modules/_lodash@4.17.20@lodash/_cloneSymbol.js"),
cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "./node_modules/_lodash@4.17.20@lodash/_cloneTypedArray.js");
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
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]';
/**
* 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);
}
}
module.exports = initCloneByTag;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_initCloneObject.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_initCloneObject.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ "./node_modules/_lodash@4.17.20@lodash/_baseCreate.js"),
getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/_lodash@4.17.20@lodash/_getPrototype.js"),
isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/_lodash@4.17.20@lodash/_isPrototype.js");
/**
* 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))
: {};
}
module.exports = initCloneObject;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isFlattenable.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isFlattenable.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/_lodash@4.17.20@lodash/_Symbol.js"),
isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/_lodash@4.17.20@lodash/isArguments.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js");
/** Built-in value references. */
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* 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]);
}
module.exports = isFlattenable;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isIndex.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isIndex.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
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);
}
module.exports = isIndex;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isIterateeCall.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isIterateeCall.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(/*! ./eq */ "./node_modules/_lodash@4.17.20@lodash/eq.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js"),
isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/_lodash@4.17.20@lodash/_isIndex.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js");
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isKey.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isKey.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/_lodash@4.17.20@lodash/isSymbol.js");
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* 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));
}
module.exports = isKey;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isKeyable.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isKeyable.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = isKeyable;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isMasked.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isMasked.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(/*! ./_coreJsData */ "./node_modules/_lodash@4.17.20@lodash/_coreJsData.js");
/** 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) : '';
}());
/**
* 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);
}
module.exports = isMasked;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isPrototype.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isPrototype.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
module.exports = isPrototype;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_isStrictComparable.js":
/*!********************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_isStrictComparable.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js");
/**
* 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);
}
module.exports = isStrictComparable;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_listCacheClear.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_listCacheClear.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_listCacheDelete.js":
/*!*****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_listCacheDelete.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/_lodash@4.17.20@lodash/_assocIndexOf.js");
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* 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;
}
module.exports = listCacheDelete;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_listCacheGet.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_listCacheGet.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/_lodash@4.17.20@lodash/_assocIndexOf.js");
/**
* 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];
}
module.exports = listCacheGet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_listCacheHas.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_listCacheHas.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/_lodash@4.17.20@lodash/_assocIndexOf.js");
/**
* 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;
}
module.exports = listCacheHas;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_listCacheSet.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_listCacheSet.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/_lodash@4.17.20@lodash/_assocIndexOf.js");
/**
* 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;
}
module.exports = listCacheSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_mapCacheClear.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_mapCacheClear.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(/*! ./_Hash */ "./node_modules/_lodash@4.17.20@lodash/_Hash.js"),
ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/_lodash@4.17.20@lodash/_ListCache.js"),
Map = __webpack_require__(/*! ./_Map */ "./node_modules/_lodash@4.17.20@lodash/_Map.js");
/**
* 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
};
}
module.exports = mapCacheClear;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_mapCacheDelete.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_mapCacheDelete.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/_lodash@4.17.20@lodash/_getMapData.js");
/**
* 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;
}
module.exports = mapCacheDelete;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_mapCacheGet.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_mapCacheGet.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/_lodash@4.17.20@lodash/_getMapData.js");
/**
* 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);
}
module.exports = mapCacheGet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_mapCacheHas.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_mapCacheHas.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/_lodash@4.17.20@lodash/_getMapData.js");
/**
* 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);
}
module.exports = mapCacheHas;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_mapCacheSet.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_mapCacheSet.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/_lodash@4.17.20@lodash/_getMapData.js");
/**
* 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;
}
module.exports = mapCacheSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_mapToArray.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_mapToArray.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = mapToArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_matchesStrictComparable.js":
/*!*************************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_matchesStrictComparable.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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)));
};
}
module.exports = matchesStrictComparable;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_memoizeCapped.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_memoizeCapped.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(/*! ./memoize */ "./node_modules/_lodash@4.17.20@lodash/memoize.js");
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* 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;
}
module.exports = memoizeCapped;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_nativeCreate.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_nativeCreate.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/_lodash@4.17.20@lodash/_getNative.js");
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_nativeKeys.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_nativeKeys.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/_lodash@4.17.20@lodash/_overArg.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_nativeKeysIn.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_nativeKeysIn.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = nativeKeysIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_nodeUtil.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_nodeUtil.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/_lodash@4.17.20@lodash/_freeGlobal.js");
/** 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) {}
}());
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_webpack@4.44.2@webpack/buildin/module.js */ "./node_modules/_webpack@4.44.2@webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_objectToString.js":
/*!****************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_objectToString.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* 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);
}
module.exports = objectToString;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_overArg.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_overArg.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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));
};
}
module.exports = overArg;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_overRest.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_overRest.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ "./node_modules/_lodash@4.17.20@lodash/_apply.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* 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);
};
}
module.exports = overRest;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_root.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_root.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/_lodash@4.17.20@lodash/_freeGlobal.js");
/** 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')();
module.exports = root;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_safeGet.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_safeGet.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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];
}
module.exports = safeGet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_setCacheAdd.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_setCacheAdd.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* 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;
}
module.exports = setCacheAdd;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_setCacheHas.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_setCacheHas.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = setCacheHas;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_setToArray.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_setToArray.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = setToArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_setToString.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_setToString.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "./node_modules/_lodash@4.17.20@lodash/_baseSetToString.js"),
shortOut = __webpack_require__(/*! ./_shortOut */ "./node_modules/_lodash@4.17.20@lodash/_shortOut.js");
/**
* 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);
module.exports = setToString;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_shortOut.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_shortOut.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* 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);
};
}
module.exports = shortOut;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_stackClear.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_stackClear.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/_lodash@4.17.20@lodash/_ListCache.js");
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
module.exports = stackClear;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_stackDelete.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_stackDelete.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = stackDelete;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_stackGet.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_stackGet.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = stackGet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_stackHas.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_stackHas.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = stackHas;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_stackSet.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_stackSet.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/_lodash@4.17.20@lodash/_ListCache.js"),
Map = __webpack_require__(/*! ./_Map */ "./node_modules/_lodash@4.17.20@lodash/_Map.js"),
MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/_lodash@4.17.20@lodash/_MapCache.js");
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* 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;
}
module.exports = stackSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_strictIndexOf.js":
/*!***************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_strictIndexOf.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = strictIndexOf;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_stringSize.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_stringSize.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var asciiSize = __webpack_require__(/*! ./_asciiSize */ "./node_modules/_lodash@4.17.20@lodash/_asciiSize.js"),
hasUnicode = __webpack_require__(/*! ./_hasUnicode */ "./node_modules/_lodash@4.17.20@lodash/_hasUnicode.js"),
unicodeSize = __webpack_require__(/*! ./_unicodeSize */ "./node_modules/_lodash@4.17.20@lodash/_unicodeSize.js");
/**
* 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);
}
module.exports = stringSize;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_stringToPath.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_stringToPath.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "./node_modules/_lodash@4.17.20@lodash/_memoizeCapped.js");
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* 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;
});
module.exports = stringToPath;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_toKey.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_toKey.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/_lodash@4.17.20@lodash/isSymbol.js");
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* 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;
}
module.exports = toKey;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_toSource.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_toSource.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* 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 '';
}
module.exports = toSource;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/_unicodeSize.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/_unicodeSize.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsVarRange = '\\ufe0e\\ufe0f';
/** Used to compose unicode capture groups. */
var rsAstral = '[' + rsAstralRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/**
* 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;
}
module.exports = unicodeSize;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/clone.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/clone.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ "./node_modules/_lodash@4.17.20@lodash/_baseClone.js");
/** Used to compose bitmasks for cloning. */
var CLONE_SYMBOLS_FLAG = 4;
/**
* 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);
}
module.exports = clone;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/cloneDeep.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/cloneDeep.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ "./node_modules/_lodash@4.17.20@lodash/_baseClone.js");
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_SYMBOLS_FLAG = 4;
/**
* 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);
}
module.exports = cloneDeep;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/constant.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/constant.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
};
}
module.exports = constant;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/defaults.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/defaults.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/_lodash@4.17.20@lodash/_baseRest.js"),
eq = __webpack_require__(/*! ./eq */ "./node_modules/_lodash@4.17.20@lodash/eq.js"),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/_lodash@4.17.20@lodash/_isIterateeCall.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/_lodash@4.17.20@lodash/keysIn.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
});
module.exports = defaults;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/each.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/each.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./forEach */ "./node_modules/_lodash@4.17.20@lodash/forEach.js");
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/eq.js":
/*!***************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/eq.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = eq;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/filter.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/filter.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/_lodash@4.17.20@lodash/_arrayFilter.js"),
baseFilter = __webpack_require__(/*! ./_baseFilter */ "./node_modules/_lodash@4.17.20@lodash/_baseFilter.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js");
/**
* 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, baseIteratee(predicate, 3));
}
module.exports = filter;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/find.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/find.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var createFind = __webpack_require__(/*! ./_createFind */ "./node_modules/_lodash@4.17.20@lodash/_createFind.js"),
findIndex = __webpack_require__(/*! ./findIndex */ "./node_modules/_lodash@4.17.20@lodash/findIndex.js");
/**
* 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);
module.exports = find;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/findIndex.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/findIndex.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/_lodash@4.17.20@lodash/_baseFindIndex.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/_lodash@4.17.20@lodash/toInteger.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* 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, baseIteratee(predicate, 3), index);
}
module.exports = findIndex;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/flatten.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/flatten.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/_lodash@4.17.20@lodash/_baseFlatten.js");
/**
* 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) : [];
}
module.exports = flatten;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/forEach.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/forEach.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/_lodash@4.17.20@lodash/_arrayEach.js"),
baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/_lodash@4.17.20@lodash/_baseEach.js"),
castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/_lodash@4.17.20@lodash/_castFunction.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js");
/**
* 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, castFunction(iteratee));
}
module.exports = forEach;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/forIn.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/forIn.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/_lodash@4.17.20@lodash/_baseFor.js"),
castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/_lodash@4.17.20@lodash/_castFunction.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/_lodash@4.17.20@lodash/keysIn.js");
/**
* 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, castFunction(iteratee), keysIn);
}
module.exports = forIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/get.js":
/*!****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/get.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/_lodash@4.17.20@lodash/_baseGet.js");
/**
* 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;
}
module.exports = get;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/has.js":
/*!****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/has.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseHas = __webpack_require__(/*! ./_baseHas */ "./node_modules/_lodash@4.17.20@lodash/_baseHas.js"),
hasPath = __webpack_require__(/*! ./_hasPath */ "./node_modules/_lodash@4.17.20@lodash/_hasPath.js");
/**
* 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);
}
module.exports = has;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/hasIn.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/hasIn.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ "./node_modules/_lodash@4.17.20@lodash/_baseHasIn.js"),
hasPath = __webpack_require__(/*! ./_hasPath */ "./node_modules/_lodash@4.17.20@lodash/_hasPath.js");
/**
* 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);
}
module.exports = hasIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/identity.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/identity.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = identity;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isArguments.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isArguments.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/_lodash@4.17.20@lodash/_baseIsArguments.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* 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');
};
module.exports = isArguments;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isArray.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isArray.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
module.exports = isArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isArrayLike.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/_lodash@4.17.20@lodash/isFunction.js"),
isLength = __webpack_require__(/*! ./isLength */ "./node_modules/_lodash@4.17.20@lodash/isLength.js");
/**
* 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);
}
module.exports = isArrayLike;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isArrayLikeObject.js":
/*!******************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isArrayLikeObject.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/**
* 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);
}
module.exports = isArrayLikeObject;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isBuffer.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isBuffer.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js"),
stubFalse = __webpack_require__(/*! ./stubFalse */ "./node_modules/_lodash@4.17.20@lodash/stubFalse.js");
/** 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;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* 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;
module.exports = isBuffer;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_webpack@4.44.2@webpack/buildin/module.js */ "./node_modules/_webpack@4.44.2@webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isEmpty.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isEmpty.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/_lodash@4.17.20@lodash/_baseKeys.js"),
getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/_lodash@4.17.20@lodash/_getTag.js"),
isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/_lodash@4.17.20@lodash/isArguments.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/_lodash@4.17.20@lodash/isBuffer.js"),
isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/_lodash@4.17.20@lodash/_isPrototype.js"),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/_lodash@4.17.20@lodash/isTypedArray.js");
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = isEmpty;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isFunction.js":
/*!***********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isFunction.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js");
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* 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;
}
module.exports = isFunction;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isLength.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isLength.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This 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;
}
module.exports = isLength;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isMap.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isMap.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ "./node_modules/_lodash@4.17.20@lodash/_baseIsMap.js"),
baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/_lodash@4.17.20@lodash/_baseUnary.js"),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/_lodash@4.17.20@lodash/_nodeUtil.js");
/* Node.js helper references. */
var nodeIsMap = nodeUtil && nodeUtil.isMap;
/**
* 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;
module.exports = isMap;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isObject.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isObject.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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');
}
module.exports = isObject;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isObjectLike.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @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';
}
module.exports = isObjectLike;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isPlainObject.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isPlainObject.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js"),
getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/_lodash@4.17.20@lodash/_getPrototype.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** 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 infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* 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;
}
module.exports = isPlainObject;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isSet.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isSet.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ "./node_modules/_lodash@4.17.20@lodash/_baseIsSet.js"),
baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/_lodash@4.17.20@lodash/_baseUnary.js"),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/_lodash@4.17.20@lodash/_nodeUtil.js");
/* Node.js helper references. */
var nodeIsSet = nodeUtil && nodeUtil.isSet;
/**
* 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;
module.exports = isSet;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isString.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isString.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** `Object#toString` result references. */
var stringTag = '[object String]';
/**
* 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);
}
module.exports = isString;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isSymbol.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isSymbol.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/_lodash@4.17.20@lodash/_baseGetTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/_lodash@4.17.20@lodash/isObjectLike.js");
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* 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);
}
module.exports = isSymbol;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isTypedArray.js":
/*!*************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isTypedArray.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "./node_modules/_lodash@4.17.20@lodash/_baseIsTypedArray.js"),
baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/_lodash@4.17.20@lodash/_baseUnary.js"),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/_lodash@4.17.20@lodash/_nodeUtil.js");
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* 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;
module.exports = isTypedArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/isUndefined.js":
/*!************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/isUndefined.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = isUndefined;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/keys.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/keys.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/_lodash@4.17.20@lodash/_arrayLikeKeys.js"),
baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/_lodash@4.17.20@lodash/_baseKeys.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js");
/**
* 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);
}
module.exports = keys;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/keysIn.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/keysIn.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/_lodash@4.17.20@lodash/_arrayLikeKeys.js"),
baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "./node_modules/_lodash@4.17.20@lodash/_baseKeysIn.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js");
/**
* 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);
}
module.exports = keysIn;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/last.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/last.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = last;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/map.js":
/*!****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/map.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/_lodash@4.17.20@lodash/_arrayMap.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/_lodash@4.17.20@lodash/_baseMap.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js");
/**
* 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, baseIteratee(iteratee, 3));
}
module.exports = map;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/mapValues.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/mapValues.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/_lodash@4.17.20@lodash/_baseAssignValue.js"),
baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/_lodash@4.17.20@lodash/_baseForOwn.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js");
/**
* 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 = baseIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
baseAssignValue(result, key, iteratee(value, key, object));
});
return result;
}
module.exports = mapValues;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/max.js":
/*!****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/max.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseExtremum = __webpack_require__(/*! ./_baseExtremum */ "./node_modules/_lodash@4.17.20@lodash/_baseExtremum.js"),
baseGt = __webpack_require__(/*! ./_baseGt */ "./node_modules/_lodash@4.17.20@lodash/_baseGt.js"),
identity = __webpack_require__(/*! ./identity */ "./node_modules/_lodash@4.17.20@lodash/identity.js");
/**
* 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;
}
module.exports = max;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/memoize.js":
/*!********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/memoize.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/_lodash@4.17.20@lodash/_MapCache.js");
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* 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;
module.exports = memoize;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/merge.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/merge.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseMerge = __webpack_require__(/*! ./_baseMerge */ "./node_modules/_lodash@4.17.20@lodash/_baseMerge.js"),
createAssigner = __webpack_require__(/*! ./_createAssigner */ "./node_modules/_lodash@4.17.20@lodash/_createAssigner.js");
/**
* 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);
});
module.exports = merge;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/min.js":
/*!****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/min.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseExtremum = __webpack_require__(/*! ./_baseExtremum */ "./node_modules/_lodash@4.17.20@lodash/_baseExtremum.js"),
baseLt = __webpack_require__(/*! ./_baseLt */ "./node_modules/_lodash@4.17.20@lodash/_baseLt.js"),
identity = __webpack_require__(/*! ./identity */ "./node_modules/_lodash@4.17.20@lodash/identity.js");
/**
* 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;
}
module.exports = min;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/minBy.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/minBy.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseExtremum = __webpack_require__(/*! ./_baseExtremum */ "./node_modules/_lodash@4.17.20@lodash/_baseExtremum.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
baseLt = __webpack_require__(/*! ./_baseLt */ "./node_modules/_lodash@4.17.20@lodash/_baseLt.js");
/**
* 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, baseIteratee(iteratee, 2), baseLt)
: undefined;
}
module.exports = minBy;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/noop.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/noop.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = noop;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/now.js":
/*!****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/now.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/_lodash@4.17.20@lodash/_root.js");
/**
* 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 = function() {
return root.Date.now();
};
module.exports = now;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/pick.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/pick.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var basePick = __webpack_require__(/*! ./_basePick */ "./node_modules/_lodash@4.17.20@lodash/_basePick.js"),
flatRest = __webpack_require__(/*! ./_flatRest */ "./node_modules/_lodash@4.17.20@lodash/_flatRest.js");
/**
* 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);
});
module.exports = pick;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/property.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/property.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(/*! ./_baseProperty */ "./node_modules/_lodash@4.17.20@lodash/_baseProperty.js"),
basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ "./node_modules/_lodash@4.17.20@lodash/_basePropertyDeep.js"),
isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/_lodash@4.17.20@lodash/_isKey.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/_lodash@4.17.20@lodash/_toKey.js");
/**
* 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);
}
module.exports = property;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/range.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/range.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var createRange = __webpack_require__(/*! ./_createRange */ "./node_modules/_lodash@4.17.20@lodash/_createRange.js");
/**
* 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();
module.exports = range;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/reduce.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/reduce.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayReduce = __webpack_require__(/*! ./_arrayReduce */ "./node_modules/_lodash@4.17.20@lodash/_arrayReduce.js"),
baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/_lodash@4.17.20@lodash/_baseEach.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
baseReduce = __webpack_require__(/*! ./_baseReduce */ "./node_modules/_lodash@4.17.20@lodash/_baseReduce.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js");
/**
* 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, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
module.exports = reduce;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/size.js":
/*!*****************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/size.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/_lodash@4.17.20@lodash/_baseKeys.js"),
getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/_lodash@4.17.20@lodash/_getTag.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/_lodash@4.17.20@lodash/isArrayLike.js"),
isString = __webpack_require__(/*! ./isString */ "./node_modules/_lodash@4.17.20@lodash/isString.js"),
stringSize = __webpack_require__(/*! ./_stringSize */ "./node_modules/_lodash@4.17.20@lodash/_stringSize.js");
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/**
* 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;
}
module.exports = size;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/sortBy.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/sortBy.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/_lodash@4.17.20@lodash/_baseFlatten.js"),
baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "./node_modules/_lodash@4.17.20@lodash/_baseOrderBy.js"),
baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/_lodash@4.17.20@lodash/_baseRest.js"),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/_lodash@4.17.20@lodash/_isIterateeCall.js");
/**
* 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), []);
});
module.exports = sortBy;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/stubArray.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/stubArray.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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 [];
}
module.exports = stubArray;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/stubFalse.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/stubFalse.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = stubFalse;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/toFinite.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/toFinite.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/_lodash@4.17.20@lodash/toNumber.js");
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* 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;
}
module.exports = toFinite;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/toInteger.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/toInteger.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(/*! ./toFinite */ "./node_modules/_lodash@4.17.20@lodash/toFinite.js");
/**
* 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;
}
module.exports = toInteger;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/toNumber.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/toNumber.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/_lodash@4.17.20@lodash/isSymbol.js");
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @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 = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/toPlainObject.js":
/*!**************************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/toPlainObject.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/_lodash@4.17.20@lodash/_copyObject.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/_lodash@4.17.20@lodash/keysIn.js");
/**
* 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));
}
module.exports = toPlainObject;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/toString.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/toString.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(/*! ./_baseToString */ "./node_modules/_lodash@4.17.20@lodash/_baseToString.js");
/**
* 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);
}
module.exports = toString;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/transform.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/transform.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/_lodash@4.17.20@lodash/_arrayEach.js"),
baseCreate = __webpack_require__(/*! ./_baseCreate */ "./node_modules/_lodash@4.17.20@lodash/_baseCreate.js"),
baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/_lodash@4.17.20@lodash/_baseForOwn.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/_lodash@4.17.20@lodash/_baseIteratee.js"),
getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/_lodash@4.17.20@lodash/_getPrototype.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/_lodash@4.17.20@lodash/isArray.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/_lodash@4.17.20@lodash/isBuffer.js"),
isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/_lodash@4.17.20@lodash/isFunction.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/_lodash@4.17.20@lodash/isObject.js"),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/_lodash@4.17.20@lodash/isTypedArray.js");
/**
* 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 = baseIteratee(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;
}
module.exports = transform;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/union.js":
/*!******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/union.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/_lodash@4.17.20@lodash/_baseFlatten.js"),
baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/_lodash@4.17.20@lodash/_baseRest.js"),
baseUniq = __webpack_require__(/*! ./_baseUniq */ "./node_modules/_lodash@4.17.20@lodash/_baseUniq.js"),
isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/_lodash@4.17.20@lodash/isArrayLikeObject.js");
/**
* 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));
});
module.exports = union;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/uniqueId.js":
/*!*********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/uniqueId.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toString = __webpack_require__(/*! ./toString */ "./node_modules/_lodash@4.17.20@lodash/toString.js");
/** Used to generate unique IDs. */
var idCounter = 0;
/**
* 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;
}
module.exports = uniqueId;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/values.js":
/*!*******************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/values.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseValues = __webpack_require__(/*! ./_baseValues */ "./node_modules/_lodash@4.17.20@lodash/_baseValues.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/_lodash@4.17.20@lodash/keys.js");
/**
* 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));
}
module.exports = values;
/***/ }),
/***/ "./node_modules/_lodash@4.17.20@lodash/zipObject.js":
/*!**********************************************************!*\
!*** ./node_modules/_lodash@4.17.20@lodash/zipObject.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/_lodash@4.17.20@lodash/_assignValue.js"),
baseZipObject = __webpack_require__(/*! ./_baseZipObject */ "./node_modules/_lodash@4.17.20@lodash/_baseZipObject.js");
/**
* 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);
}
module.exports = zipObject;
/***/ }),
/***/ "./node_modules/_parse-svg-path@0.1.2@parse-svg-path/index.js":
/*!********************************************************************!*\
!*** ./node_modules/_parse-svg-path@0.1.2@parse-svg-path/index.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = parse
/**
* expected argument lengths
* @type {Object}
*/
var length = {a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0}
/**
* segment pattern
* @type {RegExp}
*/
var segment = /([astvzqmhlc])([^astvzqmhlc]*)/ig
/**
* parse an svg path data string. Generates an Array
* of commands where each command is an Array of the
* form `[command, arg1, arg2, ...]`
*
* @param {String} path
* @return {Array}
*/
function parse(path) {
var data = []
path.replace(segment, function(_, command, args){
var type = command.toLowerCase()
args = parseValues(args)
// overloaded moveTo
if (type == 'm' && args.length > 2) {
data.push([command].concat(args.splice(0, 2)))
type = 'l'
command = command == 'm' ? 'l' : 'L'
}
while (true) {
if (args.length == length[type]) {
args.unshift(command)
return data.push(args)
}
if (args.length < length[type]) throw new Error('malformed path data')
data.push([command].concat(args.splice(0, length[type])))
}
})
return data
}
var number = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig
function parseValues(args) {
var numbers = args.match(number)
return numbers ? numbers.map(Number) : []
}
/***/ }),
/***/ "./node_modules/_point-at-length@1.1.0@point-at-length/index.js":
/*!**********************************************************************!*\
!*** ./node_modules/_point-at-length@1.1.0@point-at-length/index.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var parse = __webpack_require__(/*! parse-svg-path */ "./node_modules/_parse-svg-path@0.1.2@parse-svg-path/index.js");
var isarray = __webpack_require__(/*! isarray */ "./node_modules/_isarray@0.0.1@isarray/index.js");
var abs = __webpack_require__(/*! abs-svg-path */ "./node_modules/_abs-svg-path@0.1.1@abs-svg-path/index.js");
module.exports = Points;
function Points (path) {
if (!(this instanceof Points)) return new Points(path);
this._path = isarray(path) ? path : parse(path);
this._path = abs(this._path);
this._path = zvhToL(this._path);
this._path = longhand(this._path);
}
Points.prototype.at = function (pos, opts) {
return this._walk(pos, opts).pos;
};
Points.prototype.length = function () {
return this._walk(null).length;
};
Points.prototype._walk = function (pos, opts) {
var cur = [ 0, 0 ];
var prev = [ 0, 0, 0 ];
var p0 = [ 0, 0 ];
var len = 0;
for (var i = 0; i < this._path.length; i++) {
var p = this._path[i];
if (p[0] === 'M') {
cur[0] = p[1];
cur[1] = p[2];
if (pos === 0) {
return { length: len, pos: cur };
}
}
else if (p[0] === 'C') {
prev[0] = p0[0] = cur[0];
prev[1] = p0[1] = cur[1];
prev[2] = len;
var n = 100;
for (var j = 0; j <= n; j++) {
var t = j / n;
var x = xof_C(p, t);
var y = yof_C(p, t);
len += dist(cur[0], cur[1], x, y);
cur[0] = x;
cur[1] = y;
if (typeof pos === 'number' && len >= pos) {
var dv = (len - pos) / (len - prev[2]);
var npos = [
cur[0] * (1 - dv) + prev[0] * dv,
cur[1] * (1 - dv) + prev[1] * dv
];
return { length: len, pos: npos };
}
prev[0] = cur[0];
prev[1] = cur[1];
prev[2] = len;
}
}
else if (p[0] === 'Q') {
prev[0] = p0[0] = cur[0];
prev[1] = p0[1] = cur[1];
prev[2] = len;
var n = 100;
for (var j = 0; j <= n; j++) {
var t = j / n;
var x = xof_Q(p, t);
var y = yof_Q(p, t);
len += dist(cur[0], cur[1], x, y);
cur[0] = x;
cur[1] = y;
if (typeof pos === 'number' && len >= pos) {
var dv = (len - pos) / (len - prev[2]);
var npos = [
cur[0] * (1 - dv) + prev[0] * dv,
cur[1] * (1 - dv) + prev[1] * dv
];
return { length: len, pos: npos };
}
prev[0] = cur[0];
prev[1] = cur[1];
prev[2] = len;
}
}
else if (p[0] === 'L') {
prev[0] = cur[0];
prev[1] = cur[1];
prev[2] = len;
len += dist(cur[0], cur[1], p[1], p[2]);
cur[0] = p[1];
cur[1] = p[2];
if (typeof pos === 'number' && len >= pos) {
var dv = (len - pos) / (len - prev[2]);
var npos = [
cur[0] * (1 - dv) + prev[0] * dv,
cur[1] * (1 - dv) + prev[1] * dv
];
return { length: len, pos: npos };
}
prev[0] = cur[0];
prev[1] = cur[1];
prev[2] = len;
}
}
return { length: len, pos: cur };
function xof_C (p, t) {
return Math.pow((1-t), 3) * p0[0]
+ 3 * Math.pow((1-t), 2) * t * p[1]
+ 3 * (1-t) * Math.pow(t, 2) * p[3]
+ Math.pow(t, 3) * p[5]
;
}
function yof_C (p, t) {
return Math.pow((1-t), 3) * p0[1]
+ 3 * Math.pow((1-t), 2) * t * p[2]
+ 3 * (1-t) * Math.pow(t, 2) * p[4]
+ Math.pow(t, 3) * p[6]
;
}
function xof_Q (p, t) {
return Math.pow((1-t), 2) * p0[0]
+ 2 * (1-t) * t * p[1]
+ Math.pow(t, 2) * p[3]
;
}
function yof_Q (p, t) {
return Math.pow((1-t), 2) * p0[1]
+ 2 * (1-t) * t * p[2]
+ Math.pow(t, 2) * p[4]
;
}
};
function dist (ax, ay, bx, by) {
var x = ax - bx;
var y = ay - by;
return Math.sqrt(x*x + y*y);
}
// Expand shorthand curve commands to full versions; mutates the path in place for efficiency
// Requires commands have already been converted to absolute versions
function longhand(path){
var prev,x1=0,y1=0;
var conversion = { S:{to:'C',x:3}, T:{to:'Q',x:1} };
for(var i=0, len=path.length; i<len; i++){
var cmd = path[i];
var convert = conversion[cmd[0]];
if (convert) {
cmd[0] = convert.to;
if (prev) {
if (prev[0] === convert.to) {
x1 = 2*prev[convert.x+2]-prev[convert.x ];
y1 = 2*prev[convert.x+3]-prev[convert.x+1];
} else {
x1 = prev[prev.length-2];
y1 = prev[prev.length-1];
}
}
cmd.splice(1,0,x1,y1);
}
prev=cmd;
}
return path;
}
// Convert 'Z', 'V' and 'H' segments to 'L' segments
function zvhToL(path){
var ret = [];
var startPoint = ['L',0,0];
var last_point;
for(var i=0, len=path.length; i<len; i++){
var pt = path[i];
switch(pt[0]){
case 'M':
startPoint = ['L', pt[1], pt[2]];
ret.push(pt);
break;
case 'Z':
ret.push(startPoint);
break;
case 'H':
last_point = ret[ret.length - 1] || ['L',0,0];
ret.push( ['L', pt[1], last_point[last_point.length - 1]] );
break;
case 'V':
last_point = ret[ret.length - 1] || ['L',0,0];
ret.push( ['L', last_point[last_point.length - 2], pt[1]] );
break;
default:
ret.push(pt);
}
}
return ret;
}
/***/ }),
/***/ "./node_modules/_regression@2.0.1@regression/dist/regression.js":
/*!**********************************************************************!*\
!*** ./node_modules/_regression@2.0.1@regression/dist/regression.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else { var mod; }
})(this, function (module) {
'use strict';
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
}
}
var DEFAULT_OPTIONS = { order: 2, precision: 2, period: null };
/**
* Determine the coefficient of determination (r^2) of a fit from the observations
* and predictions.
*
* @param {Array<Array<number>>} data - Pairs of observed x-y values
* @param {Array<Array<number>>} results - Pairs of observed predicted x-y values
*
* @return {number} - The r^2 value, or NaN if one cannot be calculated.
*/
function determinationCoefficient(data, results) {
var predictions = [];
var observations = [];
data.forEach(function (d, i) {
if (d[1] !== null) {
observations.push(d);
predictions.push(results[i]);
}
});
var sum = observations.reduce(function (a, observation) {
return a + observation[1];
}, 0);
var mean = sum / observations.length;
var ssyy = observations.reduce(function (a, observation) {
var difference = observation[1] - mean;
return a + difference * difference;
}, 0);
var sse = observations.reduce(function (accum, observation, index) {
var prediction = predictions[index];
var residual = observation[1] - prediction[1];
return accum + residual * residual;
}, 0);
return 1 - sse / ssyy;
}
/**
* Determine the solution of a system of linear equations A * x = b using
* Gaussian elimination.
*
* @param {Array<Array<number>>} input - A 2-d matrix of data in row-major form [ A | b ]
* @param {number} order - How many degrees to solve for
*
* @return {Array<number>} - Vector of normalized solution coefficients matrix (x)
*/
function gaussianElimination(input, order) {
var matrix = input;
var n = input.length - 1;
var coefficients = [order];
for (var i = 0; i < n; i++) {
var maxrow = i;
for (var j = i + 1; j < n; j++) {
if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][maxrow])) {
maxrow = j;
}
}
for (var k = i; k < n + 1; k++) {
var tmp = matrix[k][i];
matrix[k][i] = matrix[k][maxrow];
matrix[k][maxrow] = tmp;
}
for (var _j = i + 1; _j < n; _j++) {
for (var _k = n; _k >= i; _k--) {
matrix[_k][_j] -= matrix[_k][i] * matrix[i][_j] / matrix[i][i];
}
}
}
for (var _j2 = n - 1; _j2 >= 0; _j2--) {
var total = 0;
for (var _k2 = _j2 + 1; _k2 < n; _k2++) {
total += matrix[_k2][_j2] * coefficients[_k2];
}
coefficients[_j2] = (matrix[n][_j2] - total) / matrix[_j2][_j2];
}
return coefficients;
}
/**
* Round a number to a precision, specificed in number of decimal places
*
* @param {number} number - The number to round
* @param {number} precision - The number of decimal places to round to:
* > 0 means decimals, < 0 means powers of 10
*
*
* @return {numbr} - The number, rounded
*/
function round(number, precision) {
var factor = Math.pow(10, precision);
return Math.round(number * factor) / factor;
}
/**
* The set of all fitting methods
*
* @namespace
*/
var methods = {
linear: function linear(data, options) {
var sum = [0, 0, 0, 0, 0];
var len = 0;
for (var n = 0; n < data.length; n++) {
if (data[n][1] !== null) {
len++;
sum[0] += data[n][0];
sum[1] += data[n][1];
sum[2] += data[n][0] * data[n][0];
sum[3] += data[n][0] * data[n][1];
sum[4] += data[n][1] * data[n][1];
}
}
var run = len * sum[2] - sum[0] * sum[0];
var rise = len * sum[3] - sum[0] * sum[1];
var gradient = run === 0 ? 0 : round(rise / run, options.precision);
var intercept = round(sum[1] / len - gradient * sum[0] / len, options.precision);
var predict = function predict(x) {
return [round(x, options.precision), round(gradient * x + intercept, options.precision)];
};
var points = data.map(function (point) {
return predict(point[0]);
});
return {
points: points,
predict: predict,
equation: [gradient, intercept],
r2: round(determinationCoefficient(data, points), options.precision),
string: intercept === 0 ? 'y = ' + gradient + 'x' : 'y = ' + gradient + 'x + ' + intercept
};
},
exponential: function exponential(data, options) {
var sum = [0, 0, 0, 0, 0, 0];
for (var n = 0; n < data.length; n++) {
if (data[n][1] !== null) {
sum[0] += data[n][0];
sum[1] += data[n][1];
sum[2] += data[n][0] * data[n][0] * data[n][1];
sum[3] += data[n][1] * Math.log(data[n][1]);
sum[4] += data[n][0] * data[n][1] * Math.log(data[n][1]);
sum[5] += data[n][0] * data[n][1];
}
}
var denominator = sum[1] * sum[2] - sum[5] * sum[5];
var a = Math.exp((sum[2] * sum[3] - sum[5] * sum[4]) / denominator);
var b = (sum[1] * sum[4] - sum[5] * sum[3]) / denominator;
var coeffA = round(a, options.precision);
var coeffB = round(b, options.precision);
var predict = function predict(x) {
return [round(x, options.precision), round(coeffA * Math.exp(coeffB * x), options.precision)];
};
var points = data.map(function (point) {
return predict(point[0]);
});
return {
points: points,
predict: predict,
equation: [coeffA, coeffB],
string: 'y = ' + coeffA + 'e^(' + coeffB + 'x)',
r2: round(determinationCoefficient(data, points), options.precision)
};
},
logarithmic: function logarithmic(data, options) {
var sum = [0, 0, 0, 0];
var len = data.length;
for (var n = 0; n < len; n++) {
if (data[n][1] !== null) {
sum[0] += Math.log(data[n][0]);
sum[1] += data[n][1] * Math.log(data[n][0]);
sum[2] += data[n][1];
sum[3] += Math.pow(Math.log(data[n][0]), 2);
}
}
var a = (len * sum[1] - sum[2] * sum[0]) / (len * sum[3] - sum[0] * sum[0]);
var coeffB = round(a, options.precision);
var coeffA = round((sum[2] - coeffB * sum[0]) / len, options.precision);
var predict = function predict(x) {
return [round(x, options.precision), round(round(coeffA + coeffB * Math.log(x), options.precision), options.precision)];
};
var points = data.map(function (point) {
return predict(point[0]);
});
return {
points: points,
predict: predict,
equation: [coeffA, coeffB],
string: 'y = ' + coeffA + ' + ' + coeffB + ' ln(x)',
r2: round(determinationCoefficient(data, points), options.precision)
};
},
power: function power(data, options) {
var sum = [0, 0, 0, 0, 0];
var len = data.length;
for (var n = 0; n < len; n++) {
if (data[n][1] !== null) {
sum[0] += Math.log(data[n][0]);
sum[1] += Math.log(data[n][1]) * Math.log(data[n][0]);
sum[2] += Math.log(data[n][1]);
sum[3] += Math.pow(Math.log(data[n][0]), 2);
}
}
var b = (len * sum[1] - sum[0] * sum[2]) / (len * sum[3] - Math.pow(sum[0], 2));
var a = (sum[2] - b * sum[0]) / len;
var coeffA = round(Math.exp(a), options.precision);
var coeffB = round(b, options.precision);
var predict = function predict(x) {
return [round(x, options.precision), round(round(coeffA * Math.pow(x, coeffB), options.precision), options.precision)];
};
var points = data.map(function (point) {
return predict(point[0]);
});
return {
points: points,
predict: predict,
equation: [coeffA, coeffB],
string: 'y = ' + coeffA + 'x^' + coeffB,
r2: round(determinationCoefficient(data, points), options.precision)
};
},
polynomial: function polynomial(data, options) {
var lhs = [];
var rhs = [];
var a = 0;
var b = 0;
var len = data.length;
var k = options.order + 1;
for (var i = 0; i < k; i++) {
for (var l = 0; l < len; l++) {
if (data[l][1] !== null) {
a += Math.pow(data[l][0], i) * data[l][1];
}
}
lhs.push(a);
a = 0;
var c = [];
for (var j = 0; j < k; j++) {
for (var _l = 0; _l < len; _l++) {
if (data[_l][1] !== null) {
b += Math.pow(data[_l][0], i + j);
}
}
c.push(b);
b = 0;
}
rhs.push(c);
}
rhs.push(lhs);
var coefficients = gaussianElimination(rhs, k).map(function (v) {
return round(v, options.precision);
});
var predict = function predict(x) {
return [round(x, options.precision), round(coefficients.reduce(function (sum, coeff, power) {
return sum + coeff * Math.pow(x, power);
}, 0), options.precision)];
};
var points = data.map(function (point) {
return predict(point[0]);
});
var string = 'y = ';
for (var _i = coefficients.length - 1; _i >= 0; _i--) {
if (_i > 1) {
string += coefficients[_i] + 'x^' + _i + ' + ';
} else if (_i === 1) {
string += coefficients[_i] + 'x + ';
} else {
string += coefficients[_i];
}
}
return {
string: string,
points: points,
predict: predict,
equation: [].concat(_toConsumableArray(coefficients)).reverse(),
r2: round(determinationCoefficient(data, points), options.precision)
};
}
};
function createWrapper() {
var reduce = function reduce(accumulator, name) {
return _extends({
_round: round
}, accumulator, _defineProperty({}, name, function (data, supplied) {
return methods[name](data, _extends({}, DEFAULT_OPTIONS, supplied));
}));
};
return Object.keys(methods).reduce(reduce, {});
}
module.exports = createWrapper();
});
/***/ }),
/***/ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js":
/*!***********************************************************************************************!*\
!*** ./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js ***!
\***********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
!function(t,r){ true?r(exports):undefined}(this,function(t){"use strict";function r(t){if(0===t.length)return 0;for(var r,n=t[0],e=0,a=1;a<t.length;a++)r=n+t[a],Math.abs(n)>=Math.abs(t[a])?e+=n-r+t[a]:e+=t[a]-r+n,n=r;return n+e}function g(t){if(0===t.length)throw new Error("mean requires at least one data point");return r(t)/t.length}function n(t,r){var n,e,a=g(t),o=0;if(2===r)for(e=0;e<t.length;e++)o+=(n=t[e]-a)*n;else for(e=0;e<t.length;e++)o+=Math.pow(t[e]-a,r);return o}function e(t){if(0===t.length)throw new Error("variance requires at least one data point");return n(t,2)/t.length}function a(t){if(1===t.length)return 0;var r=e(t);return Math.sqrt(r)}function o(t){if(0===t.length)throw new Error("mode requires at least one data point");if(1===t.length)return t[0];for(var r=t[0],n=NaN,e=0,a=1,o=1;o<t.length+1;o++)t[o]!==r?(e<a&&(e=a,n=r),a=1,r=t[o]):a++;return n}function f(t){return t.slice().sort(function(t,r){return t-r})}function u(t){if(0===t.length)throw new Error("min requires at least one data point");for(var r=t[0],n=1;n<t.length;n++)t[n]<r&&(r=t[n]);return r}function h(t){if(0===t.length)throw new Error("max requires at least one data point");for(var r=t[0],n=1;n<t.length;n++)t[n]>r&&(r=t[n]);return r}function i(t,r){var n=t.length*r;if(0===t.length)throw new Error("quantile requires at least one data point.");if(r<0||1<r)throw new Error("quantiles must be between 0 and 1");return 1===r?t[t.length-1]:0===r?t[0]:n%1!=0?t[Math.ceil(n)-1]:t.length%2==0?(t[n-1]+t[n])/2:t[n]}function c(t,r,n,e){for(n=n||0,e=e||t.length-1;n<e;){if(600<e-n){var a=e-n+1,o=r-n+1,i=Math.log(a),u=.5*Math.exp(2*i/3),h=.5*Math.sqrt(i*u*(a-u)/a);o-a/2<0&&(h*=-1),c(t,r,Math.max(n,Math.floor(r-o*u/a+h)),Math.min(e,Math.floor(r+(a-o)*u/a+h)))}var f=t[r],s=n,l=e;for(p(t,n,r),t[e]>f&&p(t,n,e);s<l;){for(p(t,s,l),s++,l--;t[s]<f;)s++;for(;t[l]>f;)l--}t[n]===f?p(t,n,l):p(t,++l,e),l<=r&&(n=l+1),r<=l&&(e=l-1)}}function p(t,r,n){var e=t[r];t[r]=t[n],t[n]=e}function s(t,r){var n=t.slice();if(Array.isArray(r)){!function(t,r){for(var n=[0],e=0;e<r.length;e++)n.push(w(t.length,r[e]));n.push(t.length-1),n.sort(v);var a=[0,n.length-1];for(;a.length;){var o=Math.ceil(a.pop()),i=Math.floor(a.pop());if(!(o-i<=1)){var u=Math.floor((i+o)/2);l(t,n[u],n[i],n[o]),a.push(i,u,u,o)}}}(n,r);for(var e=[],a=0;a<r.length;a++)e[a]=i(n,r[a]);return e}return l(n,w(n.length,r),0,n.length-1),i(n,r)}function l(t,r,n,e){r%1==0?c(t,r,n,e):(c(t,r=Math.floor(r),n,e),c(t,r+1,r+1,e))}function v(t,r){return t-r}function w(t,r){var n=t*r;return 1===r?t-1:0===r?0:n%1!=0?Math.ceil(n)-1:t%2==0?n-.5:n}function M(t,r){if(r<t[0])return 0;if(r>t[t.length-1])return 1;var n=function(t,r){var n=0,e=0,a=t.length;for(;e<a;)r<=t[n=e+a>>>1]?a=n:e=-~n;return e}(t,r);if(t[n]!==r)return n/t.length;n++;var e=function(t,r){var n=0,e=0,a=t.length;for(;e<a;)r>=t[n=e+a>>>1]?e=-~n:a=n;return e}(t,r);if(e===n)return n/t.length;var a=e-n+1;return a*(e+n)/2/a/t.length}function m(t){var r=s(t,.75),n=s(t,.25);if("number"==typeof r&&"number"==typeof n)return r-n}function d(t){return+s(t,.5)}function b(t){for(var r=d(t),n=[],e=0;e<t.length;e++)n.push(Math.abs(t[e]-r));return d(n)}function q(t,r){r=r||Math.random;for(var n,e,a=t.length;0<a;)e=Math.floor(r()*a--),n=t[a],t[a]=t[e],t[e]=n;return t}function E(t,r){return q(t.slice().slice(),r)}function y(t){for(var r,n=0,e=0;e<t.length;e++)0!==e&&t[e]===r||(r=t[e],n++);return n}function S(t,r){for(var n=[],e=0;e<t;e++){for(var a=[],o=0;o<r;o++)a.push(0);n.push(a)}return n}function x(t,r,n,e){var a;if(0<t){var o=(n[r]-n[t-1])/(r-t+1);a=e[r]-e[t-1]-(r-t+1)*o*o}else a=e[r]-n[r]*n[r]/(r+1);return a<0?0:a}function P(t,r,n,e,a,o,i){if(!(r<t)){var u=Math.floor((t+r)/2);e[n][u]=e[n-1][u-1],a[n][u]=u;var h=n;n<t&&(h=Math.max(h,a[n][t-1]||0)),h=Math.max(h,a[n-1][u]||0);var f,s,l,c=u-1;r<e.length-1&&(c=Math.min(c,a[n][r+1]||0));for(var g=c;h<=g&&!((f=x(g,u,o,i))+e[n-1][h-1]>=e[n][u]);--g)(s=x(h,u,o,i)+e[n-1][h-1])<e[n][u]&&(e[n][u]=s,a[n][u]=h),h++,(l=f+e[n-1][g-1])<e[n][u]&&(e[n][u]=l,a[n][u]=g);P(t,u-1,n,e,a,o,i),P(u+1,r,n,e,a,o,i)}}function k(t,r){if(t.length!==r.length)throw new Error("sampleCovariance requires samples with equal lengths");if(t.length<2)throw new Error("sampleCovariance requires at least two data points in each sample");for(var n=g(t),e=g(r),a=0,o=0;o<t.length;o++)a+=(t[o]-n)*(r[o]-e);return a/(t.length-1)}function I(t){if(t.length<2)throw new Error("sampleVariance requires at least two data points");return n(t,2)/(t.length-1)}function D(t){var r=I(t);return Math.sqrt(r)}function C(t,r,n,e){return(t*r+n*e)/(r+e)}function T(t){if(0===t.length)throw new Error("rootMeanSquare requires at least one data point");for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n],2);return Math.sqrt(r/t.length)}function _(){this.totalCount=0,this.data={}}function F(){this.weights=[],this.bias=0}_.prototype.train=function(t,r){for(var n in this.data[r]||(this.data[r]={}),t){var e=t[n];void 0===this.data[r][n]&&(this.data[r][n]={}),void 0===this.data[r][n][e]&&(this.data[r][n][e]=0),this.data[r][n][e]++}this.totalCount++},_.prototype.score=function(t){var r,n={};for(var e in t){var a=t[e];for(r in this.data)n[r]={},this.data[r][e]?n[r][e+"_"+a]=(this.data[r][e][a]||0)/this.totalCount:n[r][e+"_"+a]=0}var o={};for(r in n)for(var i in o[r]=0,n[r])o[r]+=n[r][i];return o},F.prototype.predict=function(t){if(t.length!==this.weights.length)return null;for(var r=0,n=0;n<this.weights.length;n++)r+=this.weights[n]*t[n];return 0<(r+=this.bias)?1:0},F.prototype.train=function(t,r){if(0!==r&&1!==r)return null;t.length!==this.weights.length&&(this.weights=t,this.bias=1);var n=this.predict(t);if(n!==r){for(var e=r-n,a=0;a<this.weights.length;a++)this.weights[a]+=e*t[a];this.bias+=e}return this};var N=1e-4;function R(t){if(t<0)throw new Error("factorial requires a non-negative value");if(Math.floor(t)!==t)throw new Error("factorial requires an integer input");for(var r=1,n=2;n<=t;n++)r*=n;return r}var A=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],z=Math.log(Math.sqrt(2*Math.PI));var V={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}};var j=Math.sqrt(2*Math.PI),B={gaussian:function(t){return Math.exp(-.5*t*t)/j}},K={nrd:function(t){var r=D(t),n=m(t);return"number"==typeof n&&(r=Math.min(r,n/1.34)),1.06*r*Math.pow(t.length,-.2)}};function O(e,t,r){var a,o;if(void 0===t)a=B.gaussian;else if("string"==typeof t){if(!B[t])throw new Error('Unknown kernel "'+t+'"');a=B[t]}else a=t;if(void 0===r)o=K.nrd(e);else if("string"==typeof r){if(!K[r])throw new Error('Unknown bandwidth method "'+r+'"');o=K[r](e)}else o=r;return function(t){var r=0,n=0;for(r=0;r<e.length;r++)n+=a((t-e[r])/o);return n/o/e.length}}var U=Math.sqrt(2*Math.PI);function G(t){for(var r=t,n=t,e=1;e<15;e++)r+=n*=t*t/(2*e+1);return Math.round(1e4*(.5+r/U*Math.exp(-t*t/2)))/1e4}for(var H=[],L=0;L<=3.09;L+=.01)H.push(G(L));function W(t){var r=1/(1+.5*Math.abs(t)),n=r*Math.exp(-Math.pow(t,2)-1.26551223+1.00002368*r+.37409196*Math.pow(r,2)+.09678418*Math.pow(r,3)-.18628806*Math.pow(r,4)+.27886807*Math.pow(r,5)-1.13520398*Math.pow(r,6)+1.48851587*Math.pow(r,7)-.82215223*Math.pow(r,8)+.17087277*Math.pow(r,9));return 0<=t?1-n:n-1}function J(t){var r=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),n=Math.sqrt(Math.sqrt(Math.pow(2/(Math.PI*r)+Math.log(1-t*t)/2,2)-Math.log(1-t*t)/r)-(2/(Math.PI*r)+Math.log(1-t*t)/2));return 0<=t?n:-n}function Q(t){if("number"==typeof t)return t<0?-1:0===t?0:1;throw new TypeError("not a number")}t.linearRegression=function(t){var r,n,e=t.length;if(1===e)n=t[r=0][1];else{for(var a,o,i,u=0,h=0,f=0,s=0,l=0;l<e;l++)u+=o=(a=t[l])[0],h+=i=a[1],f+=o*o,s+=o*i;n=h/e-(r=(e*s-u*h)/(e*f-u*u))*u/e}return{m:r,b:n}},t.linearRegressionLine=function(r){return function(t){return r.b+r.m*t}},t.standardDeviation=a,t.rSquared=function(t,r){if(t.length<2)return 1;for(var n,e=0,a=0;a<t.length;a++)e+=t[a][1];n=e/t.length;for(var o=0,i=0;i<t.length;i++)o+=Math.pow(n-t[i][1],2);for(var u=0,h=0;h<t.length;h++)u+=Math.pow(t[h][1]-r(t[h][0]),2);return 1-u/o},t.mode=function(t){return o(f(t))},t.modeFast=function(t){for(var r,n=new Map,e=0,a=0;a<t.length;a++){var o=n.get(t[a]);void 0===o?o=1:o++,e<o&&(r=t[a],e=o),n.set(t[a],o)}if(0===e)throw new Error("mode requires at last one data point");return r},t.modeSorted=o,t.min=u,t.max=h,t.extent=function(t){if(0===t.length)throw new Error("extent requires at least one data point");for(var r=t[0],n=t[0],e=1;e<t.length;e++)t[e]>n&&(n=t[e]),t[e]<r&&(r=t[e]);return[r,n]},t.minSorted=function(t){return t[0]},t.maxSorted=function(t){return t[t.length-1]},t.extentSorted=function(t){return[t[0],t[t.length-1]]},t.sum=r,t.sumSimple=function(t){for(var r=0,n=0;n<t.length;n++)r+=t[n];return r},t.product=function(t){for(var r=1,n=0;n<t.length;n++)r*=t[n];return r},t.quantile=s,t.quantileSorted=i,t.quantileRank=function(t,r){return M(f(t),r)},t.quantileRankSorted=M,t.interquartileRange=m,t.iqr=m,t.medianAbsoluteDeviation=b,t.mad=b,t.chunk=function(t,r){var n=[];if(r<1)throw new Error("chunk size must be a positive number");if(Math.floor(r)!==r)throw new Error("chunk size must be an integer");for(var e=0;e<t.length;e+=r)n.push(t.slice(e,e+r));return n},t.sampleWithReplacement=function(t,r,n){if(0===t.length)return[];n=n||Math.random;for(var e=t.length,a=[],o=0;o<r;o++){var i=Math.floor(n()*e);a.push(t[i])}return a},t.shuffle=E,t.shuffleInPlace=q,t.sample=function(t,r,n){return E(t,n).slice(0,r)},t.ckmeans=function(t,r){if(r>t.length)throw new Error("cannot generate more classes than there are data values");var n=f(t);if(1===y(n))return[n];var e=S(r,n.length),a=S(r,n.length);!function(t,r,n){for(var e,a=r[0].length,o=t[Math.floor(a/2)],i=[],u=[],h=0;h<a;++h)e=t[h]-o,0===h?(i.push(e),u.push(e*e)):(i.push(i[h-1]+e),u.push(u[h-1]+e*e)),r[0][h]=x(0,h,i,u),n[0][h]=0;for(var f=1;f<r.length;++f)P(f<r.length-1?f:a-1,a-1,f,r,n,i,u)}(n,e,a);for(var o=[],i=a[0].length-1,u=a.length-1;0<=u;u--){var h=a[u][i];o[u]=n.slice(h,i+1),0<u&&(i=h-1)}return o},t.uniqueCountSorted=y,t.sumNthPowerDeviations=n,t.equalIntervalBreaks=function(t,r){if(t.length<2)return t;for(var n=u(t),e=h(t),a=[n],o=(e-n)/r,i=1;i<r;i++)a.push(a[0]+o*i);return a.push(e),a},t.sampleCovariance=k,t.sampleCorrelation=function(t,r){return k(t,r)/D(t)/D(r)},t.sampleVariance=I,t.sampleStandardDeviation=D,t.sampleSkewness=function(t){if(t.length<3)throw new Error("sampleSkewness requires at least three data points");for(var r,n=g(t),e=0,a=0,o=0;o<t.length;o++)e+=(r=t[o]-n)*r,a+=r*r*r;var i=t.length-1,u=Math.sqrt(e/i),h=t.length;return h*a/((h-1)*(h-2)*Math.pow(u,3))},t.sampleKurtosis=function(t){var r=t.length;if(r<4)throw new Error("sampleKurtosis requires at least four data points");for(var n,e=g(t),a=0,o=0,i=0;i<r;i++)a+=(n=t[i]-e)*n,o+=n*n*n*n;return(r-1)/((r-2)*(r-3))*(r*(r+1)*o/(a*a)-3*(r-1))},t.permutationsHeap=function(t){for(var r=new Array(t.length),n=[t.slice()],e=0;e<t.length;e++)r[e]=0;for(e=0;e<t.length;)if(r[e]<e){var a=0;e%2!=0&&(a=r[e]);var o=t[a];t[a]=t[e],t[e]=o,n.push(t.slice()),r[e]++,e=0}else r[e]=0,e++;return n},t.combinations=function t(r,n){var e,a,o,i,u=[];for(e=0;e<r.length;e++)if(1===n)u.push([r[e]]);else for(o=t(r.slice(e+1,r.length),n-1),a=0;a<o.length;a++)(i=o[a]).unshift(r[e]),u.push(i);return u},t.combinationsReplacement=function t(r,n){for(var e=[],a=0;a<r.length;a++)if(1===n)e.push([r[a]]);else for(var o=t(r.slice(a,r.length),n-1),i=0;i<o.length;i++)e.push([r[a]].concat(o[i]));return e},t.addToMean=function(t,r,n){return t+(n-t)/(r+1)},t.combineMeans=C,t.combineVariances=function(t,r,n,e,a,o){var i=C(r,n,a,o);return(n*(t+Math.pow(r-i,2))+o*(e+Math.pow(a-i,2)))/(n+o)},t.geometricMean=function(t){if(0===t.length)throw new Error("geometricMean requires at least one data point");for(var r=1,n=0;n<t.length;n++){if(t[n]<=0)throw new Error("geometricMean requires only positive numbers as input");r*=t[n]}return Math.pow(r,1/t.length)},t.harmonicMean=function(t){if(0===t.length)throw new Error("harmonicMean requires at least one data point");for(var r=0,n=0;n<t.length;n++){if(t[n]<=0)throw new Error("harmonicMean requires only positive numbers as input");r+=1/t[n]}return t.length/r},t.average=g,t.mean=g,t.median=d,t.medianSorted=function(t){return i(t,.5)},t.subtractFromMean=function(t,r,n){return(t*r-n)/(r-1)},t.rootMeanSquare=T,t.rms=T,t.variance=e,t.tTest=function(t,r){return(g(t)-r)/(a(t)/Math.sqrt(t.length))},t.tTestTwoSample=function(t,r,n){var e=t.length,a=r.length;if(!e||!a)return null;n||(n=0);var o=g(t),i=g(r),u=I(t),h=I(r);if("number"==typeof o&&"number"==typeof i&&"number"==typeof u&&"number"==typeof h){var f=((e-1)*u+(a-1)*h)/(e+a-2);return(o-i-n)/Math.sqrt(f*(1/e+1/a))}},t.BayesianClassifier=_,t.bayesian=_,t.PerceptronModel=F,t.perceptron=F,t.epsilon=N,t.factorial=R,t.gamma=function t(r){if("number"==typeof(n=r)&&isFinite(n)&&Math.floor(n)===n)return r<=0?NaN:R(r-1);var n;if(--r<0)return Math.PI/(Math.sin(Math.PI*-r)*t(-r));var e=r+.25;return Math.pow(r/Math.E,r)*Math.sqrt(2*Math.PI*(r+1/6))*(1+1/144/Math.pow(e,2)-1/12960/Math.pow(e,3)-257/207360/Math.pow(e,4)-52/2612736/Math.pow(e,5)+5741173/9405849600/Math.pow(e,6)+37529/18811699200/Math.pow(e,7))},t.gammaln=function(t){if(t<=0)return 1/0;t--;for(var r=A[0],n=1;n<15;n++)r+=A[n]/(t+n);var e=5.2421875+t;return z+Math.log(r)-e+(t+.5)*Math.log(e)},t.bernoulliDistribution=function(t){if(t<0||1<t)throw new Error("bernoulliDistribution requires probability to be between 0 and 1 inclusive");return[1-t,t]},t.binomialDistribution=function(t,r){if(!(r<0||1<r||t<=0||t%1!=0)){for(var n=0,e=0,a=[],o=1;a[n]=o*Math.pow(r,n)*Math.pow(1-r,t-n),e+=a[n],o=o*(t-++n+1)/n,e<1-N;);return a}},t.poissonDistribution=function(t){if(!(t<=0)){for(var r=0,n=0,e=[],a=1;e[r]=Math.exp(-t)*Math.pow(t,r)/a,n+=e[r],a*=++r,n<1-N;);return e}},t.chiSquaredDistributionTable=V,t.chiSquaredGoodnessOfFit=function(t,r,n){for(var e,a,o=0,i=r(g(t)),u=[],h=[],f=0;f<t.length;f++)void 0===u[t[f]]&&(u[t[f]]=0),u[t[f]]++;for(f=0;f<u.length;f++)void 0===u[f]&&(u[f]=0);for(a in i)a in u&&(h[+a]=i[a]*t.length);for(a=h.length-1;0<=a;a--)h[a]<3&&(h[a-1]+=h[a],h.pop(),u[a-1]+=u[a],u.pop());for(a=0;a<u.length;a++)o+=Math.pow(u[a]-h[a],2)/h[a];return e=u.length-1-1,V[e][n]<o},t.kernelDensityEstimation=O,t.kde=O,t.zScore=function(t,r,n){return(t-r)/n},t.cumulativeStdNormalProbability=function(t){var r=Math.abs(t),n=Math.min(Math.round(100*r),H.length-1);return 0<=t?H[n]:+(1-H[n]).toFixed(4)},t.standardNormalTable=H,t.errorFunction=W,t.erf=W,t.inverseErrorFunction=J,t.probit=function(t){return 0===t?t=N:1<=t&&(t=1-N),Math.sqrt(2)*J(2*t-1)},t.permutationTest=function(t,r,n,e){if(void 0===e&&(e=1e4),void 0===n&&(n="two_side"),"two_side"!==n&&"greater"!==n&&"less"!==n)throw new Error("`alternative` must be either 'two_side', 'greater', or 'less'");for(var a=g(t)-g(r),o=new Array(e),i=t.concat(r),u=Math.floor(i.length/2),h=0;h<e;h++){q(i);var f=i.slice(0,u),s=i.slice(u,i.length),l=g(f)-g(s);o[h]=l}var c=0;if("two_side"===n)for(h=0;h<=e;h++)Math.abs(o[h])>=Math.abs(a)&&(c+=1);else if("greater"===n)for(h=0;h<=e;h++)o[h]>=a&&(c+=1);else for(h=0;h<=e;h++)o[h]<=a&&(c+=1);return c/e},t.bisect=function(t,r,n,e,a){if("function"!=typeof t)throw new TypeError("func must be a function");for(var o=0;o<e;o++){var i=(r+n)/2;if(0===t(i)||Math.abs((n-r)/2)<a)return i;Q(t(i))===Q(t(r))?r=i:n=i}throw new Error("maximum number of iterations exceeded")},t.quickselect=c,t.sign=Q,t.numericSort=f,Object.defineProperty(t,"__esModule",{value:!0})});
/***/ }),
/***/ "./node_modules/_topojson-client@3.1.0@topojson-client/dist/topojson-client.js":
/*!*************************************************************************************!*\
!*** ./node_modules/_topojson-client@3.1.0@topojson-client/dist/topojson-client.js ***!
\*************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/topojson/topojson-client v3.1.0 Copyright 2019 Mike Bostock
(function (global, factory) {
true ? factory(exports) :
undefined;
}(this, function (exports) { 'use strict';
function identity(x) {
return x;
}
function transform(transform) {
if (transform == null) return identity;
var x0,
y0,
kx = transform.scale[0],
ky = transform.scale[1],
dx = transform.translate[0],
dy = transform.translate[1];
return function(input, i) {
if (!i) x0 = y0 = 0;
var j = 2, n = input.length, output = new Array(n);
output[0] = (x0 += input[0]) * kx + dx;
output[1] = (y0 += input[1]) * ky + dy;
while (j < n) output[j] = input[j], ++j;
return output;
};
}
function bbox(topology) {
var t = transform(topology.transform), key,
x0 = Infinity, y0 = x0, x1 = -x0, y1 = -x0;
function bboxPoint(p) {
p = t(p);
if (p[0] < x0) x0 = p[0];
if (p[0] > x1) x1 = p[0];
if (p[1] < y0) y0 = p[1];
if (p[1] > y1) y1 = p[1];
}
function bboxGeometry(o) {
switch (o.type) {
case "GeometryCollection": o.geometries.forEach(bboxGeometry); break;
case "Point": bboxPoint(o.coordinates); break;
case "MultiPoint": o.coordinates.forEach(bboxPoint); break;
}
}
topology.arcs.forEach(function(arc) {
var i = -1, n = arc.length, p;
while (++i < n) {
p = t(arc[i], i);
if (p[0] < x0) x0 = p[0];
if (p[0] > x1) x1 = p[0];
if (p[1] < y0) y0 = p[1];
if (p[1] > y1) y1 = p[1];
}
});
for (key in topology.objects) {
bboxGeometry(topology.objects[key]);
}
return [x0, y0, x1, y1];
}
function reverse(array, n) {
var t, j = array.length, i = j - n;
while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;
}
function feature(topology, o) {
if (typeof o === "string") o = topology.objects[o];
return o.type === "GeometryCollection"
? {type: "FeatureCollection", features: o.geometries.map(function(o) { return feature$1(topology, o); })}
: feature$1(topology, o);
}
function feature$1(topology, o) {
var id = o.id,
bbox = o.bbox,
properties = o.properties == null ? {} : o.properties,
geometry = object(topology, o);
return id == null && bbox == null ? {type: "Feature", properties: properties, geometry: geometry}
: bbox == null ? {type: "Feature", id: id, properties: properties, geometry: geometry}
: {type: "Feature", id: id, bbox: bbox, properties: properties, geometry: geometry};
}
function object(topology, o) {
var transformPoint = transform(topology.transform),
arcs = topology.arcs;
function arc(i, points) {
if (points.length) points.pop();
for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {
points.push(transformPoint(a[k], k));
}
if (i < 0) reverse(points, n);
}
function point(p) {
return transformPoint(p);
}
function line(arcs) {
var points = [];
for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);
if (points.length < 2) points.push(points[0]); // This should never happen per the specification.
return points;
}
function ring(arcs) {
var points = line(arcs);
while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.
return points;
}
function polygon(arcs) {
return arcs.map(ring);
}
function geometry(o) {
var type = o.type, coordinates;
switch (type) {
case "GeometryCollection": return {type: type, geometries: o.geometries.map(geometry)};
case "Point": coordinates = point(o.coordinates); break;
case "MultiPoint": coordinates = o.coordinates.map(point); break;
case "LineString": coordinates = line(o.arcs); break;
case "MultiLineString": coordinates = o.arcs.map(line); break;
case "Polygon": coordinates = polygon(o.arcs); break;
case "MultiPolygon": coordinates = o.arcs.map(polygon); break;
default: return null;
}
return {type: type, coordinates: coordinates};
}
return geometry(o);
}
function stitch(topology, arcs) {
var stitchedArcs = {},
fragmentByStart = {},
fragmentByEnd = {},
fragments = [],
emptyIndex = -1;
// Stitch empty arcs first, since they may be subsumed by other arcs.
arcs.forEach(function(i, j) {
var arc = topology.arcs[i < 0 ? ~i : i], t;
if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {
t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;
}
});
arcs.forEach(function(i) {
var e = ends(i),
start = e[0],
end = e[1],
f, g;
if (f = fragmentByEnd[start]) {
delete fragmentByEnd[f.end];
f.push(i);
f.end = end;
if (g = fragmentByStart[end]) {
delete fragmentByStart[g.start];
var fg = g === f ? f : f.concat(g);
fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;
} else {
fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
}
} else if (f = fragmentByStart[end]) {
delete fragmentByStart[f.start];
f.unshift(i);
f.start = start;
if (g = fragmentByEnd[start]) {
delete fragmentByEnd[g.end];
var gf = g === f ? f : g.concat(f);
fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;
} else {
fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
}
} else {
f = [i];
fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;
}
});
function ends(i) {
var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;
if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });
else p1 = arc[arc.length - 1];
return i < 0 ? [p1, p0] : [p0, p1];
}
function flush(fragmentByEnd, fragmentByStart) {
for (var k in fragmentByEnd) {
var f = fragmentByEnd[k];
delete fragmentByStart[f.start];
delete f.start;
delete f.end;
f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });
fragments.push(f);
}
}
flush(fragmentByEnd, fragmentByStart);
flush(fragmentByStart, fragmentByEnd);
arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });
return fragments;
}
function mesh(topology) {
return object(topology, meshArcs.apply(this, arguments));
}
function meshArcs(topology, object, filter) {
var arcs, i, n;
if (arguments.length > 1) arcs = extractArcs(topology, object, filter);
else for (i = 0, arcs = new Array(n = topology.arcs.length); i < n; ++i) arcs[i] = i;
return {type: "MultiLineString", arcs: stitch(topology, arcs)};
}
function extractArcs(topology, object, filter) {
var arcs = [],
geomsByArc = [],
geom;
function extract0(i) {
var j = i < 0 ? ~i : i;
(geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});
}
function extract1(arcs) {
arcs.forEach(extract0);
}
function extract2(arcs) {
arcs.forEach(extract1);
}
function extract3(arcs) {
arcs.forEach(extract2);
}
function geometry(o) {
switch (geom = o, o.type) {
case "GeometryCollection": o.geometries.forEach(geometry); break;
case "LineString": extract1(o.arcs); break;
case "MultiLineString": case "Polygon": extract2(o.arcs); break;
case "MultiPolygon": extract3(o.arcs); break;
}
}
geometry(object);
geomsByArc.forEach(filter == null
? function(geoms) { arcs.push(geoms[0].i); }
: function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });
return arcs;
}
function planarRingArea(ring) {
var i = -1, n = ring.length, a, b = ring[n - 1], area = 0;
while (++i < n) a = b, b = ring[i], area += a[0] * b[1] - a[1] * b[0];
return Math.abs(area); // Note: doubled area!
}
function merge(topology) {
return object(topology, mergeArcs.apply(this, arguments));
}
function mergeArcs(topology, objects) {
var polygonsByArc = {},
polygons = [],
groups = [];
objects.forEach(geometry);
function geometry(o) {
switch (o.type) {
case "GeometryCollection": o.geometries.forEach(geometry); break;
case "Polygon": extract(o.arcs); break;
case "MultiPolygon": o.arcs.forEach(extract); break;
}
}
function extract(polygon) {
polygon.forEach(function(ring) {
ring.forEach(function(arc) {
(polygonsByArc[arc = arc < 0 ? ~arc : arc] || (polygonsByArc[arc] = [])).push(polygon);
});
});
polygons.push(polygon);
}
function area(ring) {
return planarRingArea(object(topology, {type: "Polygon", arcs: [ring]}).coordinates[0]);
}
polygons.forEach(function(polygon) {
if (!polygon._) {
var group = [],
neighbors = [polygon];
polygon._ = 1;
groups.push(group);
while (polygon = neighbors.pop()) {
group.push(polygon);
polygon.forEach(function(ring) {
ring.forEach(function(arc) {
polygonsByArc[arc < 0 ? ~arc : arc].forEach(function(polygon) {
if (!polygon._) {
polygon._ = 1;
neighbors.push(polygon);
}
});
});
});
}
}
});
polygons.forEach(function(polygon) {
delete polygon._;
});
return {
type: "MultiPolygon",
arcs: groups.map(function(polygons) {
var arcs = [], n;
// Extract the exterior (unique) arcs.
polygons.forEach(function(polygon) {
polygon.forEach(function(ring) {
ring.forEach(function(arc) {
if (polygonsByArc[arc < 0 ? ~arc : arc].length < 2) {
arcs.push(arc);
}
});
});
});
// Stitch the arcs into one or more rings.
arcs = stitch(topology, arcs);
// If more than one ring is returned,
// at most one of these rings can be the exterior;
// choose the one with the greatest absolute area.
if ((n = arcs.length) > 1) {
for (var i = 1, k = area(arcs[0]), ki, t; i < n; ++i) {
if ((ki = area(arcs[i])) > k) {
t = arcs[0], arcs[0] = arcs[i], arcs[i] = t, k = ki;
}
}
}
return arcs;
}).filter(function(arcs) {
return arcs.length > 0;
})
};
}
function bisect(a, x) {
var lo = 0, hi = a.length;
while (lo < hi) {
var mid = lo + hi >>> 1;
if (a[mid] < x) lo = mid + 1;
else hi = mid;
}
return lo;
}
function neighbors(objects) {
var indexesByArc = {}, // arc index -> array of object indexes
neighbors = objects.map(function() { return []; });
function line(arcs, i) {
arcs.forEach(function(a) {
if (a < 0) a = ~a;
var o = indexesByArc[a];
if (o) o.push(i);
else indexesByArc[a] = [i];
});
}
function polygon(arcs, i) {
arcs.forEach(function(arc) { line(arc, i); });
}
function geometry(o, i) {
if (o.type === "GeometryCollection") o.geometries.forEach(function(o) { geometry(o, i); });
else if (o.type in geometryType) geometryType[o.type](o.arcs, i);
}
var geometryType = {
LineString: line,
MultiLineString: polygon,
Polygon: polygon,
MultiPolygon: function(arcs, i) { arcs.forEach(function(arc) { polygon(arc, i); }); }
};
objects.forEach(geometry);
for (var i in indexesByArc) {
for (var indexes = indexesByArc[i], m = indexes.length, j = 0; j < m; ++j) {
for (var k = j + 1; k < m; ++k) {
var ij = indexes[j], ik = indexes[k], n;
if ((n = neighbors[ij])[i = bisect(n, ik)] !== ik) n.splice(i, 0, ik);
if ((n = neighbors[ik])[i = bisect(n, ij)] !== ij) n.splice(i, 0, ij);
}
}
}
return neighbors;
}
function untransform(transform) {
if (transform == null) return identity;
var x0,
y0,
kx = transform.scale[0],
ky = transform.scale[1],
dx = transform.translate[0],
dy = transform.translate[1];
return function(input, i) {
if (!i) x0 = y0 = 0;
var j = 2,
n = input.length,
output = new Array(n),
x1 = Math.round((input[0] - dx) / kx),
y1 = Math.round((input[1] - dy) / ky);
output[0] = x1 - x0, x0 = x1;
output[1] = y1 - y0, y0 = y1;
while (j < n) output[j] = input[j], ++j;
return output;
};
}
function quantize(topology, transform) {
if (topology.transform) throw new Error("already quantized");
if (!transform || !transform.scale) {
if (!((n = Math.floor(transform)) >= 2)) throw new Error("n must be ≥2");
box = topology.bbox || bbox(topology);
var x0 = box[0], y0 = box[1], x1 = box[2], y1 = box[3], n;
transform = {scale: [x1 - x0 ? (x1 - x0) / (n - 1) : 1, y1 - y0 ? (y1 - y0) / (n - 1) : 1], translate: [x0, y0]};
} else {
box = topology.bbox;
}
var t = untransform(transform), box, key, inputs = topology.objects, outputs = {};
function quantizePoint(point) {
return t(point);
}
function quantizeGeometry(input) {
var output;
switch (input.type) {
case "GeometryCollection": output = {type: "GeometryCollection", geometries: input.geometries.map(quantizeGeometry)}; break;
case "Point": output = {type: "Point", coordinates: quantizePoint(input.coordinates)}; break;
case "MultiPoint": output = {type: "MultiPoint", coordinates: input.coordinates.map(quantizePoint)}; break;
default: return input;
}
if (input.id != null) output.id = input.id;
if (input.bbox != null) output.bbox = input.bbox;
if (input.properties != null) output.properties = input.properties;
return output;
}
function quantizeArc(input) {
var i = 0, j = 1, n = input.length, p, output = new Array(n); // pessimistic
output[0] = t(input[0], 0);
while (++i < n) if ((p = t(input[i], i))[0] || p[1]) output[j++] = p; // non-coincident points
if (j === 1) output[j++] = [0, 0]; // an arc must have at least two points
output.length = j;
return output;
}
for (key in inputs) outputs[key] = quantizeGeometry(inputs[key]);
return {
type: "Topology",
bbox: box,
transform: transform,
objects: outputs,
arcs: topology.arcs.map(quantizeArc)
};
}
exports.bbox = bbox;
exports.feature = feature;
exports.merge = merge;
exports.mergeArcs = mergeArcs;
exports.mesh = mesh;
exports.meshArcs = meshArcs;
exports.neighbors = neighbors;
exports.quantize = quantize;
exports.transform = transform;
exports.untransform = untransform;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/***/ "./node_modules/_tslib@1.13.0@tslib/tslib.js":
/*!***************************************************!*\
!*** ./node_modules/_tslib@1.13.0@tslib/tslib.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global global, define, System, Reflect, Promise */
var __extends;
var __assign;
var __rest;
var __decorate;
var __param;
var __metadata;
var __awaiter;
var __generator;
var __exportStar;
var __values;
var __read;
var __spread;
var __spreadArrays;
var __await;
var __asyncGenerator;
var __asyncDelegator;
var __asyncValues;
var __makeTemplateObject;
var __importStar;
var __importDefault;
var __classPrivateFieldGet;
var __classPrivateFieldSet;
var __createBinding;
(function (factory) {
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (exports) { factory(createExporter(root, createExporter(exports))); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
else {}
function createExporter(exports, previous) {
if (exports !== root) {
if (typeof Object.create === "function") {
Object.defineProperty(exports, "__esModule", { value: true });
}
else {
exports.__esModule = true;
}
}
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
}
})
(function (exporter) {
var 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]; };
__extends = function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
__assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
__rest = function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
__decorate = function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
__param = function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
__metadata = function (metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
};
__awaiter = function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
__generator = function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
__createBinding = function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
};
__exportStar = function (m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
};
__values = function (o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
__read = function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
__spread = function () {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
};
__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;
};
__await = function (v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
};
__asyncGenerator = function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
};
__asyncDelegator = function (o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
};
__asyncValues = function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
};
__makeTemplateObject = function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
__importStar = function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
__importDefault = function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
__classPrivateFieldGet = function (receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
};
__classPrivateFieldSet = function (receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
};
exporter("__extends", __extends);
exporter("__assign", __assign);
exporter("__rest", __rest);
exporter("__decorate", __decorate);
exporter("__param", __param);
exporter("__metadata", __metadata);
exporter("__awaiter", __awaiter);
exporter("__generator", __generator);
exporter("__exportStar", __exportStar);
exporter("__createBinding", __createBinding);
exporter("__values", __values);
exporter("__read", __read);
exporter("__spread", __spread);
exporter("__spreadArrays", __spreadArrays);
exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator);
exporter("__asyncValues", __asyncValues);
exporter("__makeTemplateObject", __makeTemplateObject);
exporter("__importStar", __importStar);
exporter("__importDefault", __importDefault);
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_webpack@4.44.2@webpack/buildin/global.js */ "./node_modules/_webpack@4.44.2@webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/_webpack@4.44.2@webpack/buildin/global.js":
/*!***********************************!*\
!*** (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@4.44.2@webpack/buildin/module.js":
/*!***********************************!*\
!*** (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;
};
/***/ }),
/***/ "./node_modules/_wolfy87-eventemitter@5.2.9@wolfy87-eventemitter/EventEmitter.js":
/*!***************************************************************************************!*\
!*** ./node_modules/_wolfy87-eventemitter@5.2.9@wolfy87-eventemitter/EventEmitter.js ***!
\***************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/*!
* EventEmitter v5.2.9 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - https://oli.me.uk/
* @preserve
*/
;(function (exports) {
'use strict';
/**
* Class for managing events.
* Can be extended to provide event functionality in other classes.
*
* @class EventEmitter Manages event registering and emitting.
*/
function EventEmitter() {}
// Shortcuts to improve speed and size
var proto = EventEmitter.prototype;
var originalGlobalValue = exports.EventEmitter;
/**
* Finds the index of the listener for the event in its storage array.
*
* @param {Function[]} listeners Array of listeners to search through.
* @param {Function} listener Method to look for.
* @return {Number} Index of the specified listener, -1 if not found
* @api private
*/
function indexOfListener(listeners, listener) {
var i = listeners.length;
while (i--) {
if (listeners[i].listener === listener) {
return i;
}
}
return -1;
}
/**
* Alias a method while keeping the context correct, to allow for overwriting of target method.
*
* @param {String} name The name of the target method.
* @return {Function} The aliased method
* @api private
*/
function alias(name) {
return function aliasClosure() {
return this[name].apply(this, arguments);
};
}
/**
* Returns the listener array for the specified event.
* Will initialise the event object and listener arrays if required.
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
* Each property in the object response is an array of listener functions.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Function[]|Object} All listener functions for the event.
*/
proto.getListeners = function getListeners(evt) {
var events = this._getEvents();
var response;
var key;
// Return a concatenated array of all matching events if
// the selector is a regular expression.
if (evt instanceof RegExp) {
response = {};
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
response[key] = events[key];
}
}
}
else {
response = events[evt] || (events[evt] = []);
}
return response;
};
/**
* Takes a list of listener objects and flattens it into a list of listener functions.
*
* @param {Object[]} listeners Raw listener objects.
* @return {Function[]} Just the listener functions.
*/
proto.flattenListeners = function flattenListeners(listeners) {
var flatListeners = [];
var i;
for (i = 0; i < listeners.length; i += 1) {
flatListeners.push(listeners[i].listener);
}
return flatListeners;
};
/**
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Object} All listener functions for an event in an object.
*/
proto.getListenersAsObject = function getListenersAsObject(evt) {
var listeners = this.getListeners(evt);
var response;
if (listeners instanceof Array) {
response = {};
response[evt] = listeners;
}
return response || listeners;
};
function isValidListener (listener) {
if (typeof listener === 'function' || listener instanceof RegExp) {
return true
} else if (listener && typeof listener === 'object') {
return isValidListener(listener.listener)
} else {
return false
}
}
/**
* Adds a listener function to the specified event.
* The listener will not be added if it is a duplicate.
* If the listener returns true then it will be removed after it is called.
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListener = function addListener(evt, listener) {
if (!isValidListener(listener)) {
throw new TypeError('listener must be a function');
}
var listeners = this.getListenersAsObject(evt);
var listenerIsWrapped = typeof listener === 'object';
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
listeners[key].push(listenerIsWrapped ? listener : {
listener: listener,
once: false
});
}
}
return this;
};
/**
* Alias of addListener
*/
proto.on = alias('addListener');
/**
* Semi-alias of addListener. It will add a listener that will be
* automatically removed after its first execution.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addOnceListener = function addOnceListener(evt, listener) {
return this.addListener(evt, {
listener: listener,
once: true
});
};
/**
* Alias of addOnceListener.
*/
proto.once = alias('addOnceListener');
/**
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
* You need to tell it what event names should be matched by a regex.
*
* @param {String} evt Name of the event to create.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvent = function defineEvent(evt) {
this.getListeners(evt);
return this;
};
/**
* Uses defineEvent to define multiple events.
*
* @param {String[]} evts An array of event names to define.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvents = function defineEvents(evts) {
for (var i = 0; i < evts.length; i += 1) {
this.defineEvent(evts[i]);
}
return this;
};
/**
* Removes a listener function from the specified event.
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
*
* @param {String|RegExp} evt Name of the event to remove the listener from.
* @param {Function} listener Method to remove from the event.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListener = function removeListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var index;
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key)) {
index = indexOfListener(listeners[key], listener);
if (index !== -1) {
listeners[key].splice(index, 1);
}
}
}
return this;
};
/**
* Alias of removeListener
*/
proto.off = alias('removeListener');
/**
* Adds listeners in bulk using the manipulateListeners method.
* If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
* You can also pass it a regular expression to add the array of listeners to all events that match it.
* Yeah, this function does quite a bit. That's probably a bad thing.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListeners = function addListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(false, evt, listeners);
};
/**
* Removes listeners in bulk using the manipulateListeners method.
* If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be removed.
* You can also pass it a regular expression to remove the listeners from all events that match it.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListeners = function removeListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(true, evt, listeners);
};
/**
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
* The first argument will determine if the listeners are removed (true) or added (false).
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be added/removed.
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
*
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
var i;
var value;
var single = remove ? this.removeListener : this.addListener;
var multiple = remove ? this.removeListeners : this.addListeners;
// If evt is an object then pass each of its properties to this method
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
for (i in evt) {
if (evt.hasOwnProperty(i) && (value = evt[i])) {
// Pass the single listener straight through to the singular method
if (typeof value === 'function') {
single.call(this, i, value);
}
else {
// Otherwise pass back to the multiple function
multiple.call(this, i, value);
}
}
}
}
else {
// So evt must be a string
// And listeners must be an array of listeners
// Loop over it and pass each one to the multiple method
i = listeners.length;
while (i--) {
single.call(this, evt, listeners[i]);
}
}
return this;
};
/**
* Removes all listeners from a specified event.
* If you do not specify an event then all listeners will be removed.
* That means every event will be emptied.
* You can also pass a regex to remove all events that match it.
*
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeEvent = function removeEvent(evt) {
var type = typeof evt;
var events = this._getEvents();
var key;
// Remove different things depending on the state of evt
if (type === 'string') {
// Remove all listeners for the specified event
delete events[evt];
}
else if (evt instanceof RegExp) {
// Remove all events matching the regex.
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
delete events[key];
}
}
}
else {
// Remove all listeners in all events
delete this._events;
}
return this;
};
/**
* Alias of removeEvent.
*
* Added to mirror the node API.
*/
proto.removeAllListeners = alias('removeEvent');
/**
* Emits an event of your choice.
* When emitted, every listener attached to that event will be executed.
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
* So they will not arrive within the array on the other side, they will be separate.
* You can also pass a regular expression to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {Array} [args] Optional array of arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emitEvent = function emitEvent(evt, args) {
var listenersMap = this.getListenersAsObject(evt);
var listeners;
var listener;
var i;
var key;
var response;
for (key in listenersMap) {
if (listenersMap.hasOwnProperty(key)) {
listeners = listenersMap[key].slice(0);
for (i = 0; i < listeners.length; i++) {
// If the listener returns true then it shall be removed from the event
// The function is executed either with a basic call or an apply if there is an args array
listener = listeners[i];
if (listener.once === true) {
this.removeListener(evt, listener.listener);
}
response = listener.listener.apply(this, args || []);
if (response === this._getOnceReturnValue()) {
this.removeListener(evt, listener.listener);
}
}
}
}
return this;
};
/**
* Alias of emitEvent
*/
proto.trigger = alias('emitEvent');
/**
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {...*} Optional additional arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emit = function emit(evt) {
var args = Array.prototype.slice.call(arguments, 1);
return this.emitEvent(evt, args);
};
/**
* Sets the current value to check against when executing listeners. If a
* listeners return value matches the one set here then it will be removed
* after execution. This value defaults to true.
*
* @param {*} value The new value to check for when executing listeners.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.setOnceReturnValue = function setOnceReturnValue(value) {
this._onceReturnValue = value;
return this;
};
/**
* Fetches the current value to check against when executing listeners. If
* the listeners return value matches this one then it should be removed
* automatically. It will return true by default.
*
* @return {*|Boolean} The current value to check for or the default, true.
* @api private
*/
proto._getOnceReturnValue = function _getOnceReturnValue() {
if (this.hasOwnProperty('_onceReturnValue')) {
return this._onceReturnValue;
}
else {
return true;
}
};
/**
* Fetches the events object and creates one if required.
*
* @return {Object} The events storage object.
* @api private
*/
proto._getEvents = function _getEvents() {
return this._events || (this._events = {});
};
/**
* Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
*
* @return {Function} Non conflicting EventEmitter class.
*/
EventEmitter.noConflict = function noConflict() {
exports.EventEmitter = originalGlobalValue;
return EventEmitter;
};
// Expose the class either via AMD, CommonJS or the global object
if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return EventEmitter;
}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
else {}
}(typeof window !== 'undefined' ? window : this || {}));
/***/ }),
/***/ "./src/api/geo.ts":
/*!************************!*\
!*** ./src/api/geo.ts ***!
\************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3_geo_1 = __webpack_require__(/*! d3-geo */ "./node_modules/_d3-geo@1.6.4@d3-geo/build/d3-geo.js");
var d3_geo_projection_1 = __webpack_require__(/*! d3-geo-projection */ "./node_modules/_d3-geo-projection@2.1.2@d3-geo-projection/build/d3-geo-projection.js");
var view_1 = __webpack_require__(/*! ../view */ "./src/view.ts");
var get_geo_projection_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/get-geo-projection */ "./src/util/get-geo-projection.ts"));
var api = {
// geo maintain
geoArea: function (feature) {
return d3_geo_1.geoArea(feature);
},
geoAreaByName: function (name) {
return d3_geo_1.geoArea(this.geoFeatureByName(name));
},
geoCentroid: function (feature) {
return d3_geo_1.geoCentroid(feature);
},
geoCentroidByName: function (name) {
return d3_geo_1.geoCentroid(this.geoFeatureByName(name));
},
geoDistance: function (p1, p2) {
return d3_geo_1.geoDistance(p1, p2);
},
geoLength: function (feature) {
return d3_geo_1.geoLength(feature);
},
geoLengthByName: function (name) {
return d3_geo_1.geoLength(this.geoFeatureByName(name));
},
geoContains: function (feature, position /* [longitude, latitude] */) {
return d3_geo_1.geoContains(feature, position);
},
geoFeatureByName: function (name) {
var rows = this.rows;
var result;
rows.some(function (feature) {
if (feature.name === name) {
result = feature;
return true;
}
return false;
});
return result;
},
geoFeatureByPosition: function (position) {
var rows = this.rows;
var result;
rows.some(function (feature) {
if (d3_geo_1.geoContains(feature, position)) {
result = feature;
return true;
}
return false;
});
return result;
},
geoNameByPosition: function (position) {
var feature = this.geoFeatureByPosition(position);
if (feature) {
return feature.name;
}
},
// projection
// export getGeoProjection for custom used.
getGeoProjection: get_geo_projection_1.default,
geoProject: function (feature, projection, exportRaw) {
projection = get_geo_projection_1.default(projection, exportRaw);
return d3_geo_projection_1.geoProject(feature, projection);
},
geoProjectByName: function (name, projection, exportRaw) {
projection = get_geo_projection_1.default(projection, exportRaw);
return d3_geo_projection_1.geoProject(this.geoFeatureByName(name), projection);
},
geoProjectPosition: function (position, projection, exportRaw) {
var func = get_geo_projection_1.default(projection, exportRaw);
return func(position);
},
geoProjectInvert: function (position /* [x, y] */, projection, exportRaw) {
var func = get_geo_projection_1.default(projection, exportRaw);
return func.invert(position);
},
};
util_1.assign(view_1.View.prototype, api);
/***/ }),
/***/ "./src/api/hierarchy.ts":
/*!******************************!*\
!*** ./src/api/hierarchy.ts ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var view_1 = __webpack_require__(/*! ../view */ "./src/view.ts");
util_1.assign(view_1.View.prototype, {
getAllNodes: function () {
var nodes = [];
var root = this.root;
if (root && root.each) {
// d3-hierarchy
root.each(function (node) {
nodes.push(node);
});
}
else if (root && root.eachNode) {
// @antv/hierarchy
root.eachNode(function (node) {
nodes.push(node);
});
}
return nodes;
},
getAllLinks: function () {
var links = [];
var nodes = [this.root];
var node;
while ((node = nodes.pop())) {
var children = node.children;
if (children) {
children.forEach(function (child) {
links.push({
source: node,
target: child,
});
nodes.push(child);
});
}
}
return links;
},
});
util_1.assign(view_1.View.prototype, {
getAllEdges: view_1.View.prototype.getAllLinks,
});
/***/ }),
/***/ "./src/api/partition.ts":
/*!******************************!*\
!*** ./src/api/partition.ts ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var view_1 = __webpack_require__(/*! ../view */ "./src/view.ts");
util_1.assign(view_1.View.prototype, {
partition: function (group_by, order_by) {
if (order_by === void 0) { order_by = []; }
return partition_1.default(this.rows, group_by, order_by);
},
group: function (group_by, order_by) {
if (order_by === void 0) { order_by = []; }
var groups = this.partition(group_by, order_by);
return util_1.values(groups);
},
groups: function (group_by, order_by) {
if (order_by === void 0) { order_by = []; }
return this.group(group_by, order_by);
},
});
/***/ }),
/***/ "./src/api/statistics.ts":
/*!*******************************!*\
!*** ./src/api/statistics.ts ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var simpleStatistics = tslib_1.__importStar(__webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var view_1 = __webpack_require__(/*! ../view */ "./src/view.ts");
var p_by_fraction_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/p-by-fraction */ "./src/util/p-by-fraction.ts"));
var constants_1 = tslib_1.__importDefault(__webpack_require__(/*! ../constants */ "./src/constants.ts"));
var STATISTICS_METHODS = constants_1.default.STATISTICS_METHODS;
function getColumnValues(view, column) {
var values = view.getColumn(column);
if (util_1.isArray(values) && util_1.isArray(values[0])) {
values = util_1.flattenDeep(values);
}
return values;
}
// statistics
STATISTICS_METHODS.forEach(function (method) {
// @ts-ignore;
view_1.View.prototype[method] = function (column) {
// @ts-ignore
return simpleStatistics[method](getColumnValues(this, column));
};
});
var quantile = simpleStatistics.quantile;
util_1.assign(view_1.View.prototype, {
average: view_1.View.prototype.mean,
quantile: function (column, p) {
return quantile(getColumnValues(this, column), p);
},
quantiles: function (column, pArr) {
var columnArr = getColumnValues(this, column);
return pArr.map(function (p) { return quantile(columnArr, p); });
},
quantilesByFraction: function (column, fraction) {
return this.quantiles(column, p_by_fraction_1.default(fraction));
},
range: function (column) {
return [this.min(column), this.max(column)];
},
extent: function (column) {
// alias
return this.range(column);
},
});
/***/ }),
/***/ "./src/connector/default.ts":
/*!**********************************!*\
!*** ./src/connector/default.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
data_set_1.DataSet.registerConnector('default', function (data, dataSet) {
var view;
if (util_1.isString(data)) {
view = dataSet.getView(data);
}
else {
view = data;
}
if (!view) {
throw new TypeError('Invalid dataView');
}
return util_1.deepMix([], view.rows);
});
/***/ }),
/***/ "./src/connector/dsv.ts":
/*!******************************!*\
!*** ./src/connector/dsv.ts ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3_dsv_1 = __webpack_require__(/*! d3-dsv */ "./node_modules/_d3-dsv@1.2.0@d3-dsv/dist/d3-dsv.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
data_set_1.DataSet.registerConnector('dsv', function (str, options) {
if (options === void 0) { options = {}; }
var delimiter = options.delimiter || ',';
if (!util_1.isString(delimiter)) {
throw new TypeError('Invalid delimiter: must be a string!');
}
return d3_dsv_1.dsvFormat(delimiter).parse(str);
});
data_set_1.DataSet.registerConnector('csv', function (str) {
return d3_dsv_1.csvParse(str);
});
data_set_1.DataSet.registerConnector('tsv', function (str) {
return d3_dsv_1.tsvParse(str);
});
/***/ }),
/***/ "./src/connector/geo-graticule.ts":
/*!****************************************!*\
!*** ./src/connector/geo-graticule.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var d3_geo_1 = __webpack_require__(/*! d3-geo */ "./node_modules/_d3-geo@1.6.4@d3-geo/build/d3-geo.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
function connector(_options, dataView) {
dataView.dataType = 'geo-graticule';
var data = d3_geo_1.geoGraticule().lines();
data.map(function (row, index) {
row.index = "" + index;
return row;
});
dataView.rows = data;
return data;
}
exports.default = connector;
data_set_1.DataSet.registerConnector('geo-graticule', connector);
/***/ }),
/***/ "./src/connector/geojson.ts":
/*!**********************************!*\
!*** ./src/connector/geojson.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var point_at_length_1 = tslib_1.__importDefault(__webpack_require__(/*! point-at-length */ "./node_modules/_point-at-length@1.1.0@point-at-length/index.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3_geo_1 = __webpack_require__(/*! d3-geo */ "./node_modules/_d3-geo@1.6.4@d3-geo/build/d3-geo.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var geoPathGenerator = d3_geo_1.geoPath();
function GeoJSONConnector(data, _options, dataView) {
dataView.dataType = data_set_1.DataSet.CONSTANTS.GEO;
var features = util_1.deepMix([], data.features);
// pre-process
features.forEach(function (feature) {
feature.name = feature.properties.name;
feature.longitude = [];
feature.latitude = [];
var pathData = (feature.pathData = geoPathGenerator(feature));
var points = point_at_length_1.default(pathData);
points._path.forEach(function (point) {
feature.longitude.push(point[1]);
feature.latitude.push(point[2]);
});
var centroid = geoPathGenerator.centroid(feature);
feature.centroidX = centroid[0];
feature.centroidY = centroid[1];
});
// dataView.origin = features;
return features;
}
data_set_1.DataSet.registerConnector('geo', GeoJSONConnector);
data_set_1.DataSet.registerConnector('geojson', GeoJSONConnector);
data_set_1.DataSet.registerConnector('GeoJSON', GeoJSONConnector);
exports.default = GeoJSONConnector;
/***/ }),
/***/ "./src/connector/graph.ts":
/*!********************************!*\
!*** ./src/connector/graph.ts ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {
nodes: function (d) {
// optional
return d.nodes;
},
edges: function (d) {
// optional
return d.edges;
},
};
function connector(data, options, dataView) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
dataView.dataType = data_set_1.DataSet.CONSTANTS.GRAPH;
var nodes = options.nodes, edges = options.edges;
if (nodes && !util_1.isFunction(nodes)) {
throw new TypeError('Invalid nodes: must be a function!');
}
if (edges && !util_1.isFunction(edges)) {
throw new TypeError('Invalid edges: must be a function!');
}
// @ts-ignore
dataView.rows = dataView.graph = {
nodes: nodes(data),
edges: edges(data),
};
util_1.assign(dataView, dataView.graph);
return dataView.rows;
}
data_set_1.DataSet.registerConnector('graph', connector);
data_set_1.DataSet.registerConnector('diagram', connector);
/***/ }),
/***/ "./src/connector/hexjson.ts":
/*!**********************************!*\
!*** ./src/connector/hexjson.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3_hexjson_1 = __webpack_require__(/*! d3-hexjson */ "./node_modules/_d3-hexjson@1.1.0@d3-hexjson/build/d3-hexjson.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {
width: 1,
height: 1,
};
function processRow(row) {
row.cx = row.x;
row.cy = row.y;
row.x = [];
row.y = [];
row.vertices.forEach(function (v) {
row.x.push(v.x + row.cx);
row.y.push(v.y + row.cy);
});
return row;
}
function HexJSONConnector(data, options, dataView) {
dataView.dataType = data_set_1.DataSet.CONSTANTS.HEX;
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var width = options.width, height = options.height;
var HexJSON = util_1.deepMix([], data);
dataView._HexJSON = HexJSON;
var grid = (dataView._GridHexJSON = d3_hexjson_1.getGridForHexJSON(HexJSON));
var rows = (dataView.rows = d3_hexjson_1.renderHexJSON(HexJSON, width, height).map(processRow));
dataView._gridRows = d3_hexjson_1.renderHexJSON(grid, width, height).map(processRow);
return rows;
}
data_set_1.DataSet.registerConnector('hex', HexJSONConnector);
data_set_1.DataSet.registerConnector('hexjson', HexJSONConnector);
data_set_1.DataSet.registerConnector('hex-json', HexJSONConnector);
data_set_1.DataSet.registerConnector('HexJSON', HexJSONConnector);
exports.default = HexJSONConnector;
/***/ }),
/***/ "./src/connector/hierarchy.ts":
/*!************************************!*\
!*** ./src/connector/hierarchy.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3_hierarchy_1 = __webpack_require__(/*! d3-hierarchy */ "./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
function connector(data, options, dataView) {
dataView.dataType = data_set_1.DataSet.CONSTANTS.HIERARCHY;
var children = options && options.children ? options.children : null;
if (children && !util_1.isFunction(children)) {
throw new TypeError('Invalid children: must be a function!');
}
if (!options.pureData) {
// @ts-ignore
dataView.rows = dataView.root = d3_hierarchy_1.hierarchy(data, children);
}
else {
dataView.rows = dataView.root = data;
}
return data;
}
data_set_1.DataSet.registerConnector('hierarchy', connector);
data_set_1.DataSet.registerConnector('tree', connector);
/***/ }),
/***/ "./src/connector/topojson.ts":
/*!***********************************!*\
!*** ./src/connector/topojson.ts ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var topojson_client_1 = __webpack_require__(/*! topojson-client */ "./node_modules/_topojson-client@3.1.0@topojson-client/dist/topojson-client.js");
var geojson_1 = tslib_1.__importDefault(__webpack_require__(/*! ./geojson */ "./src/connector/geojson.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
function TopoJSONConnector(data, options, dataView) {
var object = options.object;
if (!util_1.isString(object)) {
throw new TypeError('Invalid object: must be a string!');
}
var geoData = topojson_client_1.feature(data, data.objects[object]);
return geojson_1.default(geoData, undefined, dataView);
}
data_set_1.DataSet.registerConnector('topojson', TopoJSONConnector);
data_set_1.DataSet.registerConnector('TopoJSON', TopoJSONConnector);
/***/ }),
/***/ "./src/constants.ts":
/*!**************************!*\
!*** ./src/constants.ts ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
HIERARCHY: 'hierarchy',
GEO: 'geo',
HEX: 'hex',
GRAPH: 'graph',
TABLE: 'table',
GEO_GRATICULE: 'geo-graticule',
STATISTICS_METHODS: [
'max',
'mean',
'median',
'min',
'mode',
'product',
'standardDeviation',
'sum',
'sumSimple',
'variance',
],
};
/***/ }),
/***/ "./src/data-set.ts":
/*!*************************!*\
!*** ./src/data-set.ts ***!
\*************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataSet = void 0;
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var wolfy87_eventemitter_1 = tslib_1.__importDefault(__webpack_require__(/*! wolfy87-eventemitter */ "./node_modules/_wolfy87-eventemitter@5.2.9@wolfy87-eventemitter/EventEmitter.js"));
var view_1 = __webpack_require__(/*! ./view */ "./src/view.ts");
var constants_1 = tslib_1.__importDefault(__webpack_require__(/*! ./constants */ "./src/constants.ts"));
/**
* 数据集
* @public
*/
var DataSet = /** @class */ (function (_super) {
tslib_1.__extends(DataSet, _super);
/**
* @param initialProps - 初始状态
*/
function DataSet(initialProps) {
if (initialProps === void 0) { initialProps = { state: {} }; }
var _this = _super.call(this) || this;
/**
* 否是 DataSet
*/
_this.isDataSet = true;
_this._onChangeTimer = null;
/**
* 所有挂在数据集上的数据视图key-value 对)
*/
_this.views = {};
/**
* 存储数据集上的状态量key-value 对)
*/
_this.state = {};
// assign(me, initialProps);
_this.state = initialProps.state;
return _this;
}
/**
* 注册一个数据连接函数,注册后所有数据视图都可以使用 name 来引用这个数据连接函数,从而接入某种数据源。
* @param name - 类型
* @param connector - 解析逻辑
*/
DataSet.registerConnector = function (name, connector) {
DataSet.connectors[name] = connector;
};
DataSet.getConnector = function (name) {
return DataSet.connectors[name] || DataSet.connectors.default;
};
/**
* 注册一个数据处理函数,注册后所有数据视图都可以使用 name 来引用这个数据处理函数,从而进行某种数据处理
* @param name - transform 类型
* @param transform - transform逻辑
*/
DataSet.registerTransform = function (name, transform) {
DataSet.transforms[name] = transform;
};
DataSet.getTransform = function (name) {
return DataSet.transforms[name] || DataSet.transforms.default;
};
DataSet.prototype._getUniqueViewName = function () {
var name = util_1.uniqueId('view_');
while (this.views[name]) {
name = util_1.uniqueId('view_');
}
return name;
};
DataSet.prototype.createView = function (name, options) {
if (util_1.isNil(name)) {
name = this._getUniqueViewName();
}
if (util_1.isObject(name)) {
options = name;
name = this._getUniqueViewName();
}
if (this.views[name]) {
throw new Error("data view exists: " + name);
}
var view = new view_1.View(this, options);
this.views[name] = view;
return view;
};
/**
* 返回 name 对应的数据视图实例
* @param name - name
*/
DataSet.prototype.getView = function (name) {
return this.views[name];
};
/**
* 设置 name 对应的数据视图实例为 dv
* @param name - 名称
* @param view - data view
*/
DataSet.prototype.setView = function (name, view) {
this.views[name] = view;
};
/**
* 设置状态量 name 的值为 value
* @param name - 状态名
* @param value - 值
*/
DataSet.prototype.setState = function (name, value) {
var _this = this;
this.state[name] = value;
if (this._onChangeTimer) {
window.clearTimeout(this._onChangeTimer);
this._onChangeTimer = null;
}
this._onChangeTimer = window.setTimeout(function () {
_this.emit('statechange', name, value);
}, 16); // execute after one frame
};
/**
* 常量,譬如 DataSet.CONSTANTS.HIERARCHY 是树形结构的名称
*/
DataSet.CONSTANTS = constants_1.default;
/**
* 注册的 Connectorkey-value 对)
*/
DataSet.connectors = {};
/**
* 已注册的 Transformkey-value 对)
*/
DataSet.transforms = {};
DataSet.DataSet = DataSet;
DataSet.DataView = view_1.View; // alias
DataSet.View = view_1.View;
DataSet.version = '____DATASET_VERSION____';
return DataSet;
}(wolfy87_eventemitter_1.default));
exports.DataSet = DataSet;
// @ts-ignore
util_1.assign(DataSet, constants_1.default);
// @ts-ignore
util_1.assign(DataSet.prototype, {
view: DataSet.prototype.createView,
});
view_1.View.DataSet = DataSet;
/***/ }),
/***/ "./src/index.ts":
/*!**********************!*\
!*** ./src/index.ts ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// extra APIs
__webpack_require__(/*! ./api/geo */ "./src/api/geo.ts");
__webpack_require__(/*! ./api/hierarchy */ "./src/api/hierarchy.ts");
__webpack_require__(/*! ./api/partition */ "./src/api/partition.ts");
__webpack_require__(/*! ./api/statistics */ "./src/api/statistics.ts");
// connectors
__webpack_require__(/*! ./connector/default */ "./src/connector/default.ts");
__webpack_require__(/*! ./connector/dsv */ "./src/connector/dsv.ts");
__webpack_require__(/*! ./connector/geo-graticule */ "./src/connector/geo-graticule.ts");
__webpack_require__(/*! ./connector/geojson */ "./src/connector/geojson.ts");
__webpack_require__(/*! ./connector/graph */ "./src/connector/graph.ts");
__webpack_require__(/*! ./connector/hexjson */ "./src/connector/hexjson.ts");
__webpack_require__(/*! ./connector/hierarchy */ "./src/connector/hierarchy.ts");
__webpack_require__(/*! ./connector/topojson */ "./src/connector/topojson.ts");
// transforms
// static
__webpack_require__(/*! ./transform/default */ "./src/transform/default.ts");
__webpack_require__(/*! ./transform/filter */ "./src/transform/filter.ts");
__webpack_require__(/*! ./transform/fold */ "./src/transform/fold.ts");
__webpack_require__(/*! ./transform/map */ "./src/transform/map.ts");
__webpack_require__(/*! ./transform/partition */ "./src/transform/partition.ts");
__webpack_require__(/*! ./transform/percent */ "./src/transform/percent.ts");
__webpack_require__(/*! ./transform/pick */ "./src/transform/pick.ts");
__webpack_require__(/*! ./transform/proportion */ "./src/transform/proportion.ts");
__webpack_require__(/*! ./transform/rename */ "./src/transform/rename.ts");
__webpack_require__(/*! ./transform/reverse */ "./src/transform/reverse.ts");
__webpack_require__(/*! ./transform/sort */ "./src/transform/sort.ts");
__webpack_require__(/*! ./transform/sort-by */ "./src/transform/sort-by.ts");
__webpack_require__(/*! ./transform/subset */ "./src/transform/subset.ts");
// imputation
__webpack_require__(/*! ./transform/fill-rows */ "./src/transform/fill-rows.ts");
__webpack_require__(/*! ./transform/impute */ "./src/transform/impute.ts");
// statistics
__webpack_require__(/*! ./transform/aggregate */ "./src/transform/aggregate.ts");
// regression
__webpack_require__(/*! ./transform/regression */ "./src/transform/regression.ts");
// KDE
__webpack_require__(/*! ./transform/kde */ "./src/transform/kde.ts");
// binning
__webpack_require__(/*! ./transform/bin/hexagon */ "./src/transform/bin/hexagon.ts");
__webpack_require__(/*! ./transform/bin/histogram */ "./src/transform/bin/histogram.ts");
__webpack_require__(/*! ./transform/bin/quantile */ "./src/transform/bin/quantile.ts");
__webpack_require__(/*! ./transform/bin/rectangle */ "./src/transform/bin/rectangle.ts");
// geo
__webpack_require__(/*! ./transform/geo/centroid */ "./src/transform/geo/centroid.ts");
__webpack_require__(/*! ./transform/geo/projection */ "./src/transform/geo/projection.ts");
__webpack_require__(/*! ./transform/geo/region */ "./src/transform/geo/region.ts");
// diagram
__webpack_require__(/*! ./transform/diagram/arc */ "./src/transform/diagram/arc.ts");
__webpack_require__(/*! ./transform/diagram/dagre */ "./src/transform/diagram/dagre.ts");
__webpack_require__(/*! ./transform/diagram/sankey */ "./src/transform/diagram/sankey.ts");
__webpack_require__(/*! ./transform/diagram/voronoi */ "./src/transform/diagram/voronoi.ts");
// hierarchy
__webpack_require__(/*! ./transform/hierarchy/cluster */ "./src/transform/hierarchy/cluster.ts");
__webpack_require__(/*! ./transform/hierarchy/compact-box */ "./src/transform/hierarchy/compact-box.ts");
__webpack_require__(/*! ./transform/hierarchy/dendrogram */ "./src/transform/hierarchy/dendrogram.ts");
__webpack_require__(/*! ./transform/hierarchy/indented */ "./src/transform/hierarchy/indented.ts");
__webpack_require__(/*! ./transform/hierarchy/pack */ "./src/transform/hierarchy/pack.ts");
__webpack_require__(/*! ./transform/hierarchy/partition */ "./src/transform/hierarchy/partition.ts");
__webpack_require__(/*! ./transform/hierarchy/tree */ "./src/transform/hierarchy/tree.ts");
__webpack_require__(/*! ./transform/hierarchy/treemap */ "./src/transform/hierarchy/treemap.ts");
// tag cloud
__webpack_require__(/*! ./transform/tag-cloud */ "./src/transform/tag-cloud.ts");
// waffle
__webpack_require__(/*! ./transform/waffle */ "./src/transform/waffle.ts");
// kernel smoothing
__webpack_require__(/*! ./transform/kernel-smooth/density */ "./src/transform/kernel-smooth/density.ts");
__webpack_require__(/*! ./transform/kernel-smooth/regression */ "./src/transform/kernel-smooth/regression.ts");
var data_set_1 = __webpack_require__(/*! ./data-set */ "./src/data-set.ts");
module.exports = data_set_1.DataSet;
/***/ }),
/***/ "./src/transform/aggregate.ts":
/*!************************************!*\
!*** ./src/transform/aggregate.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var simpleStatistics = tslib_1.__importStar(__webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js"));
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var registerTransform = data_set_1.DataSet.registerTransform;
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
as: [],
fields: [],
groupBy: [],
operations: [],
};
var DEFAULT_OPERATION = 'count';
var aggregates = {
count: function (data) {
return data.length;
},
distinct: function (data, field) {
var values = util_1.uniq(data.map(function (row) { return row[field]; }));
return values.length;
},
};
data_set_1.DataSet.CONSTANTS.STATISTICS_METHODS.forEach(function (method) {
aggregates[method] = function (data, field) {
var values = data.map(function (row) { return row[field]; });
if (util_1.isArray(values) && util_1.isArray(values[0])) {
values = util_1.flattenDeep(values);
}
// @ts-ignore
return simpleStatistics[method](values);
};
});
aggregates.average = aggregates.mean;
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
if (!util_1.isArray(fields)) {
throw new TypeError('Invalid fields: it must be an array with one or more strings!');
}
var outputNames = options.as || [];
if (util_1.isString(outputNames)) {
outputNames = [outputNames];
}
var operations = options.operations;
if (util_1.isString(operations)) {
operations = [operations];
}
var DEFAULT_OPERATIONS = [DEFAULT_OPERATION];
if (!util_1.isArray(operations) || !operations.length) {
console.warn('operations is not defined, will use [ "count" ] directly.');
operations = DEFAULT_OPERATIONS;
outputNames = operations;
}
if (!(operations.length === 1 && operations[0] === DEFAULT_OPERATION)) {
if (operations.length !== fields.length) {
throw new TypeError("Invalid operations: it's length must be the same as fields!");
}
if (outputNames.length !== fields.length) {
throw new TypeError("Invalid as: it's length must be the same as fields!");
}
}
var groups = partition_1.default(dataView.rows, options.groupBy);
var results = [];
util_1.forIn(groups, function (group) {
var result = group[0];
operations.forEach(function (operation, i) {
var outputName = outputNames[i];
var field = fields[i];
result[outputName] = aggregates[operation](group, field);
});
results.push(result);
});
dataView.rows = results;
}
registerTransform('aggregate', transform);
registerTransform('summary', transform);
exports.default = {
VALID_AGGREGATES: util_1.keys(aggregates),
};
/***/ }),
/***/ "./src/transform/bin/hexagon.ts":
/*!**************************************!*\
!*** ./src/transform/bin/hexagon.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
as: ['x', 'y', 'count'],
bins: [30, 30],
offset: [0, 0],
sizeByCount: false,
};
var SQRT3 = Math.sqrt(3);
var THIRD_PI = Math.PI / 3;
var ANGLES = [0, THIRD_PI, 2 * THIRD_PI, 3 * THIRD_PI, 4 * THIRD_PI, 5 * THIRD_PI];
function distance(x0, y0, x1, y1) {
return Math.sqrt((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1));
}
function nearestBinsCenters(value, scale, offset) {
var temp = value - offset;
scale = scale / 2;
var div = Math.floor(temp / scale);
var rounded = scale * (div + (Math.abs(div % 2) === 1 ? 1 : 0));
var roundedScaled = scale * (div + (Math.abs(div % 2) === 1 ? 0 : 1));
return [rounded + offset, roundedScaled + offset];
}
function generateBins(points, binWidth, offset) {
if (binWidth === void 0) { binWidth = [1, 1]; }
if (offset === void 0) { offset = [0, 0]; }
// processing aligned data
var bins = {};
var _a = tslib_1.__read(binWidth, 2), binWidthX = _a[0], binWidthY = _a[1];
var _b = tslib_1.__read(offset, 2), offsetX = _b[0], offsetY = _b[1];
points.forEach(function (point) {
var _a, _b;
var _c = tslib_1.__read(point, 2), x = _c[0], y = _c[1];
// step3.1: nearest two centers
var _d = tslib_1.__read(nearestBinsCenters(x, binWidthX, offsetX), 2), xRounded = _d[0], xRoundedScaled = _d[1];
var _e = tslib_1.__read(nearestBinsCenters(y, binWidthY, offsetY), 2), yRounded = _e[0], yRoundedScaled = _e[1];
// step3.2: compare distances
var d1 = distance(x, y, xRounded, yRounded);
var d2 = distance(x, y, xRoundedScaled, yRoundedScaled);
var binKey;
var binX;
var binY;
if (d1 < d2) {
binKey = "x" + xRounded + "y" + yRounded;
_a = tslib_1.__read([xRounded, yRounded], 2), binX = _a[0], binY = _a[1];
}
else {
binKey = "x" + xRoundedScaled + "y" + yRoundedScaled;
_b = tslib_1.__read([xRoundedScaled, yRoundedScaled], 2), binX = _b[0], binY = _b[1];
}
bins[binKey] = bins[binKey] || {
x: binX,
y: binY,
count: 0,
};
bins[binKey].count++;
});
return bins;
}
function transform(dataView, options) {
// step1: get binWidth, etc.
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
if (!util_1.isArray(fields) || fields.length !== 2) {
throw new TypeError('Invalid fields: it must be an array with 2 strings!');
}
var _a = tslib_1.__read(fields, 2), fieldX = _a[0], fieldY = _a[1];
var rangeFieldX = dataView.range(fieldX);
var rangeFieldY = dataView.range(fieldY);
var widthX = rangeFieldX[1] - rangeFieldX[0];
var widthY = rangeFieldY[1] - rangeFieldY[0];
var binWidth = options.binWidth || [];
if (binWidth.length !== 2) {
var _b = tslib_1.__read(options.bins, 2), binsX = _b[0], binsY = _b[1];
if (binsX <= 0 || binsY <= 0) {
throw new TypeError('Invalid bins: must be an array with two positive numbers (e.g. [ 30, 30 ])!');
}
binWidth = [widthX / binsX, widthY / binsY];
}
// step2: align scale (squash Y)
/*
* binWidthX / binWidthY should be Math.sqrt3 / 1.5
* -: binWidthX |: binWidthY
* 3
* |
* 4 | 2
* |
* |
* 5----------------1
*
* 0
*/
var _c = tslib_1.__read(options.offset, 2), offsetX = _c[0], offsetY = _c[1];
var yScale = (3 * binWidth[0]) / (SQRT3 * binWidth[1]);
// const yScale = binWidth[0] / (SQRT3 * binWidth[1]);
var points = dataView.rows.map(function (row) { return [row[fieldX], yScale * row[fieldY]]; });
// step3: binning
var bins = generateBins(points, [binWidth[0], yScale * binWidth[1]], [offsetX, yScale * offsetY]);
// step4: restore scale (for Y)
var _d = tslib_1.__read(options.as, 3), asX = _d[0], asY = _d[1], asCount = _d[2];
if (!asX || !asY || !asCount) {
throw new TypeError('Invalid as: it must be an array with three elements (e.g. [ "x", "y", "count" ])!');
}
var radius = binWidth[0] / SQRT3;
var hexagonPoints = ANGLES.map(function (angle) { return [Math.sin(angle) * radius, -Math.cos(angle) * radius]; });
var result = [];
var maxCount = 0;
if (options.sizeByCount) {
util_1.forIn(bins, function (bin) {
if (bin.count > maxCount) {
maxCount = bin.count;
}
});
}
util_1.forIn(bins, function (bin) {
var x = bin.x, y = bin.y, count = bin.count;
var row = {};
row[asCount] = count;
if (options.sizeByCount) {
row[asX] = hexagonPoints.map(function (p) { return x + (bin.count / maxCount) * p[0]; });
row[asY] = hexagonPoints.map(function (p) { return (y + (bin.count / maxCount) * p[1]) / yScale; });
}
else {
row[asX] = hexagonPoints.map(function (p) { return x + p[0]; });
row[asY] = hexagonPoints.map(function (p) { return (y + p[1]) / yScale; });
}
result.push(row);
});
dataView.rows = result;
}
data_set_1.DataSet.registerTransform('bin.hexagon', transform);
data_set_1.DataSet.registerTransform('bin.hex', transform);
data_set_1.DataSet.registerTransform('hexbin', transform);
/***/ }),
/***/ "./src/transform/bin/histogram.ts":
/*!****************************************!*\
!*** ./src/transform/bin/histogram.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
as: ['x', 'count'],
bins: undefined,
offset: 0,
groupBy: [],
};
function nearestBin(value, scale, offset) {
var temp = value - offset;
var div = Math.floor(temp / scale);
return [div * scale + offset, (div + 1) * scale + offset];
}
/** Sturges formula */
function sturges(dataLength) {
return Math.ceil(Math.log(dataLength) / Math.LN2) + 1;
}
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var field = option_parser_1.getField(options);
if (dataView.rows.length === 0) {
return;
}
var range = dataView.range(field);
var width = range[1] - range[0];
var binWidth = options.binWidth;
var bins = options.bins;
if (!binWidth && bins) {
if (bins <= 0) {
throw new TypeError('Invalid bins: it must be a positive number!');
}
binWidth = width / bins;
}
if (!binWidth && !bins) {
var binNumber = sturges(dataView.rows.length);
binWidth = width / binNumber;
}
var offset = options.offset % binWidth;
// grouping
var rows = [];
var groupBy = options.groupBy;
var groups = partition_1.default(dataView.rows, groupBy);
util_1.forIn(groups, function (group) {
var bins = {};
var column = group.map(function (row) { return row[field]; });
column.forEach(function (value) {
var _a = tslib_1.__read(nearestBin(value, binWidth, offset), 2), x0 = _a[0], x1 = _a[1];
var binKey = x0 + "-" + x1;
bins[binKey] = bins[binKey] || {
x0: x0,
x1: x1,
count: 0,
};
bins[binKey].count++;
});
var _a = tslib_1.__read(options.as, 2), asX = _a[0], asCount = _a[1];
if (!asX || !asCount) {
throw new TypeError('Invalid as: it must be an array with 2 elements (e.g. [ "x", "count" ])!');
}
var meta = util_1.pick(group[0], groupBy);
util_1.forIn(bins, function (bin) {
var row = util_1.assign({}, meta);
row[asX] = [bin.x0, bin.x1];
row[asCount] = bin.count;
rows.push(row);
});
});
dataView.rows = rows;
}
data_set_1.DataSet.registerTransform('bin.histogram', transform);
data_set_1.DataSet.registerTransform('bin.dot', transform);
/***/ }),
/***/ "./src/transform/bin/quantile.ts":
/*!***************************************!*\
!*** ./src/transform/bin/quantile.ts ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var simple_statistics_1 = __webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/partition */ "./src/util/partition.ts"));
var p_by_fraction_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/p-by-fraction */ "./src/util/p-by-fraction.ts"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var registerTransform = data_set_1.DataSet.registerTransform;
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
as: '_bin',
groupBy: [],
fraction: 4,
};
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var field = option_parser_1.getField(options);
var as = options.as;
if (!util_1.isString(as)) {
throw new TypeError('Invalid as: it must be a string (e.g. "_bin")!');
}
var pArray = options.p;
var fraction = options.fraction;
if (!util_1.isArray(pArray) || pArray.length === 0) {
pArray = p_by_fraction_1.default(fraction);
}
var rows = dataView.rows;
var groupBy = options.groupBy;
var groups = partition_1.default(rows, groupBy);
var result = [];
util_1.forIn(groups, function (group) {
// const resultRow = pick(group[0], groupBy);
var resultRow = group[0];
var binningColumn = group.map(function (row) { return row[field]; });
var quantiles = pArray.map(function (p) { return simple_statistics_1.quantile(binningColumn, p); });
resultRow[as] = quantiles;
result.push(resultRow);
});
dataView.rows = result;
}
registerTransform('bin.quantile', transform);
/***/ }),
/***/ "./src/transform/bin/rectangle.ts":
/*!****************************************!*\
!*** ./src/transform/bin/rectangle.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var registerTransform = data_set_1.DataSet.registerTransform;
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
as: ['x', 'y', 'count'],
bins: [30, 30],
offset: [0, 0],
sizeByCount: false,
};
function nearestBin(value, scale, offset) {
var temp = value - offset;
var div = Math.floor(temp / scale);
return [div * scale + offset, (div + 1) * scale + offset];
}
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var _a = tslib_1.__read(option_parser_1.getFields(options), 2), fieldX = _a[0], fieldY = _a[1];
if (!fieldX || !fieldY) {
throw new TypeError('Invalid fields: must be an array with 2 strings!');
}
var rangeFieldX = dataView.range(fieldX);
var rangeFieldY = dataView.range(fieldY);
var widthX = rangeFieldX[1] - rangeFieldX[0];
var widthY = rangeFieldY[1] - rangeFieldY[0];
var binWidth = options.binWidth || [];
if (binWidth.length !== 2) {
var _b = tslib_1.__read(options.bins, 2), binsX = _b[0], binsY = _b[1];
if (binsX <= 0 || binsY <= 0) {
throw new TypeError('Invalid bins: must be an array with 2 positive numbers (e.g. [ 30, 30 ])!');
}
binWidth = [widthX / binsX, widthY / binsY];
}
var points = dataView.rows.map(function (row) { return [row[fieldX], row[fieldY]]; });
var bins = {};
var _c = tslib_1.__read(options.offset, 2), offsetX = _c[0], offsetY = _c[1];
points.forEach(function (point) {
var _a = tslib_1.__read(nearestBin(point[0], binWidth[0], offsetX), 2), x0 = _a[0], x1 = _a[1];
var _b = tslib_1.__read(nearestBin(point[1], binWidth[1], offsetY), 2), y0 = _b[0], y1 = _b[1];
var binKey = x0 + "-" + x1 + "-" + y0 + "-" + y1;
bins[binKey] = bins[binKey] || {
x0: x0,
x1: x1,
y0: y0,
y1: y1,
count: 0,
};
bins[binKey].count++;
});
var rows = [];
var _d = tslib_1.__read(options.as, 3), asX = _d[0], asY = _d[1], asCount = _d[2];
if (!asX || !asY || !asCount) {
throw new TypeError('Invalid as: it must be an array with 3 strings (e.g. [ "x", "y", "count" ])!');
}
/* points
* 3---2
* | |
* 0---1
*/
if (!options.sizeByCount) {
util_1.forIn(bins, function (bin) {
var row = {};
row[asX] = [bin.x0, bin.x1, bin.x1, bin.x0];
row[asY] = [bin.y0, bin.y0, bin.y1, bin.y1];
row[asCount] = bin.count;
rows.push(row);
});
}
else {
var maxCount_1 = 0;
util_1.forIn(bins, function (bin) {
if (bin.count > maxCount_1) {
maxCount_1 = bin.count;
}
});
util_1.forIn(bins, function (bin) {
var x0 = bin.x0, x1 = bin.x1, y0 = bin.y0, y1 = bin.y1, count = bin.count;
var scale = count / maxCount_1;
var _a = tslib_1.__read([(x0 + x1) / 2, (y0 + y1) / 2], 2), cx = _a[0], cy = _a[1];
var rx = ((x1 - x0) * scale) / 2;
var ry = ((y1 - y0) * scale) / 2;
var x01 = cx - rx;
var x11 = cx + rx;
var y01 = cy - ry;
var y11 = cy + ry;
var row = {};
row[asX] = [x01, x11, x11, x01];
row[asY] = [y01, y01, y11, y11];
row[asCount] = count;
rows.push(row);
});
}
dataView.rows = rows;
}
registerTransform('bin.rectangle', transform);
registerTransform('bin.rect', transform);
/***/ }),
/***/ "./src/transform/default.ts":
/*!**********************************!*\
!*** ./src/transform/default.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
data_set_1.DataSet.registerTransform('default', function (dataView) {
return dataView;
});
/***/ }),
/***/ "./src/transform/diagram/arc.ts":
/*!**************************************!*\
!*** ./src/transform/diagram/arc.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* for Arc Diagram (edges without weight) / Chord Diagram (edges with source and target weight)
* graph data required (nodes, edges)
*/
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {
y: 0,
thickness: 0.05,
weight: false,
marginRatio: 0.1,
id: function (node) { return node.id; },
source: function (edge) { return edge.source; },
target: function (edge) { return edge.target; },
sourceWeight: function (edge) { return edge.value || 1; },
targetWeight: function (edge) { return edge.value || 1; },
sortBy: null,
};
function _nodesFromEdges(edges, options, map) {
if (map === void 0) { map = {}; }
edges.forEach(function (edge) {
var sId = options.edgeSource(edge);
var tId = options.edgeTarget(edge);
if (!map[sId]) {
map[sId] = {
id: sId,
};
}
if (!map[tId]) {
map[tId] = {
id: tId,
};
}
});
return util_1.values(map);
}
function _processGraph(nodeById, edges, options) {
util_1.forIn(nodeById, function (node, id) {
// in edges, out edges
node.inEdges = edges.filter(function (edge) { return "" + options.target(edge) === "" + id; });
node.outEdges = edges.filter(function (edge) { return "" + options.source(edge) === "" + id; });
// frequency
node.edges = node.outEdges.concat(node.inEdges);
node.frequency = node.edges.length;
// weight
node.value = 0;
node.inEdges.forEach(function (edge) {
node.value += options.targetWeight(edge);
});
node.outEdges.forEach(function (edge) {
node.value += options.sourceWeight(edge);
});
});
}
function _sortNodes(nodes, options) {
var sortMethods = {
weight: function (a, b) { return b.value - a.value; },
frequency: function (a, b) { return b.frequency - a.frequency; },
id: function (a, b) { return ("" + options.id(a)).localeCompare("" + options.id(b)); },
};
var method = sortMethods[options.sortBy];
if (!method && util_1.isFunction(options.sortBy)) {
method = options.sortBy;
}
if (method) {
nodes.sort(method);
}
}
function _layoutNodes(nodes, options) {
var len = nodes.length;
if (!len) {
throw new TypeError("Invalid nodes: it's empty!");
}
if (options.weight) {
var marginRatio_1 = options.marginRatio;
if (marginRatio_1 < 0 || marginRatio_1 >= 1) {
throw new TypeError('Invalid marginRatio: it must be in range [0, 1)!');
}
var margin_1 = marginRatio_1 / (2 * len);
var thickness_1 = options.thickness;
if (thickness_1 <= 0 || thickness_1 >= 1) {
throw new TypeError('Invalid thickness: it must be in range (0, 1)!');
}
var totalValue_1 = 0;
nodes.forEach(function (node) {
totalValue_1 += node.value;
});
nodes.forEach(function (node) {
node.weight = node.value / totalValue_1;
node.width = node.weight * (1 - marginRatio_1);
node.height = thickness_1;
});
nodes.forEach(function (node, index) {
// x
var deltaX = 0;
for (var i = index - 1; i >= 0; i--) {
deltaX += nodes[i].width + 2 * margin_1;
}
var minX = (node.minX = margin_1 + deltaX);
var maxX = (node.maxX = node.minX + node.width);
var minY = (node.minY = options.y - thickness_1 / 2);
var maxY = (node.maxY = minY + thickness_1);
node.x = [minX, maxX, maxX, minX];
node.y = [minY, minY, maxY, maxY];
/* points
* 3---2
* | |
* 0---1
*/
// node.x = minX + 0.5 * node.width;
// node.y = options.y;
});
}
else {
var deltaX_1 = 1 / len;
nodes.forEach(function (node, index) {
node.x = (index + 0.5) * deltaX_1;
node.y = options.y;
});
}
}
function _locatingEdges(nodeById, edges, options) {
if (options.weight) {
var valueById_1 = {};
util_1.forIn(nodeById, function (node, id) {
valueById_1[id] = node.value;
});
edges.forEach(function (edge) {
var sId = options.source(edge);
var tId = options.target(edge);
var sNode = nodeById[sId];
var tNode = nodeById[tId];
if (sNode && tNode) {
var sValue = valueById_1[sId];
var currentSValue = options.sourceWeight(edge);
var sStart = sNode.minX + ((sNode.value - sValue) / sNode.value) * sNode.width;
var sEnd = sStart + (currentSValue / sNode.value) * sNode.width;
valueById_1[sId] -= currentSValue;
var tValue = valueById_1[tId];
var currentTValue = options.targetWeight(edge);
var tStart = tNode.minX + ((tNode.value - tValue) / tNode.value) * tNode.width;
var tEnd = tStart + (currentTValue / tNode.value) * tNode.width;
valueById_1[tId] -= currentTValue;
var y = options.y;
edge.x = [sStart, sEnd, tStart, tEnd];
edge.y = [y, y, y, y];
}
});
}
else {
edges.forEach(function (edge) {
var sNode = nodeById[options.source(edge)];
var tNode = nodeById[options.target(edge)];
if (sNode && tNode) {
edge.x = [sNode.x, tNode.x];
edge.y = [sNode.y, tNode.y];
}
});
}
}
function transform(dv, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var nodeById = {};
var nodes = dv.nodes;
var edges = dv.edges;
if (!util_1.isArray(nodes) || nodes.length === 0) {
nodes = _nodesFromEdges(edges, options, nodeById);
}
nodes.forEach(function (node) {
var id = options.id(node);
nodeById[id] = node;
});
_processGraph(nodeById, edges, options);
_sortNodes(nodes, options);
_layoutNodes(nodes, options);
_locatingEdges(nodeById, edges, options);
dv.nodes = nodes;
dv.edges = edges;
}
data_set_1.DataSet.registerTransform('diagram.arc', transform);
data_set_1.DataSet.registerTransform('arc', transform);
/***/ }),
/***/ "./src/transform/diagram/dagre.ts":
/*!****************************************!*\
!*** ./src/transform/diagram/dagre.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
/*
* for DAG
* graph data required (nodes, edges)
*/
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var dagre_1 = tslib_1.__importDefault(__webpack_require__(/*! dagre */ "./node_modules/_dagre@0.8.5@dagre/index.js"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {
// nodeId: node => node.index,
rankdir: 'TB',
align: 'TB',
nodesep: 50,
edgesep: 10,
ranksep: 50,
source: function (edge) { return edge.source; },
target: function (edge) { return edge.target; },
};
function transform(dv, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var g = new dagre_1.default.graphlib.Graph();
// Set an object for the graph label
g.setGraph({});
// Default to assigning a new object as a label for each new edge.
g.setDefaultEdgeLabel(function () {
return {};
});
dv.nodes.forEach(function (node) {
var nodeId = options.nodeId ? options.nodeId(node) : node.id;
if (!node.height && !node.width) {
node.height = node.width = options.edgesep;
}
g.setNode(nodeId, node);
});
dv.edges.forEach(function (edge) {
g.setEdge(options.source(edge), options.target(edge));
});
dagre_1.default.layout(g);
var nodes = [];
var edges = [];
g.nodes().forEach(function (node) {
var n = g.node(node);
var x = n.x, y = n.y, height = n.height, width = n.width;
/* points
* 3---2
* | |
* 0---1
*/
// @ts-ignore
n.x = [x - width / 2, x + width / 2, x + width / 2, x - width / 2];
// @ts-ignore
n.y = [y + height / 2, y + height / 2, y - height / 2, y - height / 2];
nodes.push(n);
});
g.edges().forEach(function (edge) {
var points = g.edge(edge).points;
var e = {};
e.x = points.map(function (p) { return p.x; });
e.y = points.map(function (p) { return p.y; });
edges.push(e);
});
dv.nodes = nodes;
dv.edges = edges;
}
data_set_1.DataSet.registerTransform('diagram.dagre', transform);
data_set_1.DataSet.registerTransform('dagre', transform);
/***/ }),
/***/ "./src/transform/diagram/sankey.ts":
/*!*****************************************!*\
!*** ./src/transform/diagram/sankey.ts ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* for Sankey Diagram
* graph data required (nodes, edges)
*/
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3_sankey_1 = __webpack_require__(/*! d3-sankey */ "./node_modules/_d3-sankey@0.9.1@d3-sankey/dist/d3-sankey.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var ALIGN_METHOD = {
sankeyLeft: d3_sankey_1.sankeyLeft,
sankeyRight: d3_sankey_1.sankeyRight,
sankeyCenter: d3_sankey_1.sankeyCenter,
sankeyJustify: d3_sankey_1.sankeyJustify,
};
var DEFAULT_OPTIONS = {
// nodeId: node => node.index,
value: function (node) { return node.value; },
source: function (edge) { return edge.source; },
target: function (edge) { return edge.target; },
nodeAlign: 'sankeyJustify',
nodeWidth: 0.02,
nodePadding: 0.02,
sort: undefined,
};
function transform(dv, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var nodeAlign = null;
if (util_1.isString(options.nodeAlign)) {
nodeAlign = ALIGN_METHOD[options.nodeAlign];
}
else if (util_1.isFunction(options.nodeAlign)) {
nodeAlign = options.nodeAlign;
}
var sankeyProcessor = d3_sankey_1.sankey()
.nodeSort(options.sort)
.links(function (d) { return d.edges; })
.nodeWidth(options.nodeWidth)
.nodePadding(options.nodePadding)
.extent([
[0, 0],
[1, 1],
]);
if (util_1.isFunction(options.nodeId)) {
sankeyProcessor.nodeId(options.nodeId);
}
if (nodeAlign) {
sankeyProcessor.nodeAlign(nodeAlign);
}
// TODO:
// @ts-ignore
sankeyProcessor(dv);
// post process (x, y), etc.
dv.nodes.forEach(function (node) {
var x0 = node.x0, x1 = node.x1, y0 = node.y0, y1 = node.y1;
/* points
* 3---2
* | |
* 0---1
*/
node.x = [x0, x1, x1, x0];
node.y = [y0, y0, y1, y1];
});
dv.edges.forEach(function (edge) {
var source = edge.source, target = edge.target;
var sx = source.x1;
var tx = target.x0;
edge.x = [sx, sx, tx, tx];
var offset = edge.width / 2;
edge.y = [edge.y0 + offset, edge.y0 - offset, edge.y1 + offset, edge.y1 - offset];
});
}
data_set_1.DataSet.registerTransform('diagram.sankey', transform);
data_set_1.DataSet.registerTransform('sankey', transform);
/***/ }),
/***/ "./src/transform/diagram/voronoi.ts":
/*!******************************************!*\
!*** ./src/transform/diagram/voronoi.ts ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var d3Voronoi = tslib_1.__importStar(__webpack_require__(/*! d3-voronoi */ "./node_modules/_d3-voronoi@1.1.4@d3-voronoi/dist/d3-voronoi.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var registerTransform = data_set_1.DataSet.registerTransform;
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
// fields: [ 'x', 'y' ] // field x and field y, required
// extend: [[x0, y0], [x1, y1]], // optional
// size: [width, height], // optional
as: ['_x', '_y'],
};
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var as = options.as;
if (!util_1.isArray(as) || as.length !== 2) {
throw new TypeError('Invalid as: must be an array with two strings!');
}
var xField = as[0];
var yField = as[1];
var fields = option_parser_1.getFields(options);
if (!util_1.isArray(fields) || fields.length !== 2) {
throw new TypeError('Invalid fields: must be an array with two strings!');
}
var x = fields[0];
var y = fields[1];
var rows = dataView.rows;
var data = rows.map(function (row) { return [row[x], row[y]]; });
var voronoi = d3Voronoi.voronoi();
if (options.extend) {
voronoi.extent(options.extend);
}
if (options.size) {
voronoi.size(options.size);
}
var polygons = voronoi(data).polygons();
rows.forEach(function (row, i) {
var polygon = polygons[i].filter(function (point) { return !!point; }); // some points are null
row[xField] = polygon.map(function (point) { return point[0]; });
row[yField] = polygon.map(function (point) { return point[1]; });
});
}
registerTransform('diagram.voronoi', transform);
registerTransform('voronoi', transform);
/***/ }),
/***/ "./src/transform/fill-rows.ts":
/*!************************************!*\
!*** ./src/transform/fill-rows.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {
fillBy: 'group',
groupBy: [],
orderBy: [],
};
function arrayDifference(arr1, arr2) {
// arrayDifference([1, 1, 1, 2], [1, 2]) => [1, 1]
var shadow = arr1.map(function (item) { return item; }); // shadow copy
arr2.forEach(function (item) {
var index = shadow.indexOf(item);
if (index > -1) {
shadow.splice(index, 1);
}
});
return shadow;
}
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var rows = dataView.rows;
var groupBy = options.groupBy;
var orderBy = options.orderBy;
var groups = partition_1.default(rows, groupBy, orderBy);
var maxLength = 0;
var referenceGroup = [];
util_1.forIn(groups, function (group) {
if (group.length > maxLength) {
maxLength = group.length;
referenceGroup = group;
}
});
var referenceOrderByKeys = [];
var referenceRowByOrderByKey = {};
referenceGroup.forEach(function (row) {
var key = orderBy.map(function (col) { return row[col]; }).join('-');
referenceOrderByKeys.push(key);
referenceRowByOrderByKey[key] = row;
});
if (options.fillBy === 'order') {
var first_1 = referenceGroup[0];
var allOrderByKeys_1 = [];
var rowByOrderByKey_1 = {};
rows.forEach(function (row) {
var key = orderBy.map(function (col) { return row[col]; }).join('-');
if (allOrderByKeys_1.indexOf(key) === -1) {
allOrderByKeys_1.push(key);
rowByOrderByKey_1[key] = row;
}
});
var _missingOrderByKeys = arrayDifference(allOrderByKeys_1, referenceOrderByKeys);
_missingOrderByKeys.forEach(function (key) {
var row = {};
groupBy.forEach(function (col) {
row[col] = first_1[col];
});
orderBy.forEach(function (col) {
row[col] = rowByOrderByKey_1[key][col];
});
rows.push(row);
referenceGroup.push(row);
referenceOrderByKeys.push(key);
referenceRowByOrderByKey[key] = row;
});
maxLength = referenceGroup.length;
}
util_1.forIn(groups, function (group) {
if (group !== referenceGroup && group.length < maxLength) {
var first_2 = group[0];
// missing orderBy keys
var orderByKeys_1 = [];
group.forEach(function (row) {
orderByKeys_1.push(orderBy.map(function (col) { return row[col]; }).join('-'));
});
var missingOrderByKeys = arrayDifference(referenceOrderByKeys, orderByKeys_1);
missingOrderByKeys.some(function (key, i) {
if (i >= maxLength - group.length) {
// group length overflow
return true;
}
var referenceRow = referenceRowByOrderByKey[key];
var row = {};
groupBy.forEach(function (col) {
row[col] = first_2[col];
});
orderBy.forEach(function (col) {
row[col] = referenceRow[col];
});
rows.push(row);
return false;
});
}
});
}
data_set_1.DataSet.registerTransform('fill-rows', transform);
data_set_1.DataSet.registerTransform('fillRows', transform);
/***/ }),
/***/ "./src/transform/filter.ts":
/*!*********************************!*\
!*** ./src/transform/filter.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
function defaultCallback(row) {
return !!row;
}
data_set_1.DataSet.registerTransform('filter', function (dataView, options) {
dataView.rows = dataView.rows.filter(options.callback || defaultCallback);
});
/***/ }),
/***/ "./src/transform/fold.ts":
/*!*******************************!*\
!*** ./src/transform/fold.ts ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
fields: [],
key: 'key',
retains: [],
value: 'value',
};
data_set_1.DataSet.registerTransform('fold', function (dataView, options) {
var columns = dataView.getColumnNames();
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
if (fields.length === 0) {
console.warn('warning: option fields is not specified, will fold all columns.');
fields = columns;
}
var key = options.key;
var value = options.value;
var retains = options.retains;
if (!retains || retains.length === 0) {
retains = util_1.difference(columns, fields);
}
var resultRows = [];
dataView.rows.forEach(function (row) {
fields.forEach(function (field) {
var resultRow = util_1.pick(row, retains);
resultRow[key] = field;
resultRow[value] = row[field];
resultRows.push(resultRow);
});
});
dataView.rows = resultRows;
});
/***/ }),
/***/ "./src/transform/geo/centroid.ts":
/*!***************************************!*\
!*** ./src/transform/geo/centroid.ts ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var registerTransform = data_set_1.DataSet.registerTransform;
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
// field: 'name', // required
// geoView: view, // required
// geoDataView: view, // alias
as: ['_centroid_x', '_centroid_y'],
};
function transform(view, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var field = option_parser_1.getField(options);
// @ts-ignore
var geoView = options.geoView || options.geoDataView; // alias
if (util_1.isString(geoView) && view.dataSet) {
geoView = view.dataSet.getView(geoView);
}
if (!geoView || geoView.dataType !== 'geo') {
throw new TypeError('Invalid geoView: must be a DataView of GEO dataType!');
}
var as = options.as;
if (!util_1.isArray(as) || as.length !== 2) {
throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "cX", "cY" ])!');
}
var centroidX = as[0];
var centroidY = as[1];
view.rows.forEach(function (row) {
var feature = geoView.geoFeatureByName(row[field]);
if (feature) {
if (geoView._projectedAs) {
row[centroidX] = feature[geoView._projectedAs[2]];
row[centroidY] = feature[geoView._projectedAs[3]];
}
else {
row[centroidX] = feature.centroidX;
row[centroidY] = feature.centroidY;
}
}
});
}
registerTransform('geo.centroid', transform);
/***/ }),
/***/ "./src/transform/geo/projection.ts":
/*!*****************************************!*\
!*** ./src/transform/geo/projection.ts ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3_geo_1 = __webpack_require__(/*! d3-geo */ "./node_modules/_d3-geo@1.6.4@d3-geo/build/d3-geo.js");
var point_at_length_1 = tslib_1.__importDefault(__webpack_require__(/*! point-at-length */ "./node_modules/_point-at-length@1.1.0@point-at-length/index.js"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var registerTransform = data_set_1.DataSet.registerTransform;
var get_geo_projection_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/get-geo-projection */ "./src/util/get-geo-projection.ts"));
var DEFAULT_OPTIONS = {
// projection: '', // default to null
as: ['_x', '_y', '_centroid_x', '_centroid_y'],
};
function transform(dataView, options) {
if (dataView.dataType !== 'geo' && dataView.dataType !== 'geo-graticule') {
throw new TypeError('Invalid dataView: this transform is for Geo data only!');
}
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var projection = options.projection;
if (!projection) {
throw new TypeError('Invalid projection!');
}
projection = get_geo_projection_1.default(projection);
// @ts-ignore;
var geoPathGenerator = d3_geo_1.geoPath(projection);
var as = options.as;
if (!util_1.isArray(as) || as.length !== 4) {
throw new TypeError('Invalid as: it must be an array with 4 strings (e.g. [ "x", "y", "cX", "cY" ])!');
}
dataView._projectedAs = as;
var _a = tslib_1.__read(as, 4), lonField = _a[0], latField = _a[1], centroidX = _a[2], centroidY = _a[3];
dataView.rows.forEach(function (row) {
row[lonField] = [];
row[latField] = [];
var pathData = geoPathGenerator(row);
if (pathData) {
// TODO projection returns null
var points = point_at_length_1.default(pathData);
points._path.forEach(function (point) {
row[lonField].push(point[1]);
row[latField].push(point[2]);
});
var centroid = geoPathGenerator.centroid(row);
row[centroidX] = centroid[0];
row[centroidY] = centroid[1];
}
});
dataView.rows = dataView.rows.filter(function (row) { return row[lonField].length !== 0; });
}
registerTransform('geo.projection', transform);
/***/ }),
/***/ "./src/transform/geo/region.ts":
/*!*************************************!*\
!*** ./src/transform/geo/region.ts ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var registerTransform = data_set_1.DataSet.registerTransform;
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
// field: 'name', // required
// geoView: view, // required
// geoDataView: view, // alias
as: ['_x', '_y'],
};
function transform(view, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var field = option_parser_1.getField(options);
// @ts-ignore
var geoView = options.geoView || options.geoDataView; // alias
if (util_1.isString(geoView)) {
geoView = view.dataSet.getView(geoView);
}
if (!geoView || geoView.dataType !== 'geo') {
throw new TypeError('Invalid geoView: must be a DataView of GEO dataType!');
}
var as = options.as;
if (!util_1.isArray(as) || as.length !== 2) {
throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');
}
var lonField = as[0];
var latField = as[1];
view.rows.forEach(function (row) {
var feature = geoView.geoFeatureByName(row[field]);
if (feature) {
if (geoView._projectedAs) {
row[lonField] = feature[geoView._projectedAs[0]];
row[latField] = feature[geoView._projectedAs[1]];
}
else {
row[lonField] = feature.longitude;
row[latField] = feature.latitude;
}
}
});
}
registerTransform('geo.region', transform);
/***/ }),
/***/ "./src/transform/hierarchy/cluster.ts":
/*!********************************************!*\
!*** ./src/transform/hierarchy/cluster.ts ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var d3Hierarchy = tslib_1.__importStar(__webpack_require__(/*! d3-hierarchy */ "./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
field: 'value',
size: [1, 1],
nodeSize: null,
separation: null,
as: ['x', 'y'],
};
function transform(dataView, options) {
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY || !dataView.root) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
var root = dataView.root;
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var as = options.as;
if (!util_1.isArray(as) || as.length !== 2) {
throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');
}
var field = undefined;
try {
field = option_parser_1.getField(options);
}
catch (e) {
console.warn(e);
}
if (field) {
root.sum(function (d) { return d[field]; });
}
var clusterLayout = d3Hierarchy.cluster();
clusterLayout.size(options.size);
if (options.nodeSize) {
clusterLayout.nodeSize(options.nodeSize);
}
if (options.separation) {
clusterLayout.separation(options.separation);
}
clusterLayout(root);
var x = as[0];
var y = as[1];
root.each(function (node) {
node[x] = node.x;
node[y] = node.y;
});
}
data_set_1.DataSet.registerTransform('hierarchy.cluster', transform);
data_set_1.DataSet.registerTransform('dendrogram', transform);
/***/ }),
/***/ "./src/transform/hierarchy/compact-box.ts":
/*!************************************************!*\
!*** ./src/transform/hierarchy/compact-box.ts ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var hierarchy_1 = tslib_1.__importDefault(__webpack_require__(/*! @antv/hierarchy */ "./node_modules/_@antv_hierarchy@0.6.6@@antv/hierarchy/build/hierarchy.js"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {};
function transform(dataView, options) {
var root = dataView.root;
options = Object.assign({}, DEFAULT_OPTIONS, options);
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
dataView.root = hierarchy_1.default.compactBox(root, options);
}
data_set_1.DataSet.registerTransform('hierarchy.compact-box', transform);
data_set_1.DataSet.registerTransform('compact-box-tree', transform);
data_set_1.DataSet.registerTransform('non-layered-tidy-tree', transform);
data_set_1.DataSet.registerTransform('mindmap-logical', transform);
/***/ }),
/***/ "./src/transform/hierarchy/dendrogram.ts":
/*!***********************************************!*\
!*** ./src/transform/hierarchy/dendrogram.ts ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var hierarchy_1 = tslib_1.__importDefault(__webpack_require__(/*! @antv/hierarchy */ "./node_modules/_@antv_hierarchy@0.6.6@@antv/hierarchy/build/hierarchy.js"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {};
function transform(dataView, options) {
var root = dataView.root;
options = Object.assign({}, DEFAULT_OPTIONS, options);
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
dataView.root = hierarchy_1.default.dendrogram(root, options);
}
data_set_1.DataSet.registerTransform('hierarchy.dendrogram', transform);
data_set_1.DataSet.registerTransform('dendrogram', transform);
/***/ }),
/***/ "./src/transform/hierarchy/indented.ts":
/*!*********************************************!*\
!*** ./src/transform/hierarchy/indented.ts ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var hierarchy_1 = tslib_1.__importDefault(__webpack_require__(/*! @antv/hierarchy */ "./node_modules/_@antv_hierarchy@0.6.6@@antv/hierarchy/build/hierarchy.js"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {};
function transform(dataView, options) {
var root = dataView.root;
options = Object.assign({}, DEFAULT_OPTIONS, options);
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
dataView.root = hierarchy_1.default.indented(root, options);
}
data_set_1.DataSet.registerTransform('hierarchy.indented', transform);
data_set_1.DataSet.registerTransform('indented-tree', transform);
/***/ }),
/***/ "./src/transform/hierarchy/pack.ts":
/*!*****************************************!*\
!*** ./src/transform/hierarchy/pack.ts ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3Hierarchy = tslib_1.__importStar(__webpack_require__(/*! d3-hierarchy */ "./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
field: 'value',
size: [1, 1],
padding: 0,
as: ['x', 'y', 'r'],
};
function transform(dataView, options) {
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
var root = dataView.root;
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var as = options.as;
if (!util_1.isArray(as) || as.length !== 3) {
throw new TypeError('Invalid as: it must be an array with 3 strings (e.g. [ "x", "y", "r" ])!');
}
var field;
try {
field = option_parser_1.getField(options);
}
catch (e) {
console.warn(e);
}
if (field) {
root.sum(function (d) { return d[field]; }).sort(function (a, b) { return b[field] - a[field]; });
}
var packLayout = d3Hierarchy.pack();
packLayout.size(options.size);
if (options.padding) {
packLayout.padding(options.padding);
}
packLayout(root);
var x = as[0];
var y = as[1];
var r = as[2];
root.each(function (node) {
node[x] = node.x;
node[y] = node.y;
node[r] = node.r;
});
}
data_set_1.DataSet.registerTransform('hierarchy.pack', transform);
data_set_1.DataSet.registerTransform('hierarchy.circle-packing', transform);
data_set_1.DataSet.registerTransform('circle-packing', transform);
/***/ }),
/***/ "./src/transform/hierarchy/partition.ts":
/*!**********************************************!*\
!*** ./src/transform/hierarchy/partition.ts ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var d3Hierarchy = tslib_1.__importStar(__webpack_require__(/*! d3-hierarchy */ "./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
field: 'value',
size: [1, 1],
round: false,
// ratio: 1.618033988749895, // golden ratio
padding: 0,
sort: true,
as: ['x', 'y'],
};
function transform(dataView, options) {
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
var root = dataView.root;
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var as = options.as;
if (!util_1.isArray(as) || as.length !== 2) {
throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');
}
var field;
try {
field = option_parser_1.getField(options);
}
catch (e) {
console.warn(e);
}
if (field) {
root.sum(function (d) { return d[field]; });
}
var partitionLayout = d3Hierarchy.partition();
partitionLayout
.size(options.size)
.round(options.round)
.padding(options.padding);
partitionLayout(root);
/*
* points:
* 3 2
* 0 1
*/
var x = as[0];
var y = as[1];
root.each(function (node) {
node[x] = [node.x0, node.x1, node.x1, node.x0];
node[y] = [node.y1, node.y1, node.y0, node.y0];
['x0', 'x1', 'y0', 'y1'].forEach(function (prop) {
if (as.indexOf(prop) === -1) {
delete node[prop];
}
});
});
}
data_set_1.DataSet.registerTransform('hierarchy.partition', transform);
data_set_1.DataSet.registerTransform('adjacency', transform);
/***/ }),
/***/ "./src/transform/hierarchy/tree.ts":
/*!*****************************************!*\
!*** ./src/transform/hierarchy/tree.ts ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var d3Hierarchy = tslib_1.__importStar(__webpack_require__(/*! d3-hierarchy */ "./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
field: 'value',
size: [1, 1],
nodeSize: null,
separation: null,
as: ['x', 'y'],
};
function transform(dataView, options) {
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
var root = dataView.root;
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var as = options.as;
if (!util_1.isArray(as) || as.length !== 2) {
throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');
}
var field;
try {
field = option_parser_1.getField(options);
}
catch (e) {
console.warn(e);
}
if (field) {
root.sum(function (d) { return d[field]; });
}
var treeLayout = d3Hierarchy.tree();
treeLayout.size(options.size);
if (options.nodeSize) {
treeLayout.nodeSize(options.nodeSize);
}
if (options.separation) {
treeLayout.separation(options.separation);
}
treeLayout(root);
var x = as[0];
var y = as[1];
root.each(function (node) {
node[x] = node.x;
node[y] = node.y;
});
}
data_set_1.DataSet.registerTransform('hierarchy.tree', transform);
data_set_1.DataSet.registerTransform('tree', transform);
/***/ }),
/***/ "./src/transform/hierarchy/treemap.ts":
/*!********************************************!*\
!*** ./src/transform/hierarchy/treemap.ts ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var d3Hierarchy = tslib_1.__importStar(__webpack_require__(/*! d3-hierarchy */ "./node_modules/_d3-hierarchy@1.1.9@d3-hierarchy/dist/d3-hierarchy.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
field: 'value',
tile: 'treemapSquarify',
size: [1, 1],
round: false,
// ratio: 1.618033988749895, // golden ratio
padding: 0,
paddingInner: 0,
paddingOuter: 0,
paddingTop: 0,
paddingRight: 0,
paddingBottom: 0,
paddingLeft: 0,
as: ['x', 'y'],
};
function transform(dataView, options) {
if (dataView.dataType !== data_set_1.DataSet.CONSTANTS.HIERARCHY) {
throw new TypeError('Invalid DataView: This transform is for Hierarchy data only!');
}
var root = dataView.root;
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var as = options.as;
if (!util_1.isArray(as) || as.length !== 2) {
throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');
}
var field;
try {
field = option_parser_1.getField(options);
}
catch (e) {
console.warn(e);
}
if (field) {
root.sum(function (d) { return d[field]; });
}
var treemapLayout = d3Hierarchy.treemap();
treemapLayout
.tile(d3Hierarchy[options.tile])
.size(options.size)
.round(options.round)
.padding(options.padding)
.paddingInner(options.paddingInner)
.paddingOuter(options.paddingOuter)
.paddingTop(options.paddingTop)
.paddingRight(options.paddingRight)
.paddingBottom(options.paddingBottom)
.paddingLeft(options.paddingLeft);
treemapLayout(root);
/*
* points:
* 3 2
* 0 1
*/
var x = as[0];
var y = as[1];
root.each(function (node) {
node[x] = [node.x0, node.x1, node.x1, node.x0];
node[y] = [node.y1, node.y1, node.y0, node.y0];
['x0', 'x1', 'y0', 'y1'].forEach(function (prop) {
if (as.indexOf(prop) === -1) {
delete node[prop];
}
});
});
}
data_set_1.DataSet.registerTransform('hierarchy.treemap', transform);
data_set_1.DataSet.registerTransform('treemap', transform);
/***/ }),
/***/ "./src/transform/impute.ts":
/*!*********************************!*\
!*** ./src/transform/impute.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var simpleStatistics = tslib_1.__importStar(__webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js"));
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
// field: '', // required
// method: 'value', // required
// value: 10, // required if (method === 'value')
groupBy: [],
};
function notUndefinedValues(values) {
return values.filter(function (value) { return !util_1.isUndefined(value); });
}
var STATISTICS_METHODS = ['mean', 'median', 'max', 'min'];
var imputations = {};
STATISTICS_METHODS.forEach(function (method) {
// @ts-ignore
imputations[method] = function (row, values) { return simpleStatistics[method](values); };
});
imputations.value = function (_row, _values, value) { return value; };
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var field = option_parser_1.getField(options);
var method = options.method;
if (!method) {
throw new TypeError('Invalid method!');
}
if (method === 'value' && !util_1.has(options, 'value')) {
throw new TypeError('Invalid value: it is nil.');
}
var column = notUndefinedValues(dataView.getColumn(field));
var groups = partition_1.default(dataView.rows, options.groupBy);
util_1.forIn(groups, function (group) {
var fieldValues = notUndefinedValues(group.map(function (row) { return row[field]; }));
if (fieldValues.length === 0) {
fieldValues = column;
}
group.forEach(function (row) {
if (util_1.isUndefined(row[field])) {
if (util_1.isFunction(method)) {
row[field] = method(row, fieldValues, options.value, group);
}
else if (util_1.isString(method)) {
row[field] = imputations[method](row, fieldValues, options.value);
}
else {
throw new TypeError("Invalid method: must be a function or one of " + STATISTICS_METHODS.join(', '));
}
}
});
});
}
data_set_1.DataSet.registerTransform('impute', transform);
/***/ }),
/***/ "./src/transform/kde.ts":
/*!******************************!*\
!*** ./src/transform/kde.ts ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
/*
* kernel density estimation
*/
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var get_series_values_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/get-series-values */ "./src/util/get-series-values.ts"));
var kernel_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/kernel */ "./src/util/kernel.ts"));
var bandwidth = tslib_1.__importStar(__webpack_require__(/*! ../util/bandwidth */ "./src/util/bandwidth.ts"));
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var simple_statistics_1 = __webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js");
var DEFAULT_OPTIONS = {
minSize: 0.01,
as: ['key', 'y', 'size'],
// fields: [ 'y1', 'y2' ], // required, one or more fields
extent: [],
method: 'gaussian',
bandwidth: 'nrd',
step: 0,
groupBy: [],
};
var KERNEL_METHODS = util_1.keys(kernel_1.default);
var BANDWIDTH_METHODS = util_1.keys(bandwidth);
function transform(dv, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
if (!util_1.isArray(fields) || fields.length < 1) {
throw new TypeError('invalid fields: must be an array of at least 1 strings!');
}
var as = options.as;
if (!util_1.isArray(as) || as.length !== 3) {
throw new TypeError('invalid as: must be an array of 3 strings!');
}
var method = options.method;
if (util_1.isString(method)) {
if (KERNEL_METHODS.indexOf(method) === -1) {
throw new TypeError("invalid method: " + method + ". Must be one of " + KERNEL_METHODS.join(', '));
}
method = kernel_1.default[method];
}
if (!util_1.isFunction(method)) {
throw new TypeError('invalid method: kernel method must be a function!');
}
var extent = options.extent;
if (!util_1.isArray(extent) || extent.length === 0) {
var rangeArr_1 = [];
util_1.each(fields, function (field) {
var range = dv.range(field);
rangeArr_1 = rangeArr_1.concat(range);
});
extent = [Math.min.apply(Math, tslib_1.__spread(rangeArr_1)), Math.max.apply(Math, tslib_1.__spread(rangeArr_1))];
}
var bw = options.bandwidth;
if (util_1.isString(bw) && bandwidth[bw]) {
bw = bandwidth[bw](dv.getColumn(fields[0]));
}
else if (util_1.isFunction(bw)) {
bw = bw(dv.getColumn(fields[0]));
}
else if (!util_1.isNumber(bw) || bw <= 0) {
bw = bandwidth.nrd(dv.getColumn(fields[0]));
}
var seriesValues = get_series_values_1.default(extent, options.step ? options.step : bw);
var result = [];
var groupBy = options.groupBy;
var groups = partition_1.default(dv.rows, groupBy);
util_1.forIn(groups, function (group) {
var probalityDensityFunctionByField = {};
util_1.each(fields, function (field) {
var row = util_1.pick(group[0], groupBy);
probalityDensityFunctionByField[field] = simple_statistics_1.kernelDensityEstimation(group.map(function (item) { return item[field]; }), method, bw);
var _a = tslib_1.__read(as, 3), key = _a[0], y = _a[1], size = _a[2];
row[key] = field;
row[y] = [];
row[size] = [];
util_1.each(seriesValues, function (yValue) {
var sizeValue = probalityDensityFunctionByField[field](yValue);
if (sizeValue >= options.minSize) {
row[y].push(yValue);
row[size].push(sizeValue);
}
});
result.push(row);
});
});
dv.rows = result;
}
data_set_1.DataSet.registerTransform('kernel-density-estimation', transform);
data_set_1.DataSet.registerTransform('kde', transform);
data_set_1.DataSet.registerTransform('KDE', transform);
exports.default = {
KERNEL_METHODS: KERNEL_METHODS,
BANDWIDTH_METHODS: BANDWIDTH_METHODS,
};
/***/ }),
/***/ "./src/transform/kernel-smooth/density.ts":
/*!************************************************!*\
!*** ./src/transform/kernel-smooth/density.ts ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
/*
* @reference: https://github.com/Planeshifter/kernel-smooth/blob/master/lib/index.js
*/
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var get_series_values_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/get-series-values */ "./src/util/get-series-values.ts"));
var kernel_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/kernel */ "./src/util/kernel.ts"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var bandwidth_1 = __webpack_require__(/*! ../../util/bandwidth */ "./src/util/bandwidth.ts");
var DEFAULT_OPTIONS = {
as: ['x', 'y', 'z'],
// fields: [ 'x', 'y' ], // required, one or two fields
method: 'gaussian',
};
var KERNEL_METHODS = util_1.keys(kernel_1.default);
function transform(dv, options) {
var _a, _b;
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
if (!util_1.isArray(fields) || fields.length !== 2) {
throw new TypeError('invalid fields: must be an array of 2 strings!');
}
var _c = tslib_1.__read(options.as, 3), asX = _c[0], asY = _c[1], asZ = _c[2];
if (!util_1.isString(asX) || !util_1.isString(asY) || !util_1.isString(asZ)) {
throw new TypeError('invalid as: must be an array of 3 strings!');
}
var method;
if (util_1.isString(options.method)) {
if (KERNEL_METHODS.indexOf(options.method) === -1) {
throw new TypeError("invalid method: " + options.method + ". Must be one of " + KERNEL_METHODS.join(', '));
}
method = kernel_1.default[options.method];
}
var _d = tslib_1.__read(fields, 2), xField = _d[0], yField = _d[1];
var extent = options.extent, bandwidth = options.bandwidth;
var extentX;
var extentY;
if (extent && Array.isArray(extent) && Array.isArray(extent[0]) && Array.isArray(extent[1])) {
_a = tslib_1.__read(extent, 2), extentX = _a[0], extentY = _a[1];
}
else {
extentX = dv.range(xField);
extentY = dv.range(yField);
}
var bwX, bwY;
if (bandwidth &&
Array.isArray(bandwidth) &&
bandwidth.slice(0, 2).every(util_1.isNumber) &&
bandwidth.slice(0, 2).every(function (item) { return item > 0; })) {
_b = tslib_1.__read(bandwidth, 2), bwX = _b[0], bwY = _b[1];
}
else {
bwX = bandwidth_1.silverman(dv.getColumn(xField));
bwY = bandwidth_1.silverman(dv.getColumn(yField));
}
var seriesValuesX = get_series_values_1.default(extentX, bwX);
var seriesValuesY = get_series_values_1.default(extentY, bwY);
var count = dv.rows.length;
var result = [];
for (var i = 0; i < seriesValuesX.length; i++) {
for (var j = 0; j < seriesValuesY.length; j++) {
var sum = 0;
var x = seriesValuesX[i];
var y = seriesValuesY[j];
for (var k = 0; k < count; k++) {
sum += method((x - dv.rows[k][xField]) / bwX) * method((y - dv.rows[k][yField]) / bwY);
}
var z = (1 / (count * bwX * bwY)) * sum;
var row = {};
row[asX] = x;
row[asY] = y;
row[asZ] = z;
result.push(row);
}
}
dv.rows = result;
}
data_set_1.DataSet.registerTransform('kernel-smooth.density', transform);
data_set_1.DataSet.registerTransform('kernel.density', transform);
exports.default = {
KERNEL_METHODS: KERNEL_METHODS,
};
/***/ }),
/***/ "./src/transform/kernel-smooth/regression.ts":
/*!***************************************************!*\
!*** ./src/transform/kernel-smooth/regression.ts ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
/*
* @reference: https://github.com/Planeshifter/kernel-smooth/blob/master/lib/index.js
*/
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var get_series_values_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/get-series-values */ "./src/util/get-series-values.ts"));
var kernel_1 = tslib_1.__importDefault(__webpack_require__(/*! ../../util/kernel */ "./src/util/kernel.ts"));
var data_set_1 = __webpack_require__(/*! ../../data-set */ "./src/data-set.ts");
var simple_statistics_1 = __webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js");
var option_parser_1 = __webpack_require__(/*! ../../util/option-parser */ "./src/util/option-parser.ts");
var bandwidth_1 = __webpack_require__(/*! ../../util/bandwidth */ "./src/util/bandwidth.ts");
var DEFAULT_OPTIONS = {
as: ['x', 'y'],
// fields: [ 'x', 'y' ], // required, one or two fields
method: 'gaussian',
};
var KERNEL_METHODS = util_1.keys(kernel_1.default);
// calculates weight for i-th obs
function weight(kernel, bandwidth, x_0, x_i) {
var arg = (x_i - x_0) / bandwidth;
return kernel(arg);
}
// calculates weight for i-th obs when p > 1
// function weight_vectors(kernel, bandwidth, x_0, x_i) {
// const arg = enclideanDistance(x_i, x_0) / bandwidth;
// return kernel(arg);
// }
function vectorize(fun) {
return function (x) {
if (!util_1.isArray(x)) {
return fun(x);
}
return x.map(function (x) {
return fun(x);
});
};
}
function transform(dv, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
if (!util_1.isArray(fields) || !(fields.length === 1 || fields.length === 2)) {
throw new TypeError('invalid fields: must be an array of 1 or 2 strings!');
}
var _a = tslib_1.__read(options.as, 2), asX = _a[0], asY = _a[1];
if (!util_1.isString(asX) || !util_1.isString(asY)) {
throw new TypeError('invalid as: must be an array of 2 strings!');
}
var func;
var method = options.method;
if (util_1.isString(method)) {
if (KERNEL_METHODS.indexOf(method) === -1) {
throw new TypeError("invalid method: " + method + ". Must be one of " + KERNEL_METHODS.join(', '));
}
func = kernel_1.default[method];
}
var _b = tslib_1.__read(fields, 2), xField = _b[0], yField = _b[1];
var xs = dv.getColumn(xField);
var extent = options.extent;
if (extent || !util_1.isArray(extent)) {
extent = dv.range(xField);
}
var bandwidth = options.bandwidth;
if (!bandwidth || !util_1.isNumber(bandwidth) || bandwidth <= 0) {
bandwidth = bandwidth_1.silverman(xs);
}
var seriesValues = get_series_values_1.default(extent, bandwidth);
var xCount = xs.length;
var weightFunc = weight.bind(null, func, bandwidth);
var kernelSmoother;
if (util_1.isNil(yField)) {
// KDE
kernelSmoother = vectorize(function (x) {
var weights = xs.map(function (x_i) { return weightFunc(x, x_i); });
var num = simple_statistics_1.sum(weights);
var denom = xCount * bandwidth;
if (!num || !denom)
return 0;
return num / denom;
});
}
else {
// kernel regression smoothing
var ys_1 = dv.getColumn(yField);
kernelSmoother = vectorize(function (x) {
var weights = xs.map(function (x_i) { return weightFunc(x, x_i); });
var num = simple_statistics_1.sum(weights.map(function (w, i) { return w * ys_1[i]; }));
var denom = simple_statistics_1.sum(weights);
if (!num || !denom)
return 0;
return num / denom;
});
}
var result = seriesValues.map(function (x) {
var row = {};
row[asX] = x;
row[asY] = kernelSmoother(x);
return row;
});
dv.rows = result;
}
data_set_1.DataSet.registerTransform('kernel-smooth.regression', transform);
data_set_1.DataSet.registerTransform('kernel.regression', transform);
exports.default = {
KERNEL_METHODS: KERNEL_METHODS,
};
/***/ }),
/***/ "./src/transform/map.ts":
/*!******************************!*\
!*** ./src/transform/map.ts ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
function defaultCallback(row) {
return row;
}
data_set_1.DataSet.registerTransform('map', function (dataView, options) {
dataView.rows = dataView.rows.map(options.callback || defaultCallback);
});
/***/ }),
/***/ "./src/transform/partition.ts":
/*!************************************!*\
!*** ./src/transform/partition.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var DEFAULT_OPTIONS = {
groupBy: [],
orderBy: [],
};
data_set_1.DataSet.registerTransform('partition', function (dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
// TODO: rows 是否都只能是数组
// @ts-ignore;
dataView.rows = partition_1.default(dataView.rows, options.groupBy, options.orderBy);
});
function group(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
dataView.rows = util_1.values(partition_1.default(dataView.rows, options.groupBy, options.orderBy));
}
data_set_1.DataSet.registerTransform('group', group);
data_set_1.DataSet.registerTransform('groups', group);
/***/ }),
/***/ "./src/transform/percent.ts":
/*!**********************************!*\
!*** ./src/transform/percent.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var simple_statistics_1 = __webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
// field: 'y', // required
// dimension: 'x', // required
groupBy: [],
as: '_percent',
};
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var field = option_parser_1.getField(options);
var dimension = options.dimension, groupBy = options.groupBy;
var as = options.as;
if (!util_1.isString(dimension)) {
throw new TypeError('Invalid dimension: must be a string!');
}
if (util_1.isArray(as)) {
console.warn('Invalid as: must be a string, will use the first element of the array specified.');
as = as[0];
}
if (!util_1.isString(as)) {
throw new TypeError('Invalid as: must be a string!');
}
var rows = dataView.rows;
var result = [];
var groups = partition_1.default(rows, groupBy);
util_1.forIn(groups, function (group) {
var totalSum = simple_statistics_1.sum(group.map(function (row) { return row[field]; }));
var innerGroups = partition_1.default(group, [dimension]);
util_1.forIn(innerGroups, function (innerGroup) {
var innerSum = simple_statistics_1.sum(innerGroup.map(function (row) { return row[field]; }));
// const resultRow = pick(innerGroup[0], union(groupBy, [ dimension ]));
var resultRow = innerGroup[0];
// FIXME in case dimension and field is the same
var dimensionValue = resultRow[dimension];
resultRow[field] = innerSum;
resultRow[dimension] = dimensionValue;
if (totalSum === 0) {
resultRow[as] = 0;
}
else {
resultRow[as] = innerSum / totalSum;
}
result.push(resultRow);
});
});
dataView.rows = result;
}
data_set_1.DataSet.registerTransform('percent', transform);
/***/ }),
/***/ "./src/transform/pick.ts":
/*!*******************************!*\
!*** ./src/transform/pick.ts ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
data_set_1.DataSet.registerTransform('pick', function (dataView, options) {
var columns = option_parser_1.getFields(options, dataView.getColumnNames());
dataView.rows = dataView.rows.map(function (row) { return util_1.pick(row, columns); });
});
/***/ }),
/***/ "./src/transform/proportion.ts":
/*!*************************************!*\
!*** ./src/transform/proportion.ts ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
// field: 'y', // required
// dimension: 'x', // required
groupBy: [],
as: '_proportion',
};
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var field = option_parser_1.getField(options);
var dimension = options.dimension;
var groupBy = options.groupBy;
var as = options.as;
if (!util_1.isString(dimension)) {
throw new TypeError('Invalid dimension: must be a string!');
}
if (util_1.isArray(as)) {
console.warn('Invalid as: must be a string, will use the first element of the array specified.');
as = as[0];
}
if (!util_1.isString(as)) {
throw new TypeError('Invalid as: must be a string!');
}
var rows = dataView.rows;
var result = [];
var groups = partition_1.default(rows, groupBy);
util_1.forIn(groups, function (group) {
var totalCount = group.length;
var innerGroups = partition_1.default(group, [dimension]);
util_1.forIn(innerGroups, function (innerGroup) {
var innerCount = innerGroup.length;
// const resultRow = pick(innerGroup[0], union(groupBy, [ dimension ]));
var resultRow = innerGroup[0];
// FIXME in case dimension and field is the same
var dimensionValue = resultRow[dimension];
resultRow[field] = innerCount;
resultRow[dimension] = dimensionValue;
resultRow[as] = innerCount / totalCount;
result.push(resultRow);
});
});
dataView.rows = result;
}
data_set_1.DataSet.registerTransform('proportion', transform);
/***/ }),
/***/ "./src/transform/regression.ts":
/*!*************************************!*\
!*** ./src/transform/regression.ts ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var regression_1 = tslib_1.__importDefault(__webpack_require__(/*! regression */ "./node_modules/_regression@2.0.1@regression/dist/regression.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var get_series_values_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/get-series-values */ "./src/util/get-series-values.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var bandwidth_1 = __webpack_require__(/*! ../util/bandwidth */ "./src/util/bandwidth.ts");
var DEFAULT_OPTIONS = {
as: ['x', 'y'],
// fields: [ 'x', 'y' ], // required two fields
method: 'linear',
// extent: [], // extent to execute regression function, default: [ min(x), max(x) ]
// bandwidth: 1, // bandWidth to execute regression function
order: 2,
precision: 2,
};
var REGRESSION_METHODS = ['linear', 'exponential', 'logarithmic', 'power', 'polynomial'];
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
if (!util_1.isArray(fields) || fields.length !== 2) {
throw new TypeError('invalid fields: must be an array of 2 strings.');
}
var _a = tslib_1.__read(fields, 2), xField = _a[0], yField = _a[1];
var method = options.method;
if (REGRESSION_METHODS.indexOf(method) === -1) {
throw new TypeError("invalid method: " + method + ". Must be one of " + REGRESSION_METHODS.join(', '));
}
var points = dataView.rows.map(function (row) { return [row[xField], row[yField]]; });
var regressionResult = regression_1.default[method](points, options);
var extent = options.extent;
if (!util_1.isArray(extent) || extent.length !== 2) {
extent = dataView.range(xField);
}
var bandwidth = options.bandwidth;
if (!util_1.isNumber(bandwidth) || bandwidth <= 0) {
bandwidth = bandwidth_1.silverman(dataView.getColumn(xField));
}
var valuesToPredict = get_series_values_1.default(extent, bandwidth);
var result = [];
var _b = tslib_1.__read(options.as, 2), asX = _b[0], asY = _b[1];
valuesToPredict.forEach(function (value) {
var row = {};
var _a = tslib_1.__read(regressionResult.predict(value), 2), x = _a[0], y = _a[1];
row[asX] = x;
row[asY] = y;
if (isFinite(y)) {
result.push(row);
}
});
dataView.rows = result;
}
data_set_1.DataSet.registerTransform('regression', transform);
exports.default = {
REGRESSION_METHODS: REGRESSION_METHODS,
};
/***/ }),
/***/ "./src/transform/rename.ts":
/*!*********************************!*\
!*** ./src/transform/rename.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
function transform(dataView, options) {
var map = options.map || {};
var cleanMap = {};
if (util_1.isPlainObject(map)) {
util_1.forIn(map, function (value, key) {
if (util_1.isString(value) && util_1.isString(key)) {
cleanMap[key] = value;
}
});
}
dataView.rows.forEach(function (row) {
util_1.forIn(cleanMap, function (newKey, key) {
var temp = row[key];
delete row[key];
row[newKey] = temp;
});
});
}
data_set_1.DataSet.registerTransform('rename', transform);
data_set_1.DataSet.registerTransform('rename-fields', transform);
/***/ }),
/***/ "./src/transform/reverse.ts":
/*!**********************************!*\
!*** ./src/transform/reverse.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
data_set_1.DataSet.registerTransform('reverse', function (dataView) {
dataView.rows.reverse();
});
/***/ }),
/***/ "./src/transform/sort-by.ts":
/*!**********************************!*\
!*** ./src/transform/sort-by.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
/*
* options: {
* type: 'sort-by',
* fields: [],
* order: 'ASC' // 'DESC'
* }
*/
var VALID_ORDERS = ['ASC', 'DESC'];
function transform(dataView, options) {
var fields = option_parser_1.getFields(options, [dataView.getColumnName(0)]);
if (!util_1.isArray(fields)) {
throw new TypeError('Invalid fields: must be an array with strings!');
}
dataView.rows = util_1.sortBy(dataView.rows, fields);
var order = options.order;
if (order && VALID_ORDERS.indexOf(order) === -1) {
throw new TypeError("Invalid order: " + order + " must be one of " + VALID_ORDERS.join(', '));
}
else if (order === 'DESC') {
dataView.rows.reverse();
}
}
data_set_1.DataSet.registerTransform('sort-by', transform);
data_set_1.DataSet.registerTransform('sortBy', transform);
/***/ }),
/***/ "./src/transform/sort.ts":
/*!*******************************!*\
!*** ./src/transform/sort.ts ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
data_set_1.DataSet.registerTransform('sort', function (dataView, options) {
var columnName = dataView.getColumnName(0);
dataView.rows.sort(options.callback || (function (a, b) { return a[columnName] - b[columnName]; }));
});
/***/ }),
/***/ "./src/transform/subset.ts":
/*!*********************************!*\
!*** ./src/transform/subset.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
data_set_1.DataSet.registerTransform('subset', function (dataView, options) {
var startIndex = options.startRowIndex || 0;
var endIndex = options.endRowIndex || dataView.rows.length - 1;
var columns = option_parser_1.getFields(options, dataView.getColumnNames());
dataView.rows = dataView.getSubset(startIndex, endIndex, columns);
});
/***/ }),
/***/ "./src/transform/tag-cloud.ts":
/*!************************************!*\
!*** ./src/transform/tag-cloud.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var tag_cloud_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/tag-cloud */ "./src/util/tag-cloud.ts"));
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
fields: ['text', 'value'],
font: function () { return 'serif'; },
padding: 1,
size: [500, 500],
spiral: 'archimedean',
// timeInterval: Infinity // max execute time
timeInterval: 500,
};
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var layout = tag_cloud_1.default();
['font', 'fontSize', 'fontWeight', 'padding', 'rotate', 'size', 'spiral', 'timeInterval'].forEach(function (key) {
// @ts-ignore
if (options[key]) {
// @ts-ignore
layout[key](options[key]);
}
});
var fields = option_parser_1.getFields(options);
var _a = tslib_1.__read(fields, 2), text = _a[0], value = _a[1];
if (!util_1.isString(text) || !util_1.isString(value)) {
throw new TypeError('Invalid fields: must be an array with 2 strings (e.g. [ "text", "value" ])!');
}
var words = dataView.rows.map(function (row) {
row.text = row[text];
row.value = row[value];
return row;
});
layout.words(words);
if (options.imageMask) {
layout.createMask(options.imageMask);
}
var result = layout.start();
var tags = result._tags;
var bounds = result._bounds || [
{ x: 0, y: 0 },
{ x: options.size[0], y: options.size[1] },
];
tags.forEach(function (tag) {
tag.x += options.size[0] / 2;
tag.y += options.size[1] / 2;
});
var _b = tslib_1.__read(options.size, 2), w = _b[0], h = _b[1];
var hasImage = result.hasImage;
tags.push({
text: '',
value: 0,
x: hasImage ? 0 : bounds[0].x,
y: hasImage ? 0 : bounds[0].y,
opacity: 0,
});
tags.push({
text: '',
value: 0,
x: hasImage ? w : bounds[1].x,
y: hasImage ? h : bounds[1].y,
opacity: 0,
});
dataView.rows = tags;
dataView._tagCloud = result;
}
data_set_1.DataSet.registerTransform('tag-cloud', transform);
data_set_1.DataSet.registerTransform('word-cloud', transform);
/***/ }),
/***/ "./src/transform/waffle.ts":
/*!*********************************!*\
!*** ./src/transform/waffle.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var simple_statistics_1 = __webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js");
var partition_1 = tslib_1.__importDefault(__webpack_require__(/*! ../util/partition */ "./src/util/partition.ts"));
var data_set_1 = __webpack_require__(/*! ../data-set */ "./src/data-set.ts");
var option_parser_1 = __webpack_require__(/*! ../util/option-parser */ "./src/util/option-parser.ts");
var DEFAULT_OPTIONS = {
fields: ['name', 'value'],
rows: 5,
size: [1, 1],
scale: 1,
groupBy: [],
maxCount: 1000,
gapRatio: 0.1,
as: ['x', 'y'],
};
function transform(dataView, options) {
options = util_1.assign({}, DEFAULT_OPTIONS, options);
var fields = option_parser_1.getFields(options);
var _a = tslib_1.__read(fields, 2), nameField = _a[0], valueField = _a[1];
var _b = tslib_1.__read(options.as, 2), asX = _b[0], asY = _b[1];
var groupBy = options.groupBy;
var groups = partition_1.default(dataView.rows, groupBy);
var groupKeys = util_1.keys(groups);
var _c = tslib_1.__read(options.size, 2), width = _c[0], height = _c[1];
var maxCount = options.maxCount;
var groupCount = groupKeys.length;
var partHeight = height / groupCount;
var rows = options.rows;
var gapRatio = options.gapRatio;
var result = [];
var scale = options.scale;
var currentGroupIndex = 0;
var wStep = 0;
// getting suitable scale and width step
util_1.forIn(groups, function (group) {
var totalValue = simple_statistics_1.sum(util_1.map(group, function (row) { return row[valueField]; }));
var cols = Math.ceil((totalValue * scale) / rows);
if (totalValue * scale > maxCount) {
scale = maxCount / totalValue;
cols = Math.ceil((totalValue * scale) / rows);
}
wStep = width / cols;
});
// distributing values into grid
util_1.forIn(groups, function (group) {
var heightRange = [currentGroupIndex * partHeight, (currentGroupIndex + 1) * partHeight];
var h = heightRange[1] - heightRange[0];
var hStep = (h * (1 - gapRatio)) / rows;
var currentCol = 0;
var currentRow = 0;
util_1.each(group, function (row) {
var value = row[valueField];
var count = Math.round(value * scale);
for (var i = 0; i < count; i++) {
if (currentRow === rows) {
currentRow = 0;
currentCol++;
}
var resultRow = util_1.pick(row, [nameField, valueField].concat(groupBy));
resultRow[asX] = currentCol * wStep + wStep / 2;
resultRow[asY] = currentRow * hStep + hStep / 2 + heightRange[0];
resultRow._wStep = wStep;
resultRow._hStep = hStep;
currentRow++;
result.push(resultRow);
}
});
currentGroupIndex += 1;
});
dataView.rows = result;
}
data_set_1.DataSet.registerTransform('waffle', transform);
/***/ }),
/***/ "./src/util/bandwidth.ts":
/*!*******************************!*\
!*** ./src/util/bandwidth.ts ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.nrd = exports.silverman = void 0;
var simple_statistics_1 = __webpack_require__(/*! simple-statistics */ "./node_modules/_simple-statistics@6.1.1@simple-statistics/dist/simple-statistics.min.js");
function silverman(arr) {
var stdev = simple_statistics_1.standardDeviation(arr);
var num = 4 * Math.pow(stdev, 5);
var denom = 3 * arr.length;
return Math.pow(num / denom, 0.2);
}
exports.silverman = silverman;
function nrd(arr) {
var s = simple_statistics_1.standardDeviation(arr);
var iqr = simple_statistics_1.interquartileRange(arr);
if (typeof iqr === 'number') {
s = Math.min(s, iqr / 1.34);
}
return 1.06 * s * Math.pow(arr.length, -0.2);
}
exports.nrd = nrd;
/***/ }),
/***/ "./src/util/get-geo-projection.ts":
/*!****************************************!*\
!*** ./src/util/get-geo-projection.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var d3Geo = tslib_1.__importStar(__webpack_require__(/*! d3-geo */ "./node_modules/_d3-geo@1.6.4@d3-geo/build/d3-geo.js"));
var d3GeoProjection = tslib_1.__importStar(__webpack_require__(/*! d3-geo-projection */ "./node_modules/_d3-geo-projection@2.1.2@d3-geo-projection/build/d3-geo-projection.js"));
var d3CompositeProjection = tslib_1.__importStar(__webpack_require__(/*! d3-composite-projections */ "./node_modules/_d3-composite-projections@1.3.2@d3-composite-projections/d3-composite-projections.js"));
/*
* getGeoProjection
*
* @param {string|function} projection projection name or projection function
* @param {boolean} [exportRaw = false] - whether return the raw projection or not
* */
exports.default = (function (projection, exportRaw) {
if (exportRaw === void 0) { exportRaw = false; }
if (util_1.isFunction(projection)) {
return exportRaw ? projection : projection();
}
if (util_1.isString(projection)) {
// @ts-ignore
if (d3Geo[projection]) {
// @ts-ignore
return exportRaw ? d3Geo[projection] : d3Geo[projection]();
}
if (d3GeoProjection[projection]) {
return exportRaw ? d3GeoProjection[projection] : d3GeoProjection[projection]();
}
if (d3CompositeProjection[projection]) {
return exportRaw ? d3CompositeProjection[projection] : d3CompositeProjection[projection]();
}
}
return null;
});
/***/ }),
/***/ "./src/util/get-series-values.ts":
/*!***************************************!*\
!*** ./src/util/get-series-values.ts ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
exports.default = (function (extent, bw) {
var bandwidth = bw || 1;
var _a = tslib_1.__read(extent, 2), min = _a[0], max = _a[1];
var values = [];
var tmp = min;
while (tmp < max) {
values.push(tmp);
tmp += bandwidth;
}
values.push(max);
return values;
});
/***/ }),
/***/ "./src/util/kernel.ts":
/*!****************************!*\
!*** ./src/util/kernel.ts ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @reference: https://github.com/jasondavies/science.js/blob/master/src/stats/kernel.js
* @reference: https://github.com/Planeshifter/kernel-smooth/blob/master/lib/index.js#L16
*/
function uniform(u) {
return Math.abs(u) <= 1 ? 0.5 : 0;
}
function tricubed(u) {
var abs = 1 - Math.pow(Math.abs(u), 3);
return Math.pow(abs, 3);
}
exports.default = {
boxcar: uniform,
cosine: function (u) {
if (Math.abs(u) <= 1) {
return (Math.PI / 4) * Math.cos((Math.PI / 2) * u);
}
return 0;
},
epanechnikov: function (u) {
return Math.abs(u) < 1 ? 0.75 * (1 - u * u) : 0;
},
gaussian: function (u) {
// return 1 / Math.sqrt(2 * Math.PI) * Math.exp(-0.5 * u * u);
return 0.3989422804 * Math.exp(-0.5 * u * u);
},
quartic: function (u) {
if (Math.abs(u) < 1) {
var tmp = 1 - u * u;
return (15 / 16) * tmp * tmp;
}
return 0;
},
triangular: function (u) {
var abs = Math.abs(u);
return abs < 1 ? 1 - abs : 0;
},
tricube: function (u) {
return Math.abs(u) < 1 ? (70 / 81) * tricubed(u) : 0;
},
triweight: function (u) {
if (Math.abs(u) < 1) {
var tmp = 1 - u * u;
return (35 / 32) * tmp * tmp * tmp;
}
return 0;
},
uniform: uniform,
};
/***/ }),
/***/ "./src/util/option-parser.ts":
/*!***********************************!*\
!*** ./src/util/option-parser.ts ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFields = exports.getField = void 0;
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var INVALID_FIELD_ERR_MSG = 'Invalid field: it must be a string!';
var INVALID_FIELDS_ERR_MSG = 'Invalid fields: it must be an array!';
function getField(options, defaultField) {
var field = options.field, fields = options.fields;
if (util_1.isString(field)) {
return field;
}
if (util_1.isArray(field)) {
console.warn(INVALID_FIELD_ERR_MSG);
return field[0];
}
console.warn(INVALID_FIELD_ERR_MSG + " will try to get fields instead.");
if (util_1.isString(fields)) {
return fields;
}
if (util_1.isArray(fields) && fields.length) {
return fields[0];
}
if (defaultField) {
return defaultField;
}
throw new TypeError(INVALID_FIELD_ERR_MSG);
}
exports.getField = getField;
function getFields(options, defaultFields) {
var field = options.field, fields = options.fields;
if (util_1.isArray(fields)) {
return fields;
}
if (util_1.isString(fields)) {
console.warn(INVALID_FIELDS_ERR_MSG);
return [fields];
}
console.warn(INVALID_FIELDS_ERR_MSG + " will try to get field instead.");
if (util_1.isString(field)) {
console.warn(INVALID_FIELDS_ERR_MSG);
return [field];
}
if (util_1.isArray(field) && field.length) {
console.warn(INVALID_FIELDS_ERR_MSG);
return field;
}
if (defaultFields) {
return defaultFields;
}
throw new TypeError(INVALID_FIELDS_ERR_MSG);
}
exports.getFields = getFields;
/***/ }),
/***/ "./src/util/p-by-fraction.ts":
/*!***********************************!*\
!*** ./src/util/p-by-fraction.ts ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (function (fraction) {
var step = 1 / fraction;
var pArr = [];
for (var i = 0; i <= 1; i = i + step) {
pArr.push(i);
}
return pArr;
});
/***/ }),
/***/ "./src/util/partition.ts":
/*!*******************************!*\
!*** ./src/util/partition.ts ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
var simple_sort_by_1 = tslib_1.__importDefault(__webpack_require__(/*! ./simple-sort-by */ "./src/util/simple-sort-by.ts"));
exports.default = (function (rows, group_by, order_by) {
if (order_by === void 0) { order_by = []; }
var newRows = rows;
if (order_by && order_by.length) {
newRows = simple_sort_by_1.default(rows, order_by);
}
var groupingFn;
if (util_1.isFunction(group_by)) {
groupingFn = group_by;
}
else if (util_1.isArray(group_by)) {
groupingFn = function (row) { return "_" + group_by.map(function (col) { return row[col]; }).join('-'); };
// NOTE: Object.keys({'b': 'b', '2': '2', '1': '1', 'a': 'a'}) => [ '1', '2', 'b', 'a' ]
// that is why we have to add a prefix
}
else if (util_1.isString(group_by)) {
groupingFn = function (row) { return "_" + row[group_by]; };
}
var groups = util_1.groupBy(newRows, groupingFn);
return groups;
});
/***/ }),
/***/ "./src/util/simple-sort-by.ts":
/*!************************************!*\
!*** ./src/util/simple-sort-by.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
function sortBy(arr, keys) {
if (keys === void 0) { keys = []; }
var comparer = undefined;
if (util_1.isFunction(keys)) {
comparer = keys;
}
else if (util_1.isArray(keys)) {
comparer = function (a, b) {
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (a[key] < b[key]) {
return -1;
}
if (a[key] > b[key]) {
return 1;
}
}
return 0;
};
}
else if (util_1.isString(keys)) {
comparer = function (a, b) {
if (a[keys] < b[keys]) {
return -1;
}
if (a[keys] > b[keys]) {
return 1;
}
return 0;
};
}
return arr.sort(comparer);
}
exports.default = sortBy;
/***/ }),
/***/ "./src/util/tag-cloud.ts":
/*!*******************************!*\
!*** ./src/util/tag-cloud.ts ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
* Synchronous version of d3-cloud
*/
// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf
/* eslint-disable no-return-assign, no-cond-assign */
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var cloudRadians = Math.PI / 180, cw = (1 << 11) >> 5, ch = 1 << 11;
function cloudText(d) {
return d.text;
}
function cloudFont() {
return 'serif';
}
function cloudFontNormal() {
return 'normal';
}
function cloudFontSize(d) {
return d.value;
}
function cloudRotate() {
return ~~(Math.random() * 2) * 90;
}
function cloudPadding() {
return 1;
}
// Fetches a monochrome sprite bitmap for the specified text.
// Load in batches for speed.
function cloudSprite(contextAndRatio, d, data, di) {
if (d.sprite)
return;
var c = contextAndRatio.context, ratio = contextAndRatio.ratio;
c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);
var x = 0, y = 0, maxh = 0;
var n = data.length;
--di;
while (++di < n) {
d = data[di];
c.save();
c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;
var w = c.measureText(d.text + 'm').width * ratio, h = d.size << 1;
if (d.rotate) {
var sr = Math.sin(d.rotate * cloudRadians), cr = Math.cos(d.rotate * cloudRadians), wcr = w * cr, wsr = w * sr, hcr = h * cr, hsr = h * sr;
w = ((Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5) << 5;
h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));
}
else {
w = ((w + 0x1f) >> 5) << 5;
}
if (h > maxh)
maxh = h;
if (x + w >= cw << 5) {
x = 0;
y += maxh;
maxh = 0;
}
if (y + h >= ch)
break;
c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);
if (d.rotate)
c.rotate(d.rotate * cloudRadians);
c.fillText(d.text, 0, 0);
if (d.padding) {
c.lineWidth = 2 * d.padding;
c.strokeText(d.text, 0, 0);
}
c.restore();
d.width = w;
d.height = h;
d.xoff = x;
d.yoff = y;
d.x1 = w >> 1;
d.y1 = h >> 1;
d.x0 = -d.x1;
d.y0 = -d.y1;
d.hasText = true;
x += w;
}
var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data, sprite = [];
while (--di >= 0) {
d = data[di];
if (!d.hasText)
continue;
var w = d.width, w32 = w >> 5;
var h = d.y1 - d.y0;
// Zero the buffer
for (var i = 0; i < h * w32; i++)
sprite[i] = 0;
x = d.xoff;
if (x == null)
return;
y = d.yoff;
var seen = 0, seenRow = -1;
for (var j = 0; j < h; j++) {
for (var i = 0; i < w; i++) {
var k = w32 * j + (i >> 5), m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;
sprite[k] |= m;
seen |= m;
}
if (seen)
seenRow = j;
else {
d.y0++;
h--;
j--;
y++;
}
}
d.y1 = d.y0 + seenRow;
d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);
}
}
// Use mask-based collision detection.
function cloudCollide(tag, board, sw) {
sw >>= 5;
var sprite = tag.sprite, w = tag.width >> 5, lx = tag.x - (w << 4), sx = lx & 0x7f, msx = 32 - sx, h = tag.y1 - tag.y0;
var x = (tag.y + tag.y0) * sw + (lx >> 5), last;
for (var j = 0; j < h; j++) {
last = 0;
for (var i = 0; i <= w; i++) {
if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i])
return true;
}
x += sw;
}
return false;
}
function cloudBounds(bounds, d) {
var b0 = bounds[0], b1 = bounds[1];
if (d.x + d.x0 < b0.x)
b0.x = d.x + d.x0;
if (d.y + d.y0 < b0.y)
b0.y = d.y + d.y0;
if (d.x + d.x1 > b1.x)
b1.x = d.x + d.x1;
if (d.y + d.y1 > b1.y)
b1.y = d.y + d.y1;
}
function collideRects(a, b) {
return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;
}
function archimedeanSpiral(size) {
var e = size[0] / size[1];
return function (t) {
return [e * (t *= 0.1) * Math.cos(t), t * Math.sin(t)];
};
}
function rectangularSpiral(size) {
var dy = 4, dx = (dy * size[0]) / size[1];
var x = 0, y = 0;
return function (t) {
var sign = t < 0 ? -1 : 1;
// See triangular numbers: T_n = n * (n + 1) / 2.
switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {
case 0:
x += dx;
break;
case 1:
y += dy;
break;
case 2:
x -= dx;
break;
default:
y -= dy;
break;
}
return [x, y];
};
}
// TODO reuse arrays?
function zeroArray(n) {
var a = [];
var i = -1;
while (++i < n)
a[i] = 0;
return a;
}
function cloudCanvas() {
return document.createElement('canvas');
}
function functor(d) {
return typeof d === 'function'
? d
: function () {
return d;
};
}
var spirals = {
archimedean: archimedeanSpiral,
rectangular: rectangularSpiral,
};
function default_1() {
var size = [256, 256], text = cloudText, font = cloudFont, fontSize = cloudFontSize, fontStyle = cloudFontNormal, fontWeight = cloudFontNormal, rotate = cloudRotate, padding = cloudPadding, spiral = archimedeanSpiral, words = [], timeInterval = Infinity, random = Math.random, canvas = cloudCanvas;
var cloud = {};
cloud.canvas = function (_) {
return arguments.length ? ((canvas = functor(_)), cloud) : canvas;
};
cloud.start = function () {
var _a = tslib_1.__read(size, 2), width = _a[0], height = _a[1];
var contextAndRatio = getContext(canvas()), board = cloud.board ? cloud.board : zeroArray((size[0] >> 5) * size[1]), n = words.length, tags = [], data = words
.map(function (d, i) {
d.text = text.call(this, d, i);
d.font = font.call(this, d, i);
d.style = fontStyle.call(this, d, i);
d.weight = fontWeight.call(this, d, i);
d.rotate = rotate.call(this, d, i);
d.size = ~~fontSize.call(this, d, i);
d.padding = padding.call(this, d, i);
return d;
})
.sort(function (a, b) {
return b.size - a.size;
});
var i = -1, bounds = !cloud.board
? null
: [
{
x: 0,
y: 0,
},
{
x: width,
y: height,
},
];
step();
function step() {
var start = Date.now();
while (Date.now() - start < timeInterval && ++i < n) {
var d = data[i];
d.x = (width * (random() + 0.5)) >> 1;
d.y = (height * (random() + 0.5)) >> 1;
cloudSprite(contextAndRatio, d, data, i);
if (d.hasText && place(board, d, bounds)) {
tags.push(d);
if (bounds) {
if (!cloud.hasImage) {
// update bounds if image mask not set
cloudBounds(bounds, d);
}
}
else {
bounds = [
{ x: d.x + d.x0, y: d.y + d.y0 },
{ x: d.x + d.x1, y: d.y + d.y1 },
];
}
// Temporary hack
d.x -= size[0] >> 1;
d.y -= size[1] >> 1;
}
}
cloud._tags = tags;
cloud._bounds = bounds;
}
return cloud;
};
function getContext(canvas) {
canvas.width = canvas.height = 1;
var ratio = Math.sqrt(canvas.getContext('2d').getImageData(0, 0, 1, 1).data.length >> 2);
canvas.width = (cw << 5) / ratio;
canvas.height = ch / ratio;
var context = canvas.getContext('2d');
context.fillStyle = context.strokeStyle = 'red';
context.textAlign = 'center';
return { context: context, ratio: ratio };
}
function place(board, tag, bounds) {
// const perimeter = [{ x: 0, y: 0 }, { x: size[0], y: size[1] }],
var startX = tag.x, startY = tag.y, maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]), s = spiral(size), dt = random() < 0.5 ? 1 : -1;
var dxdy, t = -dt, dx, dy;
while ((dxdy = s((t += dt)))) {
dx = ~~dxdy[0];
dy = ~~dxdy[1];
if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta)
break;
tag.x = startX + dx;
tag.y = startY + dy;
if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1])
continue;
// TODO only check for collisions within current bounds.
if (!bounds || !cloudCollide(tag, board, size[0])) {
if (!bounds || collideRects(tag, bounds)) {
var sprite = tag.sprite, w = tag.width >> 5, sw = size[0] >> 5, lx = tag.x - (w << 4), sx = lx & 0x7f, msx = 32 - sx, h = tag.y1 - tag.y0;
var last = void 0, x = (tag.y + tag.y0) * sw + (lx >> 5);
for (var j = 0; j < h; j++) {
last = 0;
for (var i = 0; i <= w; i++) {
board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);
}
x += sw;
}
delete tag.sprite;
return true;
}
}
}
return false;
}
cloud.createMask = function (img) {
var can = document.createElement('canvas');
var _a = tslib_1.__read(size, 2), width = _a[0], height = _a[1];
// 当 width 或 height 为 0 时,调用 cxt.getImageData 会报错
if (!width || !height) {
return;
}
var w32 = width >> 5;
var board = zeroArray((width >> 5) * height);
can.width = width;
can.height = height;
var cxt = can.getContext('2d');
cxt.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);
var imageData = cxt.getImageData(0, 0, width, height).data;
for (var j = 0; j < height; j++) {
for (var i = 0; i < width; i++) {
var k = w32 * j + (i >> 5);
var tmp = (j * width + i) << 2;
var flag = imageData[tmp] >= 250 && imageData[tmp + 1] >= 250 && imageData[tmp + 2] >= 250;
var m = flag ? 1 << (31 - (i % 32)) : 0;
board[k] |= m;
}
}
cloud.board = board;
cloud.hasImage = true;
};
cloud.timeInterval = function (_) {
return arguments.length ? ((timeInterval = _ == null ? Infinity : _), cloud) : timeInterval;
};
cloud.words = function (_) {
return arguments.length ? ((words = _), cloud) : words;
};
cloud.size = function (_) {
return arguments.length ? ((size = [+_[0], +_[1]]), cloud) : size;
};
cloud.font = function (_) {
return arguments.length ? ((font = functor(_)), cloud) : font;
};
cloud.fontStyle = function (_) {
return arguments.length ? ((fontStyle = functor(_)), cloud) : fontStyle;
};
cloud.fontWeight = function (_) {
return arguments.length ? ((fontWeight = functor(_)), cloud) : fontWeight;
};
cloud.rotate = function (_) {
return arguments.length ? ((rotate = functor(_)), cloud) : rotate;
};
cloud.text = function (_) {
return arguments.length ? ((text = functor(_)), cloud) : text;
};
cloud.spiral = function (_) {
return arguments.length ? ((spiral = spirals[_] || _), cloud) : spiral;
};
cloud.fontSize = function (_) {
return arguments.length ? ((fontSize = functor(_)), cloud) : fontSize;
};
cloud.padding = function (_) {
return arguments.length ? ((padding = functor(_)), cloud) : padding;
};
cloud.random = function (_) {
return arguments.length ? ((random = _), cloud) : random;
};
return cloud;
}
exports.default = default_1;
/***/ }),
/***/ "./src/view.ts":
/*!*********************!*\
!*** ./src/view.ts ***!
\*********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.View = void 0;
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.js");
var wolfy87_eventemitter_1 = tslib_1.__importDefault(__webpack_require__(/*! wolfy87-eventemitter */ "./node_modules/_wolfy87-eventemitter@5.2.9@wolfy87-eventemitter/EventEmitter.js"));
var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/index.js");
function cloneOptions(options) {
var result = {};
util_1.forIn(options, function (value, key) {
if (util_1.isObject(value) && value.isView) {
result[key] = value;
}
else if (util_1.isArray(value)) {
result[key] = value.concat([]);
}
else if (util_1.isPlainObject(value)) {
result[key] = util_1.clone(value);
}
else {
result[key] = value;
}
});
return result;
}
/**
* 数据视图
* @public
*/
var View = /** @class */ (function (_super) {
tslib_1.__extends(View, _super);
function View(dataSet, options) {
var _this = _super.call(this) || this;
/**
* 是否是View
*/
_this.isView = true;
/**
* 是否是View
*/
_this.isDataView = true; // alias
/**
*
*/
_this.watchingStates = null;
/**
* 数据视图类型
*/
_this.dataType = 'table';
/**
* 已应用的 transform
*/
_this.transforms = [];
/**
* 原始数据
*/
_this.origin = [];
/**
* 存储处理后的数据
*/
_this.rows = [];
if (dataSet && dataSet.isDataSet) {
_this.dataSet = dataSet;
}
else {
_this.dataSet = null;
options = dataSet;
}
_this.loose = !_this.dataSet;
// TODO:
// assign(me, options);
if (options) {
_this.watchingStates = options.watchingStates;
}
if (!_this.loose) {
var watchingStates_1 = _this.watchingStates;
dataSet.on('statechange', function (name) {
if (util_1.isArray(watchingStates_1)) {
if (watchingStates_1.indexOf(name) > -1) {
_this._reExecute();
}
}
else {
_this._reExecute();
}
});
}
return _this;
}
View.prototype._parseStateExpression = function (expr) {
var dataSet = this.dataSet;
if (dataSet === null)
return undefined;
var matched = /^\$state\.(\w+)/.exec(expr);
if (matched) {
return dataSet.state[matched[1]];
}
return expr;
};
View.prototype._preparseOptions = function (options) {
var _this = this;
var optionsCloned = cloneOptions(options);
if (this.loose) {
return optionsCloned;
}
util_1.forIn(optionsCloned, function (value, key) {
if (util_1.isString(value) && /^\$state\./.test(value)) {
optionsCloned[key] = _this._parseStateExpression(value);
}
});
return optionsCloned;
};
// connectors
View.prototype._prepareSource = function (source, options) {
// warning me.origin is protected
this._source = { source: source, options: options };
if (!options) {
if (source instanceof View || util_1.isString(source)) {
this.origin = View.DataSet.getConnector('default')(source, this.dataSet);
}
else if (util_1.isArray(source)) {
// TODO branch: if source is like ['dataview1', 'dataview2']
this.origin = source;
}
else if (util_1.isObject(source) && source.type) {
var opts = this._preparseOptions(source); // connector without source
this.origin = View.DataSet.getConnector(opts.type)(opts, this);
}
else {
throw new TypeError('Invalid source');
}
}
else {
var opts = this._preparseOptions(options);
this.origin = View.DataSet.getConnector(opts.type)(source, opts, this);
}
this.rows = util_1.deepMix([], this.origin);
return this;
};
View.prototype.source = function (source, options) {
this._prepareSource(source, options)._reExecuteTransforms();
this.trigger('change', []);
return this;
};
/**
* 执行数据处理数据。执行完这个函数后transform 会被存储
* @param options - 某种类型的transform
*/
View.prototype.transform = function (options) {
if (options && options.type) {
this.transforms.push(options);
this._executeTransform(options);
}
return this;
};
View.prototype._executeTransform = function (options) {
options = this._preparseOptions(options);
var transform = View.DataSet.getTransform(options.type);
transform(this, options);
};
View.prototype._reExecuteTransforms = function () {
var _this = this;
this.transforms.forEach(function (options) {
_this._executeTransform(options);
});
};
View.prototype.addRow = function (row) {
this.rows.push(row);
};
View.prototype.removeRow = function (index) {
this.rows.splice(index, 1);
};
View.prototype.updateRow = function (index, newRow) {
util_1.assign(this.rows[index], newRow);
};
View.prototype.findRows = function (query) {
return this.rows.filter(function (row) { return util_1.isMatch(row, query); });
};
View.prototype.findRow = function (query) {
return util_1.find(this.rows, query);
};
// columns
View.prototype.getColumnNames = function () {
var firstRow = this.rows[0];
if (firstRow) {
return util_1.keys(firstRow);
}
return [];
};
View.prototype.getColumnName = function (index) {
return this.getColumnNames()[index];
};
View.prototype.getColumnIndex = function (columnName) {
var columnNames = this.getColumnNames();
return columnNames.indexOf(columnName);
};
View.prototype.getColumn = function (columnName) {
return this.rows.map(function (row) { return row[columnName]; });
};
View.prototype.getColumnData = function (columnName) {
return this.getColumn(columnName);
};
// data process
View.prototype.getSubset = function (startRowIndex, endRowIndex, columnNames) {
var subset = [];
for (var i = startRowIndex; i <= endRowIndex; i++) {
subset.push(util_1.pick(this.rows[i], columnNames));
}
return subset;
};
View.prototype.toString = function (prettyPrint) {
if (prettyPrint === void 0) { prettyPrint = false; }
if (prettyPrint) {
return JSON.stringify(this.rows, null, 2);
}
return JSON.stringify(this.rows);
};
View.prototype._reExecute = function () {
var _a = this._source, source = _a.source, options = _a.options;
this._prepareSource(source, options);
this._reExecuteTransforms();
this.trigger('change', []);
};
return View;
}(wolfy87_eventemitter_1.default));
exports.View = View;
/***/ })
/******/ });
});