diff --git a/.babelrc b/.babelrc index 31749320..ee2d29ae 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["es2015", "react", "stage-0"] -} \ No newline at end of file + "presets": ["env", "react", "stage-0"] +} diff --git a/ChangeLog.md b/ChangeLog.md index 731e6507..870d1bc0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,11 @@ +#2.4.2 + Lots of kind people have helped out for this release! Check out the PR history! + * Uses coriolis-data update: + * Fixes issues with repair limpets + * Adds requirement data + * Adds requirements panel + * Adds comma formatting to tooltip numbers + #2.4.1 * Small patches and changes diff --git a/d3.js b/d3.js index 59b68609..bb7cd6bb 100644 --- a/d3.js +++ b/d3.js @@ -1340,6 +1340,12 @@ Selection.prototype = selection.prototype = { dispatch: selection_dispatch }; +var select = function(selector) { + return typeof selector === "string" + ? new Selection([[document.querySelector(selector)]], [document.documentElement]) + : new Selection([[selector]], root); +}; + var define = function(constructor, factory, prototype) { constructor.prototype = factory.prototype = prototype; prototype.constructor = constructor; @@ -6947,861 +6953,7 @@ var cool = cubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8)); var rainbow = cubehelix(); -var xhtml$1 = "http://www.w3.org/1999/xhtml"; - -var namespaces$1 = { - svg: "http://www.w3.org/2000/svg", - xhtml: xhtml$1, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" -}; - -var namespace$1 = function(name) { - var prefix = name += "", i = prefix.indexOf(":"); - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return namespaces$1.hasOwnProperty(prefix) ? {space: namespaces$1[prefix], local: name} : name; -}; - -function creatorInherit$1(name) { - return function() { - var document = this.ownerDocument, - uri = this.namespaceURI; - return uri === xhtml$1 && document.documentElement.namespaceURI === xhtml$1 - ? document.createElement(name) - : document.createElementNS(uri, name); - }; -} - -function creatorFixed$1(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; -} - -var creator$1 = function(name) { - var fullname = namespace$1(name); - return (fullname.local - ? creatorFixed$1 - : creatorInherit$1)(fullname); -}; - -var matcher$2 = function(selector) { - return function() { - return this.matches(selector); - }; -}; - -if (typeof document !== "undefined") { - var element$2 = document.documentElement; - if (!element$2.matches) { - var vendorMatches$1 = element$2.webkitMatchesSelector - || element$2.msMatchesSelector - || element$2.mozMatchesSelector - || element$2.oMatchesSelector; - matcher$2 = function(selector) { - return function() { - return vendorMatches$1.call(this, selector); - }; - }; - } -} - -var matcher$3 = matcher$2; - -var filterEvents$1 = {}; - -var event$1 = null; - -if (typeof document !== "undefined") { - var element$3 = document.documentElement; - if (!("onmouseenter" in element$3)) { - filterEvents$1 = {mouseenter: "mouseover", mouseleave: "mouseout"}; - } -} - -function filterContextListener$1(listener, index, group) { - listener = contextListener$1(listener, index, group); - return function(event) { - var related = event.relatedTarget; - if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) { - listener.call(this, event); - } - }; -} - -function contextListener$1(listener, index, group) { - return function(event1) { - var event0 = event$1; // Events can be reentrant (e.g., focus). - event$1 = event1; - try { - listener.call(this, this.__data__, index, group); - } finally { - event$1 = event0; - } - }; -} - -function parseTypenames$2(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - return {type: t, name: name}; - }); -} - -function onRemove$1(typename) { - return function() { - var on = this.__on; - if (!on) return; - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - } else { - on[++i] = o; - } - } - if (++i) on.length = i; - else delete this.__on; - }; -} - -function onAdd$1(typename, value, capture) { - var wrap = filterEvents$1.hasOwnProperty(typename.type) ? filterContextListener$1 : contextListener$1; - return function(d, i, group) { - var on = this.__on, o, listener = wrap(value, i, group); - if (on) for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - this.addEventListener(o.type, o.listener = listener, o.capture = capture); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, capture); - o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture}; - if (!on) this.__on = [o]; - else on.push(o); - }; -} - -var selection_on$1 = function(typename, value, capture) { - var typenames = parseTypenames$2(typename + ""), i, n = typenames.length, t; - - if (arguments.length < 2) { - var on = this.node().__on; - if (on) for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - - on = value ? onAdd$1 : onRemove$1; - if (capture == null) capture = false; - for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture)); - return this; -}; - -function none$1() {} - -var selector$1 = function(selector) { - return selector == null ? none$1 : function() { - return this.querySelector(selector); - }; -}; - -var selection_select$1 = function(select) { - if (typeof select !== "function") select = selector$1(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - - return new Selection$2(subgroups, this._parents); -}; - -function empty$2() { - return []; -} - -var selectorAll$1 = function(selector) { - return selector == null ? empty$2 : function() { - return this.querySelectorAll(selector); - }; -}; - -var selection_selectAll$1 = function(select) { - if (typeof select !== "function") select = selectorAll$1(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - subgroups.push(select.call(node, node.__data__, i, group)); - parents.push(node); - } - } - } - - return new Selection$2(subgroups, parents); -}; - -var selection_filter$1 = function(match) { - if (typeof match !== "function") match = matcher$3(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Selection$2(subgroups, this._parents); -}; - -var sparse$1 = function(update) { - return new Array(update.length); -}; - -var selection_enter$1 = function() { - return new Selection$2(this._enter || this._groups.map(sparse$1), this._parents); -}; - -function EnterNode$1(parent, datum) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum; -} - -EnterNode$1.prototype = { - constructor: EnterNode$1, - appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, - insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, - querySelector: function(selector) { return this._parent.querySelector(selector); }, - querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } -}; - var constant$10 = function(x) { - return function() { - return x; - }; -}; - -var keyPrefix$2 = "$"; // Protect against keys like “__proto__”. - -function bindIndex$1(parent, group, enter, update, exit, data) { - var i = 0, - node, - groupLength = group.length, - dataLength = data.length; - - // Put any non-null nodes that fit into update. - // Put any null nodes into enter. - // Put any remaining data into enter. - for (; i < dataLength; ++i) { - if (node = group[i]) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode$1(parent, data[i]); - } - } - - // Put any non-null nodes that don’t fit into exit. - for (; i < groupLength; ++i) { - if (node = group[i]) { - exit[i] = node; - } - } -} - -function bindKey$1(parent, group, enter, update, exit, data, key) { - var i, - node, - nodeByKeyValue = {}, - groupLength = group.length, - dataLength = data.length, - keyValues = new Array(groupLength), - keyValue; - - // Compute the key for each node. - // If multiple nodes have the same key, the duplicates are added to exit. - for (i = 0; i < groupLength; ++i) { - if (node = group[i]) { - keyValues[i] = keyValue = keyPrefix$2 + key.call(node, node.__data__, i, group); - if (keyValue in nodeByKeyValue) { - exit[i] = node; - } else { - nodeByKeyValue[keyValue] = node; - } - } - } - - // Compute the key for each datum. - // If there a node associated with this key, join and add it to update. - // If there is not (or the key is a duplicate), add it to enter. - for (i = 0; i < dataLength; ++i) { - keyValue = keyPrefix$2 + key.call(parent, data[i], i, data); - if (node = nodeByKeyValue[keyValue]) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue[keyValue] = null; - } else { - enter[i] = new EnterNode$1(parent, data[i]); - } - } - - // Add any remaining nodes that were not bound to data to exit. - for (i = 0; i < groupLength; ++i) { - if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) { - exit[i] = node; - } - } -} - -var selection_data$1 = function(value, key) { - if (!value) { - data = new Array(this.size()), j = -1; - this.each(function(d) { data[++j] = d; }); - return data; - } - - var bind = key ? bindKey$1 : bindIndex$1, - parents = this._parents, - groups = this._groups; - - if (typeof value !== "function") value = constant$10(value); - - for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { - var parent = parents[j], - group = groups[j], - groupLength = group.length, - data = value.call(parent, parent && parent.__data__, j, parents), - dataLength = data.length, - enterGroup = enter[j] = new Array(dataLength), - updateGroup = update[j] = new Array(dataLength), - exitGroup = exit[j] = new Array(groupLength); - - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - - // Now connect the enter nodes to their following update node, such that - // appendChild can insert the materialized enter node before this node, - // rather than at the end of the parent node. - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) i1 = i0 + 1; - while (!(next = updateGroup[i1]) && ++i1 < dataLength); - previous._next = next || null; - } - } - } - - update = new Selection$2(update, parents); - update._enter = enter; - update._exit = exit; - return update; -}; - -var selection_exit$1 = function() { - return new Selection$2(this._exit || this._groups.map(sparse$1), this._parents); -}; - -var selection_merge$1 = function(selection) { - - for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Selection$2(merges, this._parents); -}; - -var selection_order$1 = function() { - - for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { - for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { - if (node = group[i]) { - if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - - return this; -}; - -var selection_sort$1 = function(compare) { - if (!compare) compare = ascending$2; - - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - - for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group[i]) { - sortgroup[i] = node; - } - } - sortgroup.sort(compareNode); - } - - return new Selection$2(sortgroups, this._parents).order(); -}; - -function ascending$2(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; -} - -var selection_call$1 = function() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; -}; - -var selection_nodes$1 = function() { - var nodes = new Array(this.size()), i = -1; - this.each(function() { nodes[++i] = this; }); - return nodes; -}; - -var selection_node$1 = function() { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { - var node = group[i]; - if (node) return node; - } - } - - return null; -}; - -var selection_size$1 = function() { - var size = 0; - this.each(function() { ++size; }); - return size; -}; - -var selection_empty$1 = function() { - return !this.node(); -}; - -var selection_each$1 = function(callback) { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) callback.call(node, node.__data__, i, group); - } - } - - return this; -}; - -function attrRemove$2(name) { - return function() { - this.removeAttribute(name); - }; -} - -function attrRemoveNS$2(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} - -function attrConstant$2(name, value) { - return function() { - this.setAttribute(name, value); - }; -} - -function attrConstantNS$2(fullname, value) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value); - }; -} - -function attrFunction$2(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name); - else this.setAttribute(name, v); - }; -} - -function attrFunctionNS$2(fullname, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local); - else this.setAttributeNS(fullname.space, fullname.local, v); - }; -} - -var selection_attr$1 = function(name, value) { - var fullname = namespace$1(name); - - if (arguments.length < 2) { - var node = this.node(); - return fullname.local - ? node.getAttributeNS(fullname.space, fullname.local) - : node.getAttribute(fullname); - } - - return this.each((value == null - ? (fullname.local ? attrRemoveNS$2 : attrRemove$2) : (typeof value === "function" - ? (fullname.local ? attrFunctionNS$2 : attrFunction$2) - : (fullname.local ? attrConstantNS$2 : attrConstant$2)))(fullname, value)); -}; - -var defaultView = function(node) { - return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node - || (node.document && node) // node is a Window - || node.defaultView; // node is a Document -}; - -function styleRemove$2(name) { - return function() { - this.style.removeProperty(name); - }; -} - -function styleConstant$2(name, value, priority) { - return function() { - this.style.setProperty(name, value, priority); - }; -} - -function styleFunction$2(name, value, priority) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name); - else this.style.setProperty(name, v, priority); - }; -} - -var selection_style$1 = function(name, value, priority) { - var node; - return arguments.length > 1 - ? this.each((value == null - ? styleRemove$2 : typeof value === "function" - ? styleFunction$2 - : styleConstant$2)(name, value, priority == null ? "" : priority)) - : defaultView(node = this.node()) - .getComputedStyle(node, null) - .getPropertyValue(name); -}; - -function propertyRemove$1(name) { - return function() { - delete this[name]; - }; -} - -function propertyConstant$1(name, value) { - return function() { - this[name] = value; - }; -} - -function propertyFunction$1(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) delete this[name]; - else this[name] = v; - }; -} - -var selection_property$1 = function(name, value) { - return arguments.length > 1 - ? this.each((value == null - ? propertyRemove$1 : typeof value === "function" - ? propertyFunction$1 - : propertyConstant$1)(name, value)) - : this.node()[name]; -}; - -function classArray$1(string) { - return string.trim().split(/^|\s+/); -} - -function classList$1(node) { - return node.classList || new ClassList$1(node); -} - -function ClassList$1(node) { - this._node = node; - this._names = classArray$1(node.getAttribute("class") || ""); -} - -ClassList$1.prototype = { - add: function(name) { - var i = this._names.indexOf(name); - if (i < 0) { - this._names.push(name); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name) { - var i = this._names.indexOf(name); - if (i >= 0) { - this._names.splice(i, 1); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function(name) { - return this._names.indexOf(name) >= 0; - } -}; - -function classedAdd$1(node, names) { - var list = classList$1(node), i = -1, n = names.length; - while (++i < n) list.add(names[i]); -} - -function classedRemove$1(node, names) { - var list = classList$1(node), i = -1, n = names.length; - while (++i < n) list.remove(names[i]); -} - -function classedTrue$1(names) { - return function() { - classedAdd$1(this, names); - }; -} - -function classedFalse$1(names) { - return function() { - classedRemove$1(this, names); - }; -} - -function classedFunction$1(names, value) { - return function() { - (value.apply(this, arguments) ? classedAdd$1 : classedRemove$1)(this, names); - }; -} - -var selection_classed$1 = function(name, value) { - var names = classArray$1(name + ""); - - if (arguments.length < 2) { - var list = classList$1(this.node()), i = -1, n = names.length; - while (++i < n) if (!list.contains(names[i])) return false; - return true; - } - - return this.each((typeof value === "function" - ? classedFunction$1 : value - ? classedTrue$1 - : classedFalse$1)(names, value)); -}; - -function textRemove$1() { - this.textContent = ""; -} - -function textConstant$2(value) { - return function() { - this.textContent = value; - }; -} - -function textFunction$2(value) { - return function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; -} - -var selection_text$1 = function(value) { - return arguments.length - ? this.each(value == null - ? textRemove$1 : (typeof value === "function" - ? textFunction$2 - : textConstant$2)(value)) - : this.node().textContent; -}; - -function htmlRemove$1() { - this.innerHTML = ""; -} - -function htmlConstant$1(value) { - return function() { - this.innerHTML = value; - }; -} - -function htmlFunction$1(value) { - return function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; -} - -var selection_html$1 = function(value) { - return arguments.length - ? this.each(value == null - ? htmlRemove$1 : (typeof value === "function" - ? htmlFunction$1 - : htmlConstant$1)(value)) - : this.node().innerHTML; -}; - -function raise$2() { - if (this.nextSibling) this.parentNode.appendChild(this); -} - -var selection_raise$1 = function() { - return this.each(raise$2); -}; - -function lower$1() { - if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); -} - -var selection_lower$1 = function() { - return this.each(lower$1); -}; - -var selection_append$1 = function(name) { - var create = typeof name === "function" ? name : creator$1(name); - return this.select(function() { - return this.appendChild(create.apply(this, arguments)); - }); -}; - -function constantNull$1() { - return null; -} - -var selection_insert$1 = function(name, before) { - var create = typeof name === "function" ? name : creator$1(name), - select = before == null ? constantNull$1 : typeof before === "function" ? before : selector$1(before); - return this.select(function() { - return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); - }); -}; - -function remove$1() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); -} - -var selection_remove$1 = function() { - return this.each(remove$1); -}; - -var selection_datum$1 = function(value) { - return arguments.length - ? this.property("__data__", value) - : this.node().__data__; -}; - -function dispatchEvent$1(node, type, params) { - var window = defaultView(node), - event = window.CustomEvent; - - if (event) { - event = new event(type, params); - } else { - event = window.document.createEvent("Event"); - if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; - else event.initEvent(type, false, false); - } - - node.dispatchEvent(event); -} - -function dispatchConstant$1(type, params) { - return function() { - return dispatchEvent$1(this, type, params); - }; -} - -function dispatchFunction$1(type, params) { - return function() { - return dispatchEvent$1(this, type, params.apply(this, arguments)); - }; -} - -var selection_dispatch$1 = function(type, params) { - return this.each((typeof params === "function" - ? dispatchFunction$1 - : dispatchConstant$1)(type, params)); -}; - -var root$2 = [null]; - -function Selection$2(groups, parents) { - this._groups = groups; - this._parents = parents; -} - -function selection$2() { - return new Selection$2([[document.documentElement]], root$2); -} - -Selection$2.prototype = selection$2.prototype = { - constructor: Selection$2, - select: selection_select$1, - selectAll: selection_selectAll$1, - filter: selection_filter$1, - data: selection_data$1, - enter: selection_enter$1, - exit: selection_exit$1, - merge: selection_merge$1, - order: selection_order$1, - sort: selection_sort$1, - call: selection_call$1, - nodes: selection_nodes$1, - node: selection_node$1, - size: selection_size$1, - empty: selection_empty$1, - each: selection_each$1, - attr: selection_attr$1, - style: selection_style$1, - property: selection_property$1, - classed: selection_classed$1, - text: selection_text$1, - html: selection_html$1, - raise: selection_raise$1, - lower: selection_lower$1, - append: selection_append$1, - insert: selection_insert$1, - remove: selection_remove$1, - datum: selection_datum$1, - on: selection_on$1, - dispatch: selection_dispatch$1 -}; - -var select$1 = function(selector) { - return typeof selector === "string" - ? new Selection$2([[document.querySelector(selector)]], [document.documentElement]) - : new Selection$2([[selector]], root$2); -}; - -var constant$11 = function(x) { return function constant() { return x; }; @@ -7850,7 +7002,7 @@ function y$3(p) { var line = function() { var x$$1 = x$3, y$$1 = y$3, - defined = constant$11(true), + defined = constant$10(true), context = null, curve = curveLinear, output = null; @@ -7876,15 +7028,15 @@ var line = function() { } line.x = function(_) { - return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$11(+_), line) : x$$1; + return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$10(+_), line) : x$$1; }; line.y = function(_) { - return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$11(+_), line) : y$$1; + return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$10(+_), line) : y$$1; }; line.defined = function(_) { - return arguments.length ? (defined = typeof _ === "function" ? _ : constant$11(!!_), line) : defined; + return arguments.length ? (defined = typeof _ === "function" ? _ : constant$10(!!_), line) : defined; }; line.curve = function(_) { @@ -7924,7 +7076,7 @@ function slope2(that, 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$6(that, t0, t1) { +function point$5(that, t0, t1) { var x0 = that._x0, y0 = that._y0, x1 = that._x1, @@ -7953,7 +7105,7 @@ MonotoneX.prototype = { lineEnd: function() { switch (this._point) { case 2: this._context.lineTo(this._x1, this._y1); break; - case 3: point$6(this, this._t0, slope2(this, this._t0)); break; + case 3: point$5(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; @@ -7966,8 +7118,8 @@ MonotoneX.prototype = { 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$6(this, slope2(this, t1 = slope3(this, x, y)), t1); break; - default: point$6(this, this._t0, t1 = slope3(this, x, y)); break; + case 2: this._point = 3; point$5(this, slope2(this, t1 = slope3(this, x, y)), t1); break; + default: point$5(this, this._t0, t1 = slope3(this, x, y)); break; } this._x0 = this._x1, this._x1 = x; @@ -8153,7 +7305,7 @@ exports.line = line; exports.scaleBand = band; exports.scaleLinear = linear$2; exports.scaleOrdinal = ordinal; -exports.select = select$1; +exports.select = select; Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/d3.min.js b/d3.min.js index 59e42d02..fc6ec2f5 100644 --- a/d3.min.js +++ b/d3.min.js @@ -1,3 +1,3 @@ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t){return function(n,e){return Ri(t(n),e)}}function e(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=Wi?10:o>=Ji?5:o>=Gi?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Wi?10:o>=Ji?5:o>=Gi?2:1)}function r(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Wi?i*=10:o>=Ji?i*=5:o>=Gi&&(i*=2),n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function _(t,n){for(var e,r=0,i=t.length;r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function M(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function E(t){return function(){this.removeAttribute(t)}}function U(t){return function(){this.removeAttributeNS(t.space,t.local)}}function D(t,n){return function(){this.setAttribute(t,n)}}function P(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function F(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function L(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function H(t){return function(){this.style.removeProperty(t)}}function O(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Y(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function q(t){return function(){delete this[t]}}function z(t,n){return function(){this[t]=n}}function j(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function I(t){return t.trim().split(/^|\s+/)}function $(t){return t.classList||new X(t)}function X(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function R(t,n){for(var e=$(t),r=-1,i=n.length;++r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=ou.exec(t))?dt(parseInt(n[1],16)):(n=uu.exec(t))?new yt(n[1],n[2],n[3],1):(n=au.exec(t))?new yt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=su.exec(t))?_t(n[1],n[2],n[3],n[4]):(n=cu.exec(t))?_t(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=lu.exec(t))?mt(n[1],n[2]/100,n[3]/100,1):(n=hu.exec(t))?mt(n[1],n[2]/100,n[3]/100,n[4]):fu.hasOwnProperty(t)?dt(fu[t]):"transparent"===t?new yt(NaN,NaN,NaN,0):null}function dt(t){return new yt(t>>16&255,t>>8&255,255&t,1)}function _t(t,n,e,r){return r<=0&&(t=n=e=NaN),new yt(t,n,e,r)}function gt(t){return t instanceof ft||(t=pt(t)),t?(t=t.rgb(),new yt(t.r,t.g,t.b,t.opacity)):new yt}function vt(t,n,e,r){return 1===arguments.length?gt(t):new yt(t,n,e,null==r?1:r)}function yt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function mt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Mt(t,n,e,r)}function wt(t){if(t instanceof Mt)return new Mt(t.h,t.s,t.l,t.opacity);if(t instanceof ft||(t=pt(t)),!t)return new Mt;if(t instanceof Mt)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e0&&s<1?0:u,new Mt(u,a,s,t.opacity)}function xt(t,n,e,r){return 1===arguments.length?wt(t):new Mt(t,n,e,null==r?1:r)}function Mt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function bt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function At(t){if(t instanceof Nt)return new Nt(t.l,t.a,t.b,t.opacity);if(t instanceof Pt){var n=t.h*pu;return new Nt(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof yt||(t=gt(t));var e=Et(t.r),r=Et(t.g),i=Et(t.b),o=Ct((.4124564*e+.3575761*r+.1804375*i)/_u),u=Ct((.2126729*e+.7151522*r+.072175*i)/gu);return new Nt(116*u-16,500*(o-u),200*(u-Ct((.0193339*e+.119192*r+.9503041*i)/vu)),t.opacity)}function Tt(t,n,e,r){return 1===arguments.length?At(t):new Nt(t,n,e,null==r?1:r)}function Nt(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Ct(t){return t>xu?Math.pow(t,1/3):t/wu+yu}function kt(t){return t>mu?t*t*t:wu*(t-yu)}function St(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Et(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ut(t){if(t instanceof Pt)return new Pt(t.h,t.c,t.l,t.opacity);t instanceof Nt||(t=At(t));var n=Math.atan2(t.b,t.a)*du;return new Pt(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Dt(t,n,e,r){return 1===arguments.length?Ut(t):new Pt(t,n,e,null==r?1:r)}function Pt(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Ft(t){if(t instanceof Ht)return new Ht(t.h,t.s,t.l,t.opacity);t instanceof yt||(t=gt(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Su*r+Cu*n-ku*e)/(Su+Cu-ku),o=r-i,u=(Nu*(e-i)-Au*o)/Tu,a=Math.sqrt(u*u+o*o)/(Nu*i*(1-i)),s=a?Math.atan2(u,o)*du-120:NaN;return new Ht(s<0?s+360:s,a,i,t.opacity)}function Lt(t,n,e,r){return 1===arguments.length?Ft(t):new Ht(t,n,e,null==r?1:r)}function Ht(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Ot(t,n){return function(e){return t+e*n}}function Yt(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function qt(t,n){var e=n-t;return e?Ot(t,e>180||e<-180?e-360*Math.round(e/360):e):Fu(isNaN(t)?n:t)}function zt(t){return 1==(t=+t)?jt:function(n,e){return e-n?Yt(n,e,t):Fu(isNaN(n)?e:n)}}function jt(t,n){var e=n-t;return e?Ot(t,e):Fu(isNaN(t)?n:t)}function It(t){return function(){return t}}function $t(t){return function(n){return t(n)+""}}function Xt(t){return"none"===t?Bu:(Eu||(Eu=document.createElement("DIV"),Uu=document.documentElement,Du=document.defaultView),Eu.style.transform=t,t=Du.getComputedStyle(Uu.appendChild(Eu),null).getPropertyValue("transform"),Uu.removeChild(Eu),t=t.slice(7,-1).split(","),Vu(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function Rt(t){return null==t?Bu:(Pu||(Pu=document.createElementNS("http://www.w3.org/2000/svg","g")),Pu.setAttribute("transform",t),(t=Pu.transform.baseVal.consolidate())?(t=t.matrix,Vu(t.a,t.b,t.c,t.d,t.e,t.f)):Bu)}function Bt(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:Yu(t,i)},{i:s-2,x:Yu(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}function u(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Yu(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function a(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Yu(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function s(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Yu(t,e)},{i:a-2,x:Yu(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),u(n.rotate,e.rotate,r,i),a(n.skewX,e.skewX,r,i),s(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e=0&&n._call.call(null,t),n=n._next;--Ku}function Kt(){ia=(ra=ua.now())+oa,Ku=ta=0;try{Qt()}finally{Ku=0,nn(),ia=0}}function tn(){var t=ua.now(),n=t-ra;n>ea&&(oa-=n,ra=t)}function nn(){for(var t,n,e=Ju,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ju=n);Gu=t,en(r)}function en(t){if(!Ku){ta&&(ta=clearTimeout(ta));var n=t-ia;n>24?(t<1/0&&(ta=setTimeout(Kt,n)),na&&(na=clearInterval(na))):(na||(ra=ia,na=setInterval(tn,ea)),Ku=1,aa(Kt))}}function rn(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>ha)throw new Error("too late");return e}function on(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>pa)throw new Error("too late");return e}function un(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function an(t,n,e){function r(t){e.state=fa,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var c,l,h,f;if(e.state!==fa)return u();for(c in s)if(f=s[c],f.name===e.name){if(f.state===da)return sa(i);f.state===_a?(f.state=va,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete s[c]):+c=0&&(t=t.slice(0,n)),!t||"start"===t})}function Tn(t,n,e){var r,i,o=An(n)?rn:on;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function Nn(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Cn(t,n){var e,r,i;return function(){var o=zo(this).getComputedStyle(this,null),u=o.getPropertyValue(t),a=(this.style.removeProperty(t),o.getPropertyValue(t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}function kn(t){return function(){this.style.removeProperty(t)}}function Sn(t,n,e){var r,i;return function(){var o=zo(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function En(t,n,e){var r,i,o;return function(){var u=zo(this).getComputedStyle(this,null),a=u.getPropertyValue(t),s=e(this);return null==s&&(this.style.removeProperty(t),s=u.getPropertyValue(t)),a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function Un(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function Dn(t){return function(){this.textContent=t}}function Pn(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function Fn(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Ln(t){return lt().transition(t)}function Hn(){return++za}function On(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function Yn(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return $a.time=Zt(),$a;return e}function qn(t){return{type:t}}function zn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function jn(){return new zn}function In(){}function $n(t,n){var e=new In;if(t instanceof In)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i=(o=(_+v)/2))?_=o:v=o,(l=e>=(u=(g+y)/2))?g=u:y=u,i=p,!(p=p[h=l<<1|c]))return i[h]=d,t;if(a=+t._x.call(null,p.data),s=+t._y.call(null,p.data),n===a&&e===s)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=n>=(o=(_+v)/2))?_=o:v=o,(l=e>=(u=(g+y)/2))?g=u:y=u}while((h=l<<1|c)==(f=(s>=u)<<1|a>=o));return i[f]=p,i[h]=d,t}function Jn(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),s=1/0,c=1/0,l=-1/0,h=-1/0;for(e=0;el&&(l=r),ih&&(h=i));for(l",i=n[3]||"-",o=n[4]||"",u=!!n[5],a=n[6]&&+n[6],s=!!n[7],c=n[8]&&+n[8].slice(1),l=n[9]||"";"n"===l?(s=!0,l="g"):Ms[l]||(l=""),(u||"0"===e&&"="===r)&&(u=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=u,this.width=a,this.comma=s,this.precision=c,this.type=l}function oe(){this.reset()}function ue(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}function ae(t){return t>1?0:t<-1?Ls:Math.acos(t)}function se(t){return t>1?Hs:t<-1?-Hs:Math.asin(t)}function ce(t){return function(n,e){var r=qs(n),i=qs(e),o=t(r*i);return[o*i*zs(n),o*zs(e)]}}function le(t){return function(n,e){var r=js(n*n+e*e),i=t(r),o=zs(i),u=qs(i);return[Ys(n*o,r*u),se(r&&e*o/r)]}}function he(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function fe(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}function pe(t,n){var e,r,i,o,u,a=new ye(t),s=+t.value&&(a.value=t.value),c=[a];for(null==n&&(n=_e);e=c.pop();)if(s&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)c.push(r=e.children[o]=new ye(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(ve)}function de(){return pe(this).eachBefore(ge)}function _e(t){return t.children}function ge(t){t.data=t.data.data}function ve(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function ye(t){this.data=t,this.depth=this.height=0,this.parent=null}function me(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function we(t){if(!t._start)try{xe(t)}catch(n){if(t._tasks[t._ended+t._active-1])be(t,n);else if(!t._data)throw n}}function xe(t){for(;t._start=t._waiting&&t._active=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,Ae(t)}function Ae(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function Te(t){return function(n,e){t(null==n?e:null)}}function Ne(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function Ce(t,n){return function(e){return t(e.responseText,n)}}function ke(t){function n(n){var o=n+"",u=e.get(o);if(!u){if(i!==uc)return i;e.set(o,u=r.push(n))}return t[(u-1)%t.length]}var e=$n(),r=[],i=uc;return t=null==t?[]:oc.call(t),n.domain=function(t){if(!arguments.length)return r.slice();r=[],e=$n();for(var i,o,u=-1,a=t.length;++u=e?1:r(t)}}}function De(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function Pe(t,n,e,r){var i=t[0],o=t[1],u=n[0],a=n[1];return o2?Fe:Pe,o=u=null,r}function r(n){return(o||(o=i(a,s,l?Ue(t):t,c)))(+n)}var i,o,u,a=cc,s=cc,c=$u,l=!1;return r.invert=function(t){return(u||(u=i(s,a,Ee,l?De(n):n)))(+t)},r.domain=function(t){return arguments.length?(a=ic.call(t,sc),e()):a.slice()},r.range=function(t){return arguments.length?(s=oc.call(t),e()):s.slice()},r.rangeRound=function(t){return s=oc.call(t),c=Xu,e()},r.clamp=function(t){return arguments.length?(l=!!t,e()):l},r.interpolate=function(t){return arguments.length?(c=t,e()):c},e()}function Oe(t){var n=t.domain;return t.ticks=function(t){var e=n();return Qi(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return lc(n(),t,e)},t.nice=function(e){var i=n(),o=i.length-1,u=null==e?10:e,a=i[0],s=i[o],c=r(a,s,u);return c&&(c=r(Math.floor(a/c)*c,Math.ceil(s/c)*c,u),i[0]=Math.floor(a/c)*c,i[o]=Math.ceil(s/c)*c,n(i)),t},t}function Ye(){var t=He(Ee,Yu);return t.copy=function(){return Le(t,Ye())},Oe(t)}function qe(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(new Date(+e))}while(n(e,o),t(e),e=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return hc.setTime(+n),fc.setTime(+r),t(hc),t(fc),Math.floor(e(hc,fc))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}function ze(t){return qe(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*dc)/_c})}function je(t){return qe(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/_c})}function Ie(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function $e(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Xe(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Re(t){function n(t,n){return function(e){var r,i,o,u=[],a=-1,s=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++a=s)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=I[i in Sc?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=E.exec(n.slice(e));return r?(t.p=U[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=F.exec(n.slice(e));return r?(t.w=L[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=D.exec(n.slice(e));return r?(t.w=P[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=Y.exec(n.slice(e));return r?(t.m=q[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){var r=H.exec(n.slice(e));return r?(t.m=O[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){return r(t,M,n,e)}function l(t,n,e){return r(t,b,n,e)}function h(t,n,e){return r(t,A,n,e)}function f(t){return C[t.getDay()]}function p(t){return N[t.getDay()]}function d(t){return S[t.getMonth()]}function _(t){return k[t.getMonth()]}function g(t){return T[+(t.getHours()>=12)]}function v(t){return C[t.getUTCDay()]}function y(t){return N[t.getUTCDay()]}function m(t){return S[t.getUTCMonth()]}function w(t){return k[t.getUTCMonth()]}function x(t){return T[+(t.getUTCHours()>=12)]}var M=t.dateTime,b=t.date,A=t.time,T=t.periods,N=t.days,C=t.shortDays,k=t.months,S=t.shortMonths,E=Ze(T),U=We(T),D=Ze(N),P=We(N),F=Ze(C),L=We(C),H=Ze(k),O=We(k),Y=Ze(S),q=We(S),z={a:f,A:p,b:d,B:_,c:null,d:lr,e:lr,H:hr,I:fr,j:pr,L:dr,m:_r,M:gr,p:g,S:vr,U:yr,w:mr,W:wr,x:null,X:null,y:xr,Y:Mr,Z:br,"%":Yr},j={a:v,A:y,b:m,B:w,c:null,d:Ar,e:Ar,H:Tr,I:Nr,j:Cr,L:kr,m:Sr,M:Er,p:x,S:Ur,U:Dr,w:Pr,W:Fr,x:null,X:null,y:Lr,Y:Hr,Z:Or,"%":Yr},I={a:o,A:u,b:a,B:s,c:c,d:rr,e:rr,H:or,I:or,j:ir,L:sr,m:er,M:ur,p:i,S:ar,U:Ge,w:Je,W:Qe,x:l,X:h,y:tr,Y:Ke,Z:nr,"%":cr};return z.x=n(b,z),z.X=n(A,z),z.c=n(M,z),j.x=n(b,j),j.X=n(A,j),j.c=n(M,j),{format:function(t){var e=n(t+="",z);return e.toString=function(){return t},e}, -parse:function(t){var n=e(t+="",Ie);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",j);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,$e);return n.toString=function(){return t},n}}}function Be(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function nr(t,n,e){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function er(t,n,e){var r=Ec.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function rr(t,n,e){var r=Ec.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function ir(t,n,e){var r=Ec.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function or(t,n,e){var r=Ec.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function ur(t,n,e){var r=Ec.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ar(t,n,e){var r=Ec.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function sr(t,n,e){var r=Ec.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function cr(t,n,e){var r=Uc.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function lr(t,n){return Be(t.getDate(),n,2)}function hr(t,n){return Be(t.getHours(),n,2)}function fr(t,n){return Be(t.getHours()%12||12,n,2)}function pr(t,n){return Be(1+gc.count(mc(t),t),n,3)}function dr(t,n){return Be(t.getMilliseconds(),n,3)}function _r(t,n){return Be(t.getMonth()+1,n,2)}function gr(t,n){return Be(t.getMinutes(),n,2)}function vr(t,n){return Be(t.getSeconds(),n,2)}function yr(t,n){return Be(vc.count(mc(t),t),n,2)}function mr(t){return t.getDay()}function wr(t,n){return Be(yc.count(mc(t),t),n,2)}function xr(t,n){return Be(t.getFullYear()%100,n,2)}function Mr(t,n){return Be(t.getFullYear()%1e4,n,4)}function br(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Be(n/60|0,"0",2)+Be(n%60,"0",2)}function Ar(t,n){return Be(t.getUTCDate(),n,2)}function Tr(t,n){return Be(t.getUTCHours(),n,2)}function Nr(t,n){return Be(t.getUTCHours()%12||12,n,2)}function Cr(t,n){return Be(1+wc.count(bc(t),t),n,3)}function kr(t,n){return Be(t.getUTCMilliseconds(),n,3)}function Sr(t,n){return Be(t.getUTCMonth()+1,n,2)}function Er(t,n){return Be(t.getUTCMinutes(),n,2)}function Ur(t,n){return Be(t.getUTCSeconds(),n,2)}function Dr(t,n){return Be(xc.count(bc(t),t),n,2)}function Pr(t){return t.getUTCDay()}function Fr(t,n){return Be(Mc.count(bc(t),t),n,2)}function Lr(t,n){return Be(t.getUTCFullYear()%100,n,2)}function Hr(t,n){return Be(t.getUTCFullYear()%1e4,n,4)}function Or(){return"+0000"}function Yr(){return"%"}function qr(t){return t.toISOString()}function zr(t){var n=new Date(t);return isNaN(n)?null:n}function jr(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Fc&&n.documentElement.namespaceURI===Fc?n.createElement(t):n.createElementNS(e,t)}}function Ir(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $r(t,n,e){return t=Xr(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Xr(t,n,e){return function(r){var i=$c;$c=r;try{t.call(this,this.__data__,n,e)}finally{$c=i}}}function Rr(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function Br(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function ti(t){return function(){this.removeAttribute(t)}}function ni(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ei(t,n){return function(){this.setAttribute(t,n)}}function ri(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function ii(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function oi(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function ui(t){return function(){this.style.removeProperty(t)}}function ai(t,n,e){return function(){this.style.setProperty(t,n,e)}}function si(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function ci(t){return function(){delete this[t]}}function li(t,n){return function(){this[t]=n}}function hi(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function fi(t){return t.trim().split(/^|\s+/)}function pi(t){return t.classList||new di(t)}function di(t){this._node=t,this._names=fi(t.getAttribute("class")||"")}function _i(t,n){for(var e=pi(t),r=-1,i=n.length;++rn?1:t>=n?0:NaN},Bi=function(t){return 1===t.length&&(t=n(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}(Ri),Vi=Bi.right,Zi=function(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r0)for(t=Math.ceil(t/u),n=Math.floor(n/u),o=new Array(i=Math.ceil(n-t+1));++s0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),so.hasOwnProperty(n)?{space:so[n],local:t}:t},lo=function(t){var n=co(t);return(n.local?y:v)(n)},ho=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var fo=document.documentElement;if(!fo.matches){var po=fo.webkitMatchesSelector||fo.msMatchesSelector||fo.mozMatchesSelector||fo.oMatchesSelector;ho=function(t){return function(){return po.call(this,t)}}}}var _o=ho,go={},vo=null;if("undefined"!=typeof document){"onmouseenter"in document.documentElement||(go={mouseenter:"mouseover",mouseleave:"mouseout"})}var yo=function(t,n,e){var r,i,o=x(t+""),u=o.length;{if(!(arguments.length<2)){for(a=n?b:M,null==e&&(e=!1),r=0;r=w&&(w=m+1);!(y=g[w])&&++w=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},Do=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=S);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?H:"function"==typeof n?Y:O)(t,n,null==e?"":e)):zo(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},Io=function(t,n){return arguments.length>1?this.each((null==n?q:"function"==typeof n?j:z)(t,n)):this.node()[t]};X.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var $o=function(t,n){var e=I(t+"");if(arguments.length<2){for(var r=$(this.node()),i=-1,o=e.length;++i=240?t-240:t+120,i,r),bt(t,i,r),bt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var pu=Math.PI/180,du=180/Math.PI,_u=.95047,gu=1,vu=1.08883,yu=4/29,mu=6/29,wu=3*mu*mu,xu=mu*mu*mu;tu(Nt,Tt,ht(ft,{brighter:function(t){return new Nt(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Nt(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=gu*kt(t),n=_u*kt(n),e=vu*kt(e),new yt(St(3.2404542*n-1.5371385*t-.4985314*e),St(-.969266*n+1.8760108*t+.041556*e),St(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),tu(Pt,Dt,ht(ft,{brighter:function(t){return new Pt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Pt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return At(this).rgb()}}));var Mu=-.14861,bu=1.78277,Au=-.29227,Tu=-.90649,Nu=1.97294,Cu=Nu*Tu,ku=Nu*bu,Su=bu*Au-Tu*Mu;tu(Ht,Lt,ht(ft,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ht(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ht(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*pu,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new yt(255*(n+e*(Mu*r+bu*i)),255*(n+e*(Au*r+Tu*i)),255*(n+e*(Nu*r)),this.opacity)}}));var Eu,Uu,Du,Pu,Fu=function(t){return function(){return t}},Lu=function t(n){function e(t,n){var e=r((t=vt(t)).r,(n=vt(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),u=jt(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}var r=zt(n);return e.gamma=t,e}(1),Hu=function(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(r),u=new Array(r);for(e=0;eo&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:Yu(e,r)})),o=ju.lastIndex;return opa&&e.state1e-6)if(Math.abs(l*a-s*c)>1e-6&&i){var f=e-o,p=r-u,d=a*a+s*s,_=f*f+p*p,g=Math.sqrt(d),v=Math.sqrt(h),y=i*Math.tan((Ra-Math.acos((d+h-_)/(2*g*v)))/2),m=y/v,w=y/g;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*c)+","+(n+m*l)),this._+="A"+i+","+i+",0,0,"+ +(l*f>c*p)+","+(this._x1=t+w*a)+","+(this._y1=n+w*s)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var u=e*Math.cos(r),a=e*Math.sin(r),s=t+u,c=n+a,l=1^o,h=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+s+","+c),e&&(h<0&&(h=h%Ba+Ba),h>Va?this._+="A"+e+","+e+",0,1,"+l+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+l+","+(this._x1=s)+","+(this._y1=c):h>1e-6&&(this._+="A"+e+","+e+",0,"+ +(h>=Ra)+","+l+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};In.prototype=$n.prototype={constructor:In,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var Za=$n.prototype;Xn.prototype=Rn.prototype={constructor:Xn,has:Za.has,add:function(t){return t+="",this["$"+t]=t,this},remove:Za.remove,clear:Za.clear,values:Za.keys,size:Za.size,empty:Za.empty,each:Za.each};var Wa=function(t){function n(t,n){var r,i,o=e(t,function(t,e){if(r)return r(t,e-1);i=t,r=n?Vn(t,n):Bn(t)});return o.columns=i,o}function e(t,n){function e(){if(l>=c)return u;if(i)return i=!1,o;var n,e=l;if(34===t.charCodeAt(e)){for(var r=e;r++t||t>i||r>n||n>o))return this;var u,a,s=i-e,c=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{u=new Array(4),u[a]=c,c=u}while(s*=2,i=e+s,o=r+s,t>i||n>o);break;case 1:do{u=new Array(4),u[a]=c,c=u}while(s*=2,e=i-s,o=r+s,e>t||n>o);break;case 2:do{u=new Array(4),u[a]=c,c=u}while(s*=2,i=e+s,r=o-s,t>i||r>n);break;case 3:do{u=new Array(4),u[a]=c,c=u}while(s*=2,e=i-s,r=o-s,e>t||r>n)}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},es=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},rs=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},is=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},os=function(t,n,e){var r,i,o,u,a,s,c,l=this._x0,h=this._y0,f=this._x1,p=this._y1,d=[],_=this._root;for(_&&d.push(new is(_,l,h,f,p)),null==e?e=1/0:(l=t-e,h=n-e,f=t+e,p=n+e,e*=e);s=d.pop();)if(!(!(_=s.node)||(i=s.x0)>f||(o=s.y0)>p||(u=s.x1)=v)<<1|t>=g)&&(s=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=s)}else{var y=t-+this._x.call(null,_.data),m=n-+this._y.call(null,_.data),w=y*y+m*m;if(w=(a=(d+g)/2))?d=a:g=a,(l=u>=(s=(_+v)/2))?_=s:v=s,n=p,!(p=p[h=l<<1|c]))return this;if(!p.length)break;(n[h+1&3]||n[h+2&3]||n[h+3&3])&&(e=n,f=h)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):n?(i?n[h]=i:delete n[h],(p=n[0]||n[1]||n[2]||n[3])&&p===(n[3]||n[2]||n[1]||n[0])&&!p.length&&(e?e[f]=p:this._root=p),this):(this._root=i,this)},as=function(){return this._root},ss=function(){var t=0;return this.visit(function(n){if(!n.length)do{++t}while(n=n.next)}),t},cs=function(t){var n,e,r,i,o,u,a=[],s=this._root;for(s&&a.push(new is(s,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,o=n.x1,u=n.y1)&&s.length){var c=(r+o)/2,l=(i+u)/2;(e=s[3])&&a.push(new is(e,c,l,o,u)),(e=s[2])&&a.push(new is(e,r,l,c,u)),(e=s[1])&&a.push(new is(e,c,i,o,l)),(e=s[0])&&a.push(new is(e,r,i,c,l))}return this},ls=function(t){var n,e=[],r=[];for(this._root&&e.push(new is(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,u=n.x0,a=n.y0,s=n.x1,c=n.y1,l=(u+s)/2,h=(a+c)/2;(o=i[0])&&e.push(new is(o,u,a,l,h)),(o=i[1])&&e.push(new is(o,l,a,s,h)),(o=i[2])&&e.push(new is(o,u,h,l,c)),(o=i[3])&&e.push(new is(o,l,h,s,c))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},hs=function(t){return arguments.length?(this._x=t,this):this._x},fs=function(t){return arguments.length?(this._y=t,this):this._y},ps=te.prototype=ne.prototype;ps.copy=function(){var t,n,e=new ne(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=ee(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=ee(n));return e},ps.add=ts,ps.addAll=Jn,ps.cover=ns,ps.data=es,ps.extent=rs,ps.find=os,ps.remove=us,ps.removeAll=Gn,ps.root=as,ps.size=ss,ps.visit=cs,ps.visitAfter=ls,ps.x=hs,ps.y=fs;var ds,_s=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},gs=function(t){return t=_s(Math.abs(t)),t?t[1]:NaN},vs=function(t,n){return function(e,r){for(var i=e.length,o=[],u=0,a=t[0],s=0;i>0&&a>0&&(s+a+1>r&&(a=Math.max(1,r-s)),o.push(e.substring(i-=a,i+a)),!((s+=a+1)>r));)a=t[u=(u+1)%t.length];return o.reverse().join(n)}},ys=function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}},ms=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},ws=function(t,n){var e=_s(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ds=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_s(t,Math.max(0,n+o-1))[0]},xs=function(t,n){var e=_s(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Ms={"":ms,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return xs(100*t,n)},r:xs,s:ws,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},bs=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;re.prototype=ie.prototype,ie.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var As,Ts,Ns,Cs=function(t){return t},ks=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Ss=function(t){function n(t){function n(t){var n,i,a,l=g,w=v;if("c"===_)w=y(t)+w,t="";else{t=+t;var x=t<0;if(t=y(Math.abs(t),d),x&&0==+t&&(x=!1),l=(x?"("===c?c:"-":"-"===c||"("===c?"":c)+l,w=w+("s"===_?ks[8+ds/3]:"")+(x&&"("===c?")":""),m)for(n=-1,i=t.length;++n(a=t.charCodeAt(n))||a>57){w=(46===a?o+t.slice(n+1):t.slice(n))+w,t=t.slice(0,n);break}}p&&!h&&(t=r(t,1/0));var M=l.length+t.length+w.length,b=M>1)+l+t+w+b.slice(M);break;default:t=b+l+t+w}return u(t)}t=re(t);var e=t.fill,s=t.align,c=t.sign,l=t.symbol,h=t.zero,f=t.width,p=t.comma,d=t.precision,_=t.type,g="$"===l?i[0]:"#"===l&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",v="$"===l?i[1]:/[%p]/.test(_)?a:"",y=Ms[_],m=!_||/[defgprs%]/.test(_);return d=null==d?_?6:12:/[gprs]/.test(_)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=re(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(gs(e)/3))),o=Math.pow(10,-i),u=ks[8+i/3];return function(t){return r(o*t)+u}}var r=t.grouping&&t.thousands?vs(t.grouping,t.thousands):Cs,i=t.currency,o=t.decimal,u=t.numerals?ys(t.numerals):Cs,a=t.percent||"%";return{format:n,formatPrefix:e}};!function(t){As=Ss(t),Ts=As.format,Ns=As.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Es=function(t){return Math.max(0,-gs(Math.abs(t)))},Us=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(gs(n)/3)))-gs(Math.abs(t)))},Ds=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,gs(n)-gs(t))+1},Ps=function(){return new oe};oe.prototype={constructor:oe,reset:function(){this.s=this.t=0},add:function(t){ue(Fs,t,this.t),ue(this,Fs.s,this.s),this.s?this.t+=Fs.t:this.s=Fs.t},valueOf:function(){return this.s}};var Fs=new oe,Ls=Math.PI,Hs=Ls/2,Os=Ls/180,Ys=(Math.abs,Math.atan,Math.atan2),qs=Math.cos,zs=Math.sin,js=Math.sqrt;Ps(),Ps(),Ps(),Ps(),Ps(),Ps(),Ps(),Ps();qs(30*Os);ce(function(t){return js(2/(1+t))}).invert=le(function(t){return 2*se(t/2)}),ce(function(t){return(t=ae(t))&&t/zs(t)}).invert=le(function(t){return t});var Is=function(){return this.eachAfter(he)},$s=function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},Rs=function(t){for(var n,e,r,i=this,o=[i],u=[];i=o.pop();)if(u.push(i),n=i.children)for(e=0,r=n.length;e=0;)e+=r[i].value;n.value=e})},Vs=function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},Zs=function(t){for(var n=this,e=fe(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},Ws=function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},Js=function(){var t=[];return this.each(function(n){t.push(n)}),t},Gs=function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},Qs=function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n};ye.prototype=pe.prototype={constructor:ye,count:Is,each:$s,eachAfter:Rs,eachBefore:Xs,sum:Bs,sort:Vs,path:Zs,ancestors:Ws,descendants:Js,leaves:Gs,links:Qs,copy:de};me.prototype=Object.create(ye.prototype);var Ks={},tc=function(t,n){function e(t){var n,e=c.status;if(!e&&Ne(c)||e>=200&&e<300||304===e){if(o)try{n=o.call(r,c)}catch(t){return void a.call("error",r,t)}else n=c;a.call("load",r,n)}else a.call("error",r,t)}var r,i,o,u,a=f("beforesend","progress","load","error"),s=$n(),c=new XMLHttpRequest,l=null,h=null,p=0;if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=e:c.onreadystatechange=function(t){c.readyState>3&&e(t)},c.onprogress=function(t){a.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?s.get(t):(null==n?s.remove(t):s.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(u=t,r):u},timeout:function(t){return arguments.length?(p=+t,r):p},user:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},password:function(t){return arguments.length<1?h:(h=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return c.open(n,t,!0,l,h),null==i||s.has("accept")||s.set("accept",i+",*/*"),c.setRequestHeader&&s.each(function(t,n){c.setRequestHeader(n,t)}),null!=i&&c.overrideMimeType&&c.overrideMimeType(i),null!=u&&(c.responseType=u),p>0&&(c.timeout=p),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=Te(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),a.call("beforesend",r,c),c.send(null==e?null:e),r},abort:function(){return c.abort(),r},on:function(){var t=a.on.apply(a,arguments);return t===a?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r},nc=function(t,n){return function(e,r){var i=tc(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}};nc("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),nc("application/json",function(t){return JSON.parse(t.responseText)}),nc("text/plain",function(t){return t.responseText}),nc("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n});var ec=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=tc(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(Ce(n,r=t)):r},o.row(r),i?o.get(i):o}};ec("text/csv",Ga),ec("text/tab-separated-values",Ka);var rc=Array.prototype,ic=rc.map,oc=rc.slice,uc={name:"implicit"},ac=function(t){return function(){return t}},sc=function(t){return+t},cc=[0,1],lc=function(t,n,e){var i,o=t[0],u=t[t.length-1],a=r(o,u,null==n?10:n);switch(e=re(null==e?",f":e),e.type){case"s":var s=Math.max(Math.abs(o),Math.abs(u));return null!=e.precision||isNaN(i=Us(a,s))||(e.precision=i),Ns(e,s);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(i=Ds(a,Math.max(Math.abs(o),Math.abs(u))))||(e.precision=i-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(i=Es(a))||(e.precision=i-2*("%"===e.type))}return Ts(e)},hc=new Date,fc=new Date,pc=qe(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});pc.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?qe(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):pc:null};var dc=6e4,_c=6048e5,gc=(qe(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),qe(function(t){t.setTime(Math.floor(t/dc)*dc)},function(t,n){t.setTime(+t+n*dc)},function(t,n){return(n-t)/dc},function(t){return t.getMinutes()}),qe(function(t){var n=t.getTimezoneOffset()*dc%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),qe(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*dc)/864e5},function(t){return t.getDate()-1})),vc=ze(0),yc=ze(1),mc=(ze(2),ze(3),ze(4),ze(5),ze(6),qe(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),qe(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}));mc.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var wc=(qe(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*dc)},function(t,n){return(n-t)/dc},function(t){return t.getUTCMinutes()}),qe(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),qe(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1})),xc=je(0),Mc=je(1),bc=(je(2),je(3),je(4),je(5),je(6),qe(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),qe(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}));bc.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Ac,Tc,Nc,Cc,kc,Sc={"-":"",_:" ",0:"0"},Ec=/^\s*\d+/,Uc=/^%/,Dc=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;!function(t){Ac=Re(t),Tc=Ac.format,Nc=Ac.parse,Cc=Ac.utcFormat,kc=Ac.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Pc=(Date.prototype.toISOString||Cc("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||kc("%Y-%m-%dT%H:%M:%S.%LZ"),function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})});Pc("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Pc("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),Pc("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),Pc("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),Qu(Lt(300,.5,0),Lt(-240,.5,1));var Fc=(Qu(Lt(-100,.75,.35),Lt(80,1.5,.8)),Qu(Lt(260,.75,.35),Lt(80,1.5,.8)),Lt(),"http://www.w3.org/1999/xhtml"),Lc={svg:"http://www.w3.org/2000/svg",xhtml:Fc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Hc=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Lc.hasOwnProperty(n)?{space:Lc[n],local:t}:t},Oc=function(t){var n=Hc(t);return(n.local?Ir:jr)(n)},Yc=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var qc=document.documentElement;if(!qc.matches){var zc=qc.webkitMatchesSelector||qc.msMatchesSelector||qc.mozMatchesSelector||qc.oMatchesSelector;Yc=function(t){return function(){return zc.call(this,t)}}}}var jc=Yc,Ic={},$c=null;if("undefined"!=typeof document){"onmouseenter"in document.documentElement||(Ic={mouseenter:"mouseover",mouseleave:"mouseout"})}var Xc=function(t,n,e){var r,i,o=Rr(t+""),u=o.length;{if(!(arguments.length<2)){for(a=n?Vr:Br,null==e&&(e=!1),r=0;r=w&&(w=m+1);!(y=g[w])&&++w=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},il=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Kr);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?ui:"function"==typeof n?si:ai)(t,n,null==e?"":e)):fl(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},dl=function(t,n){return arguments.length>1?this.each((null==n?ci:"function"==typeof n?hi:li)(t,n)):this.node()[t]};di.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var _l=function(t,n){var e=fi(t+"");if(arguments.length<2){for(var r=pi(this.node()),i=-1,o=e.length;++i=0?(o>=ni?10:o>=ei?5:o>=ri?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=ni?10:o>=ei?5:o>=ri?2:1)}function r(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=ni?i*=10:o>=ei?i*=5:o>=ri&&(i*=2),n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function g(t,n){for(var e,r=0,i=t.length;r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function M(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function U(t){return function(){this.removeAttribute(t)}}function E(t){return function(){this.removeAttributeNS(t.space,t.local)}}function D(t,n){return function(){this.setAttribute(t,n)}}function F(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function P(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function H(t){return function(){this.style.removeProperty(t)}}function L(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function q(t){return function(){delete this[t]}}function j(t,n){return function(){this[t]=n}}function z(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function I(t){return t.trim().split(/^|\s+/)}function $(t){return t.classList||new X(t)}function X(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function R(t,n){for(var e=$(t),r=-1,i=n.length;++r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=ho.exec(t))?dt(parseInt(n[1],16)):(n=fo.exec(t))?new yt(n[1],n[2],n[3],1):(n=po.exec(t))?new yt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=go.exec(t))?gt(n[1],n[2],n[3],n[4]):(n=vo.exec(t))?gt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=_o.exec(t))?mt(n[1],n[2]/100,n[3]/100,1):(n=yo.exec(t))?mt(n[1],n[2]/100,n[3]/100,n[4]):mo.hasOwnProperty(t)?dt(mo[t]):"transparent"===t?new yt(NaN,NaN,NaN,0):null}function dt(t){return new yt(t>>16&255,t>>8&255,255&t,1)}function gt(t,n,e,r){return r<=0&&(t=n=e=NaN),new yt(t,n,e,r)}function vt(t){return t instanceof ft||(t=pt(t)),t?(t=t.rgb(),new yt(t.r,t.g,t.b,t.opacity)):new yt}function _t(t,n,e,r){return 1===arguments.length?vt(t):new yt(t,n,e,null==r?1:r)}function yt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function mt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Mt(t,n,e,r)}function wt(t){if(t instanceof Mt)return new Mt(t.h,t.s,t.l,t.opacity);if(t instanceof ft||(t=pt(t)),!t)return new Mt;if(t instanceof Mt)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e0&&s<1?0:u,new Mt(u,a,s,t.opacity)}function xt(t,n,e,r){return 1===arguments.length?wt(t):new Mt(t,n,e,null==r?1:r)}function Mt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function bt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Tt(t){if(t instanceof Nt)return new Nt(t.l,t.a,t.b,t.opacity);if(t instanceof Ft){var n=t.h*wo;return new Nt(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof yt||(t=vt(t));var e=Ut(t.r),r=Ut(t.g),i=Ut(t.b),o=kt((.4124564*e+.3575761*r+.1804375*i)/Mo),u=kt((.2126729*e+.7151522*r+.072175*i)/bo);return new Nt(116*u-16,500*(o-u),200*(u-kt((.0193339*e+.119192*r+.9503041*i)/To)),t.opacity)}function At(t,n,e,r){return 1===arguments.length?Tt(t):new Nt(t,n,e,null==r?1:r)}function Nt(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function kt(t){return t>Co?Math.pow(t,1/3):t/ko+Ao}function Ct(t){return t>No?t*t*t:ko*(t-Ao)}function St(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ut(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Et(t){if(t instanceof Ft)return new Ft(t.h,t.c,t.l,t.opacity);t instanceof Nt||(t=Tt(t));var n=Math.atan2(t.b,t.a)*xo;return new Ft(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Dt(t,n,e,r){return 1===arguments.length?Et(t):new Ft(t,n,e,null==r?1:r)}function Ft(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Pt(t){if(t instanceof Ht)return new Ht(t.h,t.s,t.l,t.opacity);t instanceof yt||(t=vt(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Ho*r+Po*n-Yo*e)/(Ho+Po-Yo),o=r-i,u=(Fo*(e-i)-Eo*o)/Do,a=Math.sqrt(u*u+o*o)/(Fo*i*(1-i)),s=a?Math.atan2(u,o)*xo-120:NaN;return new Ht(s<0?s+360:s,a,i,t.opacity)}function Yt(t,n,e,r){return 1===arguments.length?Pt(t):new Ht(t,n,e,null==r?1:r)}function Ht(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Lt(t,n){return function(e){return t+e*n}}function Ot(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function qt(t,n){var e=n-t;return e?Lt(t,e>180||e<-180?e-360*Math.round(e/360):e):zo(isNaN(t)?n:t)}function jt(t){return 1==(t=+t)?zt:function(n,e){return e-n?Ot(n,e,t):zo(isNaN(n)?e:n)}}function zt(t,n){var e=n-t;return e?Lt(t,e):zo(isNaN(t)?n:t)}function It(t){return function(){return t}}function $t(t){return function(n){return t(n)+""}}function Xt(t){return"none"===t?Ko:(Lo||(Lo=document.createElement("DIV"),Oo=document.documentElement,qo=document.defaultView),Lo.style.transform=t,t=qo.getComputedStyle(Oo.appendChild(Lo),null).getPropertyValue("transform"),Oo.removeChild(Lo),t=t.slice(7,-1).split(","),tu(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function Rt(t){return null==t?Ko:(jo||(jo=document.createElementNS("http://www.w3.org/2000/svg","g")),jo.setAttribute("transform",t),(t=jo.transform.baseVal.consolidate())?(t=t.matrix,tu(t.a,t.b,t.c,t.d,t.e,t.f)):Ko)}function Bt(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:Ro(t,i)},{i:s-2,x:Ro(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}function u(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Ro(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function a(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Ro(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function s(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Ro(t,e)},{i:a-2,x:Ro(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),u(n.rotate,e.rotate,r,i),a(n.skewX,e.skewX,r,i),s(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e=0&&n._call.call(null,t),n=n._next;--uu}function Kt(){hu=(lu=pu.now())+fu,uu=au=0;try{Qt()}finally{uu=0,nn(),hu=0}}function tn(){var t=pu.now(),n=t-lu;n>cu&&(fu-=n,lu=t)}function nn(){for(var t,n,e=ru,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ru=n);iu=t,en(r)}function en(t){if(!uu){au&&(au=clearTimeout(au));var n=t-hu;n>24?(t<1/0&&(au=setTimeout(Kt,n)),su&&(su=clearInterval(su))):(su||(lu=hu,su=setInterval(tn,cu)),uu=1,du(Kt))}}function rn(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>yu)throw new Error("too late");return e}function on(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>wu)throw new Error("too late");return e}function un(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function an(t,n,e){function r(t){e.state=mu,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var c,l,h,f;if(e.state!==mu)return u();for(c in s)if(f=s[c],f.name===e.name){if(f.state===xu)return gu(i);f.state===Mu?(f.state=Tu,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete s[c]):+c=0&&(t=t.slice(0,n)),!t||"start"===t})}function An(t,n,e){var r,i,o=Tn(n)?rn:on;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function Nn(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function kn(t,n){var e,r,i;return function(){var o=Ri(this).getComputedStyle(this,null),u=o.getPropertyValue(t),a=(this.style.removeProperty(t),o.getPropertyValue(t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}function Cn(t){return function(){this.style.removeProperty(t)}}function Sn(t,n,e){var r,i;return function(){var o=Ri(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function Un(t,n,e){var r,i,o;return function(){var u=Ri(this).getComputedStyle(this,null),a=u.getPropertyValue(t),s=e(this);return null==s&&(this.style.removeProperty(t),s=u.getPropertyValue(t)),a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function En(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function Dn(t){return function(){this.textContent=t}}function Fn(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function Pn(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Yn(t){return lt().transition(t)}function Hn(){return++Vu}function Ln(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function On(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return Ju.time=Zt(),Ju;return e}function qn(t){return{type:t}}function jn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function zn(){return new jn}function In(){}function $n(t,n){var e=new In;if(t instanceof In)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i=(o=(g+_)/2))?g=o:_=o,(l=e>=(u=(v+y)/2))?v=u:y=u,i=p,!(p=p[h=l<<1|c]))return i[h]=d,t;if(a=+t._x.call(null,p.data),s=+t._y.call(null,p.data),n===a&&e===s)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=n>=(o=(g+_)/2))?g=o:_=o,(l=e>=(u=(v+y)/2))?v=u:y=u}while((h=l<<1|c)==(f=(s>=u)<<1|a>=o));return i[f]=p,i[h]=d,t}function Jn(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),s=1/0,c=1/0,l=-1/0,h=-1/0;for(e=0;el&&(l=r),ih&&(h=i));for(l",i=n[3]||"-",o=n[4]||"",u=!!n[5],a=n[6]&&+n[6],s=!!n[7],c=n[8]&&+n[8].slice(1),l=n[9]||"";"n"===l?(s=!0,l="g"):Sa[l]||(l=""),(u||"0"===e&&"="===r)&&(u=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=u,this.width=a,this.comma=s,this.precision=c,this.type=l}function oe(){this.reset()}function ue(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}function ae(t){return t>1?0:t<-1?Ia:Math.acos(t)}function se(t){return t>1?$a:t<-1?-$a:Math.asin(t)}function ce(t){return function(n,e){var r=Ba(n),i=Ba(e),o=t(r*i);return[o*i*Va(n),o*Va(e)]}}function le(t){return function(n,e){var r=Za(n*n+e*e),i=t(r),o=Va(i),u=Ba(i);return[Ra(n*o,r*u),se(r&&e*o/r)]}}function he(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function fe(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}function pe(t,n){var e,r,i,o,u,a=new ye(t),s=+t.value&&(a.value=t.value),c=[a];for(null==n&&(n=ge);e=c.pop();)if(s&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)c.push(r=e.children[o]=new ye(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(_e)}function de(){return pe(this).eachBefore(ve)}function ge(t){return t.children}function ve(t){t.data=t.data.data}function _e(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function ye(t){this.data=t,this.depth=this.height=0,this.parent=null}function me(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function we(t){if(!t._start)try{xe(t)}catch(n){if(t._tasks[t._ended+t._active-1])be(t,n);else if(!t._data)throw n}}function xe(t){for(;t._start=t._waiting&&t._active=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,Te(t)}function Te(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function Ae(t){return function(n,e){t(null==n?e:null)}}function Ne(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function ke(t,n){return function(e){return t(e.responseText,n)}}function Ce(t){function n(n){var o=n+"",u=e.get(o);if(!u){if(i!==ps)return i;e.set(o,u=r.push(n))}return t[(u-1)%t.length]}var e=$n(),r=[],i=ps;return t=null==t?[]:fs.call(t),n.domain=function(t){if(!arguments.length)return r.slice();r=[],e=$n();for(var i,o,u=-1,a=t.length;++u=e?1:r(t)}}}function De(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function Fe(t,n,e,r){var i=t[0],o=t[1],u=n[0],a=n[1];return o2?Pe:Fe,o=u=null,r}function r(n){return(o||(o=i(a,s,l?Ee(t):t,c)))(+n)}var i,o,u,a=vs,s=vs,c=Jo,l=!1;return r.invert=function(t){return(u||(u=i(s,a,Ue,l?De(n):n)))(+t)},r.domain=function(t){return arguments.length?(a=hs.call(t,gs),e()):a.slice()},r.range=function(t){return arguments.length?(s=fs.call(t),e()):s.slice()},r.rangeRound=function(t){return s=fs.call(t),c=Go,e()},r.clamp=function(t){return arguments.length?(l=!!t,e()):l},r.interpolate=function(t){return arguments.length?(c=t,e()):c},e()}function Le(t){var n=t.domain;return t.ticks=function(t){var e=n();return ii(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return _s(n(),t,e)},t.nice=function(e){var i=n(),o=i.length-1,u=null==e?10:e,a=i[0],s=i[o],c=r(a,s,u);return c&&(c=r(Math.floor(a/c)*c,Math.ceil(s/c)*c,u),i[0]=Math.floor(a/c)*c,i[o]=Math.ceil(s/c)*c,n(i)),t},t}function Oe(){var t=He(Ue,Ro);return t.copy=function(){return Ye(t,Oe())},Le(t)}function qe(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(new Date(+e))}while(n(e,o),t(e),e=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return ys.setTime(+n),ms.setTime(+r),t(ys),t(ms),Math.floor(e(ys,ms))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}function je(t){return qe(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*xs)/Ms})}function ze(t){return qe(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Ms})}function Ie(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function $e(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Xe(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Re(t){function n(t,n){return function(e){var r,i,o,u=[],a=-1,s=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++a=s)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=I[i in Hs?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=U.exec(n.slice(e));return r?(t.p=E[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=P.exec(n.slice(e));return r?(t.w=Y[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=D.exec(n.slice(e));return r?(t.w=F[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=O.exec(n.slice(e));return r?(t.m=q[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){var r=H.exec(n.slice(e));return r?(t.m=L[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){return r(t,M,n,e)}function l(t,n,e){return r(t,b,n,e)}function h(t,n,e){return r(t,T,n,e)}function f(t){return k[t.getDay()]}function p(t){return N[t.getDay()]}function d(t){return S[t.getMonth()]}function g(t){return C[t.getMonth()]}function v(t){return A[+(t.getHours()>=12)]}function _(t){return k[t.getUTCDay()]}function y(t){return N[t.getUTCDay()]}function m(t){return S[t.getUTCMonth()]}function w(t){return C[t.getUTCMonth()]}function x(t){return A[+(t.getUTCHours()>=12)]}var M=t.dateTime,b=t.date,T=t.time,A=t.periods,N=t.days,k=t.shortDays,C=t.months,S=t.shortMonths,U=Ze(A),E=We(A),D=Ze(N),F=We(N),P=Ze(k),Y=We(k),H=Ze(C),L=We(C),O=Ze(S),q=We(S),j={a:f,A:p,b:d,B:g,c:null,d:lr,e:lr,H:hr,I:fr,j:pr,L:dr,m:gr,M:vr,p:v,S:_r,U:yr,w:mr,W:wr,x:null,X:null,y:xr,Y:Mr,Z:br,"%":Or},z={a:_,A:y,b:m,B:w,c:null,d:Tr,e:Tr,H:Ar,I:Nr,j:kr,L:Cr,m:Sr,M:Ur,p:x,S:Er,U:Dr,w:Fr,W:Pr,x:null,X:null,y:Yr,Y:Hr,Z:Lr,"%":Or},I={a:o,A:u,b:a,B:s,c:c,d:rr,e:rr,H:or,I:or,j:ir,L:sr,m:er,M:ur,p:i,S:ar,U:Ge,w:Je,W:Qe,x:l,X:h,y:tr,Y:Ke,Z:nr,"%":cr};return j.x=n(b,j),j.X=n(T,j),j.c=n(M,j),z.x=n(b,z),z.X=n(T,z),z.c=n(M,z),{format:function(t){var e=n(t+="",j);return e.toString=function(){return t},e}, +parse:function(t){var n=e(t+="",Ie);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",z);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,$e);return n.toString=function(){return t},n}}}function Be(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function nr(t,n,e){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function er(t,n,e){var r=Ls.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function rr(t,n,e){var r=Ls.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function ir(t,n,e){var r=Ls.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function or(t,n,e){var r=Ls.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function ur(t,n,e){var r=Ls.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ar(t,n,e){var r=Ls.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function sr(t,n,e){var r=Ls.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function cr(t,n,e){var r=Os.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function lr(t,n){return Be(t.getDate(),n,2)}function hr(t,n){return Be(t.getHours(),n,2)}function fr(t,n){return Be(t.getHours()%12||12,n,2)}function pr(t,n){return Be(1+bs.count(Ns(t),t),n,3)}function dr(t,n){return Be(t.getMilliseconds(),n,3)}function gr(t,n){return Be(t.getMonth()+1,n,2)}function vr(t,n){return Be(t.getMinutes(),n,2)}function _r(t,n){return Be(t.getSeconds(),n,2)}function yr(t,n){return Be(Ts.count(Ns(t),t),n,2)}function mr(t){return t.getDay()}function wr(t,n){return Be(As.count(Ns(t),t),n,2)}function xr(t,n){return Be(t.getFullYear()%100,n,2)}function Mr(t,n){return Be(t.getFullYear()%1e4,n,4)}function br(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Be(n/60|0,"0",2)+Be(n%60,"0",2)}function Tr(t,n){return Be(t.getUTCDate(),n,2)}function Ar(t,n){return Be(t.getUTCHours(),n,2)}function Nr(t,n){return Be(t.getUTCHours()%12||12,n,2)}function kr(t,n){return Be(1+ks.count(Us(t),t),n,3)}function Cr(t,n){return Be(t.getUTCMilliseconds(),n,3)}function Sr(t,n){return Be(t.getUTCMonth()+1,n,2)}function Ur(t,n){return Be(t.getUTCMinutes(),n,2)}function Er(t,n){return Be(t.getUTCSeconds(),n,2)}function Dr(t,n){return Be(Cs.count(Us(t),t),n,2)}function Fr(t){return t.getUTCDay()}function Pr(t,n){return Be(Ss.count(Us(t),t),n,2)}function Yr(t,n){return Be(t.getUTCFullYear()%100,n,2)}function Hr(t,n){return Be(t.getUTCFullYear()%1e4,n,4)}function Lr(){return"+0000"}function Or(){return"%"}function qr(t){return t.toISOString()}function jr(t){var n=new Date(t);return isNaN(n)?null:n}function zr(t){this._context=t}function Ir(t){return t[0]}function $r(t){return t[1]}function Xr(t){return t<0?-1:1}function Rr(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),u=(e-t._y1)/(i||r<0&&-0),a=(o*i+u*r)/(r+i);return(Xr(o)+Xr(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(a))||0}function Br(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Vr(t,n,e){var r=t._x0,i=t._y0,o=t._x1,u=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*n,o-a,u-a*e,o,u)}function Zr(t){this._context=t}function Wr(t){this._context=new Jr(t)}function Jr(t){this._context=t}var Gr=function(t,n){return tn?1:t>=n?0:NaN},Qr=function(t){return 1===t.length&&(t=n(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}(Gr),Kr=Qr.right,ti=function(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r0)for(t=Math.ceil(t/u),n=Math.floor(n/u),o=new Array(i=Math.ceil(n-t+1));++s0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),di.hasOwnProperty(n)?{space:di[n],local:t}:t},vi=function(t){var n=gi(t);return(n.local?y:_)(n)},_i=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var yi=document.documentElement;if(!yi.matches){var mi=yi.webkitMatchesSelector||yi.msMatchesSelector||yi.mozMatchesSelector||yi.oMatchesSelector;_i=function(t){return function(){return mi.call(this,t)}}}}var wi=_i,xi={},Mi=null;if("undefined"!=typeof document){"onmouseenter"in document.documentElement||(xi={mouseenter:"mouseover",mouseleave:"mouseout"})}var bi=function(t,n,e){var r,i,o=x(t+""),u=o.length;{if(!(arguments.length<2)){for(a=n?b:M,null==e&&(e=!1),r=0;r=w&&(w=m+1);!(y=v[w])&&++w=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},Li=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=S);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?H:"function"==typeof n?O:L)(t,n,null==e?"":e)):Ri(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},Vi=function(t,n){return arguments.length>1?this.each((null==n?q:"function"==typeof n?z:j)(t,n)):this.node()[t]};X.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Zi=function(t,n){var e=I(t+"");if(arguments.length<2){for(var r=$(this.node()),i=-1,o=e.length;++i=240?t-240:t+120,i,r),bt(t,i,r),bt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var wo=Math.PI/180,xo=180/Math.PI,Mo=.95047,bo=1,To=1.08883,Ao=4/29,No=6/29,ko=3*No*No,Co=No*No*No;uo(Nt,At,ht(ft,{brighter:function(t){return new Nt(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Nt(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=bo*Ct(t),n=Mo*Ct(n),e=To*Ct(e),new yt(St(3.2404542*n-1.5371385*t-.4985314*e),St(-.969266*n+1.8760108*t+.041556*e),St(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),uo(Ft,Dt,ht(ft,{brighter:function(t){return new Ft(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Ft(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Tt(this).rgb()}}));var So=-.14861,Uo=1.78277,Eo=-.29227,Do=-.90649,Fo=1.97294,Po=Fo*Do,Yo=Fo*Uo,Ho=Uo*Eo-Do*So;uo(Ht,Yt,ht(ft,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ht(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ht(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*wo,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new yt(255*(n+e*(So*r+Uo*i)),255*(n+e*(Eo*r+Do*i)),255*(n+e*(Fo*r)),this.opacity)}}));var Lo,Oo,qo,jo,zo=function(t){return function(){return t}},Io=function t(n){function e(t,n){var e=r((t=_t(t)).r,(n=_t(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),u=zt(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}var r=jt(n);return e.gamma=t,e}(1),$o=function(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(r),u=new Array(r);for(e=0;eo&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:Ro(e,r)})),o=Zo.lastIndex;return owu&&e.state1e-6)if(Math.abs(l*a-s*c)>1e-6&&i){var f=e-o,p=r-u,d=a*a+s*s,g=f*f+p*p,v=Math.sqrt(d),_=Math.sqrt(h),y=i*Math.tan((Qu-Math.acos((d+h-g)/(2*v*_)))/2),m=y/_,w=y/v;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*c)+","+(n+m*l)),this._+="A"+i+","+i+",0,0,"+ +(l*f>c*p)+","+(this._x1=t+w*a)+","+(this._y1=n+w*s)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var u=e*Math.cos(r),a=e*Math.sin(r),s=t+u,c=n+a,l=1^o,h=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+s+","+c),e&&(h<0&&(h=h%Ku+Ku),h>ta?this._+="A"+e+","+e+",0,1,"+l+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+l+","+(this._x1=s)+","+(this._y1=c):h>1e-6&&(this._+="A"+e+","+e+",0,"+ +(h>=Qu)+","+l+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};In.prototype=$n.prototype={constructor:In,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var na=$n.prototype;Xn.prototype=Rn.prototype={constructor:Xn,has:na.has,add:function(t){return t+="",this["$"+t]=t,this},remove:na.remove,clear:na.clear,values:na.keys,size:na.size,empty:na.empty,each:na.each};var ea=function(t){function n(t,n){var r,i,o=e(t,function(t,e){if(r)return r(t,e-1);i=t,r=n?Vn(t,n):Bn(t)});return o.columns=i,o}function e(t,n){function e(){if(l>=c)return u;if(i)return i=!1,o;var n,e=l;if(34===t.charCodeAt(e)){for(var r=e;r++t||t>i||r>n||n>o))return this;var u,a,s=i-e,c=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{u=new Array(4),u[a]=c,c=u}while(s*=2,i=e+s,o=r+s,t>i||n>o);break;case 1:do{u=new Array(4),u[a]=c,c=u}while(s*=2,e=i-s,o=r+s,e>t||n>o);break;case 2:do{u=new Array(4),u[a]=c,c=u}while(s*=2,i=e+s,r=o-s,t>i||r>n);break;case 3:do{u=new Array(4),u[a]=c,c=u}while(s*=2,e=i-s,r=o-s,e>t||r>n)}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this +},ca=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},la=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ha=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},fa=function(t,n,e){var r,i,o,u,a,s,c,l=this._x0,h=this._y0,f=this._x1,p=this._y1,d=[],g=this._root;for(g&&d.push(new ha(g,l,h,f,p)),null==e?e=1/0:(l=t-e,h=n-e,f=t+e,p=n+e,e*=e);s=d.pop();)if(!(!(g=s.node)||(i=s.x0)>f||(o=s.y0)>p||(u=s.x1)=_)<<1|t>=v)&&(s=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=s)}else{var y=t-+this._x.call(null,g.data),m=n-+this._y.call(null,g.data),w=y*y+m*m;if(w=(a=(d+v)/2))?d=a:v=a,(l=u>=(s=(g+_)/2))?g=s:_=s,n=p,!(p=p[h=l<<1|c]))return this;if(!p.length)break;(n[h+1&3]||n[h+2&3]||n[h+3&3])&&(e=n,f=h)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):n?(i?n[h]=i:delete n[h],(p=n[0]||n[1]||n[2]||n[3])&&p===(n[3]||n[2]||n[1]||n[0])&&!p.length&&(e?e[f]=p:this._root=p),this):(this._root=i,this)},da=function(){return this._root},ga=function(){var t=0;return this.visit(function(n){if(!n.length)do{++t}while(n=n.next)}),t},va=function(t){var n,e,r,i,o,u,a=[],s=this._root;for(s&&a.push(new ha(s,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,o=n.x1,u=n.y1)&&s.length){var c=(r+o)/2,l=(i+u)/2;(e=s[3])&&a.push(new ha(e,c,l,o,u)),(e=s[2])&&a.push(new ha(e,r,l,c,u)),(e=s[1])&&a.push(new ha(e,c,i,o,l)),(e=s[0])&&a.push(new ha(e,r,i,c,l))}return this},_a=function(t){var n,e=[],r=[];for(this._root&&e.push(new ha(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,u=n.x0,a=n.y0,s=n.x1,c=n.y1,l=(u+s)/2,h=(a+c)/2;(o=i[0])&&e.push(new ha(o,u,a,l,h)),(o=i[1])&&e.push(new ha(o,l,a,s,h)),(o=i[2])&&e.push(new ha(o,u,h,l,c)),(o=i[3])&&e.push(new ha(o,l,h,s,c))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},ya=function(t){return arguments.length?(this._x=t,this):this._x},ma=function(t){return arguments.length?(this._y=t,this):this._y},wa=te.prototype=ne.prototype;wa.copy=function(){var t,n,e=new ne(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=ee(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=ee(n));return e},wa.add=aa,wa.addAll=Jn,wa.cover=sa,wa.data=ca,wa.extent=la,wa.find=fa,wa.remove=pa,wa.removeAll=Gn,wa.root=da,wa.size=ga,wa.visit=va,wa.visitAfter=_a,wa.x=ya,wa.y=ma;var xa,Ma=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},ba=function(t){return t=Ma(Math.abs(t)),t?t[1]:NaN},Ta=function(t,n){return function(e,r){for(var i=e.length,o=[],u=0,a=t[0],s=0;i>0&&a>0&&(s+a+1>r&&(a=Math.max(1,r-s)),o.push(e.substring(i-=a,i+a)),!((s+=a+1)>r));)a=t[u=(u+1)%t.length];return o.reverse().join(n)}},Aa=function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}},Na=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},ka=function(t,n){var e=Ma(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(xa=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ma(t,Math.max(0,n+o-1))[0]},Ca=function(t,n){var e=Ma(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Sa={"":Na,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Ca(100*t,n)},r:Ca,s:ka,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Ua=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;re.prototype=ie.prototype,ie.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Ea,Da,Fa,Pa=function(t){return t},Ya=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Ha=function(t){function n(t){function n(t){var n,i,a,l=v,w=_;if("c"===g)w=y(t)+w,t="";else{t=+t;var x=t<0;if(t=y(Math.abs(t),d),x&&0==+t&&(x=!1),l=(x?"("===c?c:"-":"-"===c||"("===c?"":c)+l,w=w+("s"===g?Ya[8+xa/3]:"")+(x&&"("===c?")":""),m)for(n=-1,i=t.length;++n(a=t.charCodeAt(n))||a>57){w=(46===a?o+t.slice(n+1):t.slice(n))+w,t=t.slice(0,n);break}}p&&!h&&(t=r(t,1/0));var M=l.length+t.length+w.length,b=M>1)+l+t+w+b.slice(M);break;default:t=b+l+t+w}return u(t)}t=re(t);var e=t.fill,s=t.align,c=t.sign,l=t.symbol,h=t.zero,f=t.width,p=t.comma,d=t.precision,g=t.type,v="$"===l?i[0]:"#"===l&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_="$"===l?i[1]:/[%p]/.test(g)?a:"",y=Sa[g],m=!g||/[defgprs%]/.test(g);return d=null==d?g?6:12:/[gprs]/.test(g)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=re(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(ba(e)/3))),o=Math.pow(10,-i),u=Ya[8+i/3];return function(t){return r(o*t)+u}}var r=t.grouping&&t.thousands?Ta(t.grouping,t.thousands):Pa,i=t.currency,o=t.decimal,u=t.numerals?Aa(t.numerals):Pa,a=t.percent||"%";return{format:n,formatPrefix:e}};!function(t){Ea=Ha(t),Da=Ea.format,Fa=Ea.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var La=function(t){return Math.max(0,-ba(Math.abs(t)))},Oa=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ba(n)/3)))-ba(Math.abs(t)))},qa=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ba(n)-ba(t))+1},ja=function(){return new oe};oe.prototype={constructor:oe,reset:function(){this.s=this.t=0},add:function(t){ue(za,t,this.t),ue(this,za.s,this.s),this.s?this.t+=za.t:this.s=za.t},valueOf:function(){return this.s}};var za=new oe,Ia=Math.PI,$a=Ia/2,Xa=Ia/180,Ra=(Math.abs,Math.atan,Math.atan2),Ba=Math.cos,Va=Math.sin,Za=Math.sqrt;ja(),ja(),ja(),ja(),ja(),ja(),ja(),ja();Ba(30*Xa);ce(function(t){return Za(2/(1+t))}).invert=le(function(t){return 2*se(t/2)}),ce(function(t){return(t=ae(t))&&t/Va(t)}).invert=le(function(t){return t});var Wa=function(){return this.eachAfter(he)},Ja=function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},Qa=function(t){for(var n,e,r,i=this,o=[i],u=[];i=o.pop();)if(u.push(i),n=i.children)for(e=0,r=n.length;e=0;)e+=r[i].value;n.value=e})},ts=function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},ns=function(t){for(var n=this,e=fe(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},es=function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},rs=function(){var t=[];return this.each(function(n){t.push(n)}),t},is=function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},os=function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n};ye.prototype=pe.prototype={constructor:ye,count:Wa,each:Ja,eachAfter:Qa,eachBefore:Ga,sum:Ka,sort:ts,path:ns,ancestors:es,descendants:rs,leaves:is,links:os,copy:de};me.prototype=Object.create(ye.prototype);var us={},as=function(t,n){function e(t){var n,e=c.status;if(!e&&Ne(c)||e>=200&&e<300||304===e){if(o)try{n=o.call(r,c)}catch(t){return void a.call("error",r,t)}else n=c;a.call("load",r,n)}else a.call("error",r,t)}var r,i,o,u,a=f("beforesend","progress","load","error"),s=$n(),c=new XMLHttpRequest,l=null,h=null,p=0;if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=e:c.onreadystatechange=function(t){c.readyState>3&&e(t)},c.onprogress=function(t){a.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?s.get(t):(null==n?s.remove(t):s.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(u=t,r):u},timeout:function(t){return arguments.length?(p=+t,r):p},user:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},password:function(t){return arguments.length<1?h:(h=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return c.open(n,t,!0,l,h),null==i||s.has("accept")||s.set("accept",i+",*/*"),c.setRequestHeader&&s.each(function(t,n){c.setRequestHeader(n,t)}),null!=i&&c.overrideMimeType&&c.overrideMimeType(i),null!=u&&(c.responseType=u),p>0&&(c.timeout=p),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=Ae(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),a.call("beforesend",r,c),c.send(null==e?null:e),r},abort:function(){return c.abort(),r},on:function(){var t=a.on.apply(a,arguments);return t===a?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r},ss=function(t,n){return function(e,r){var i=as(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}};ss("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),ss("application/json",function(t){return JSON.parse(t.responseText)}),ss("text/plain",function(t){return t.responseText}),ss("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n});var cs=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=as(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(ke(n,r=t)):r},o.row(r),i?o.get(i):o}};cs("text/csv",ia),cs("text/tab-separated-values",ua);var ls=Array.prototype,hs=ls.map,fs=ls.slice,ps={name:"implicit"},ds=function(t){return function(){return t}},gs=function(t){return+t},vs=[0,1],_s=function(t,n,e){var i,o=t[0],u=t[t.length-1],a=r(o,u,null==n?10:n);switch(e=re(null==e?",f":e),e.type){case"s":var s=Math.max(Math.abs(o),Math.abs(u));return null!=e.precision||isNaN(i=Oa(a,s))||(e.precision=i),Fa(e,s);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(i=qa(a,Math.max(Math.abs(o),Math.abs(u))))||(e.precision=i-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(i=La(a))||(e.precision=i-2*("%"===e.type))}return Da(e)},ys=new Date,ms=new Date,ws=qe(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});ws.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?qe(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):ws:null};var xs=6e4,Ms=6048e5,bs=(qe(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),qe(function(t){t.setTime(Math.floor(t/xs)*xs)},function(t,n){t.setTime(+t+n*xs)},function(t,n){return(n-t)/xs},function(t){return t.getMinutes()}),qe(function(t){var n=t.getTimezoneOffset()*xs%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),qe(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*xs)/864e5},function(t){return t.getDate()-1})),Ts=je(0),As=je(1),Ns=(je(2),je(3),je(4),je(5),je(6),qe(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),qe(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}));Ns.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var ks=(qe(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*xs)},function(t,n){return(n-t)/xs},function(t){return t.getUTCMinutes()}),qe(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),qe(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1})),Cs=ze(0),Ss=ze(1),Us=(ze(2),ze(3),ze(4),ze(5),ze(6),qe(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),qe(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}));Us.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qe(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Es,Ds,Fs,Ps,Ys,Hs={"-":"",_:" ",0:"0"},Ls=/^\s*\d+/,Os=/^%/,qs=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;!function(t){Es=Re(t),Ds=Es.format,Fs=Es.parse,Ps=Es.utcFormat,Ys=Es.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var js=(Date.prototype.toISOString||Ps("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||Ys("%Y-%m-%dT%H:%M:%S.%LZ"),function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})});js("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),js("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),js("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),js("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),ou(Yt(300,.5,0),Yt(-240,.5,1));var zs=(ou(Yt(-100,.75,.35),Yt(80,1.5,.8)),ou(Yt(260,.75,.35),Yt(80,1.5,.8)),Yt(),function(t){return function(){return t}});zr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var Is=function(t){return new zr(t)},$s=function(){function t(t){var a,s,c,l=t.length,h=!1;for(null==i&&(u=o(c=zn())),a=0;a<=l;++a)!(a/node_modules/babel-jest"}, + "transform": { + ".*": "/node_modules/babel-jest" + }, "testRegex": "(/__tests__/test-.*|\\.(test|spec))\\.js$", "moduleFileExtensions": [ "js", @@ -37,6 +39,7 @@ "/node_modules/lodash", "/node_modules/react", "/node_modules/react-dom", + "/node_modules/react-transition-group", "/node_modules/react-testutils-additions", "/node_modules/fbjs", "/node_modules/fbemitter", @@ -58,9 +61,10 @@ "babel-eslint": "*", "babel-jest": "*", "babel-loader": "*", - "babel-preset-es2015": "*", + "babel-preset-env": "*", "babel-preset-react": "*", "babel-preset-stage-0": "*", + "create-react-class": "^15.6.2", "css-loader": "^0.28.0", "d3-selection": "1", "eslint": "3.19.0", @@ -70,7 +74,7 @@ "extract-text-webpack-plugin": "2.1.0", "file-loader": "^0.11.1", "html-webpack-plugin": "^2.28.0", - "jest-cli": "^19.0.2", + "jest-cli": "^21.2.1", "jsen": "^0.6.4", "json-loader": "^0.5.4", "less": "^2.7.2", @@ -78,6 +82,7 @@ "react-addons-perf": "^15.4.2", "react-measure": "^1.4.7", "react-testutils-additions": "^15.2.0", + "react-transition-group": "^1.1.2", "rimraf": "^2.6.1", "rollup": "0.41", "rollup-plugin-node-resolve": "3", @@ -91,7 +96,7 @@ "babel-polyfill": "*", "browserify-zlib-next": "^1.0.1", "classnames": "^2.2.5", - "coriolis-data": "EDCD/coriolis-data", + "coriolis-data": "../coriolis-data", "d3": "4.8.0", "detect-browser": "^1.7.0", "fbemitter": "^2.1.1", diff --git a/src/app/i18n/en.json b/src/app/i18n/en.json index 2e2b341a..dd1521c8 100644 --- a/src/app/i18n/en.json +++ b/src/app/i18n/en.json @@ -275,5 +275,39 @@ "never": "never", "stock": "stock", "boost": "boost", + "federation rank 1": "Recruit", + "federation rank 2": "Cadet", + "federation rank 3": "Midshipman", + "federation rank 4": "Petty Officer", + "federation rank 5": "Chief Petty Officer", + "federation rank 6": "Warrant Officer", + "federation rank 7": "Ensign", + "federation rank 8": "Lieutenant", + "federation rank 9": "Lieutenant Commander", + "federation rank 10": "Post Commander", + "federation rank 11": "Post Captain", + "federation rank 12": "Rear Admiral", + "federation rank 13": "Vice Admiral", + "federation rank 14": "Admiral", + "federation rank required": "Minimum Federation rank required to purchase", + "empire rank 1": "Outsider", + "empire rank 2": "Serf", + "empire rank 3": "Master", + "empire rank 4": "Squire", + "empire rank 5": "Knight", + "empire rank 6": "Lord", + "empire rank 7": "Baron", + "empire rank 8": "Viscount", + "empire rank 9": "Count", + "empire rank 10": "Earl", + "empire rank 11": "Marquis", + "empire rank 12": "Duke", + "empire rank 13": "Prince", + "empire rank 14": "King", + "empire rank required": "Minimum Empire rank required to purchase", + "horizons": "Horizons", + "horizons required": "Only available to those who have purchased Elite Dangerous: Horizons", + "horizons early adoption": "Horizons Early Adopter", + "horizons early adoption required": "Only available to those who purchased Elite Dangerous: Horizons on PC before February 5, 2016 or on Xbox One before July 30, 2016", "HELP_TEXT": "\n

Introduction

\nCoriolis is a ship builder for Elite: Dangerous. This help file provides you with the information you need to use Coriolis.\n\n

Importing Your Ship Into Coriolis

\nOften, you will want to start with your existing ship in Coriolis and see how particular changes might affect it, for example upgrading your FSD. There are a number of tools that can be used to import your ship without you having to create it manually. This has the added benefit of copying over any engineering modifications that have taken place as well.

\n\n

Importing Your Ship From EDDI

\nTo import your ship from EDDI first ensure that your connection to the Frontier servers' companion API is working. To do this check the 'Companion App' tab where you should see \"Your connection to the companion app is operational\". If not then follow the instructions in the companion app tab in EDDI to connect to the Frontier servers.

\n\nOnce you have a working companion API connection go to the 'Shipyard' tab. At the right-hand side of each ship is an 'Export to Coriolis' button that will open your default web browser in Coriolis with the ship's build.

\n\nNote that Internet Explorer and Edge might not import correctly, due to their internal restrictions on URL length. If you find that this is the case then please change your default browser to Chrome.

\n\nAlso, the imported information does not provide any data on the power priority or enabled status of your cargo hatch. Coriolis sets this item to have a power priority of \"5\" and to be disabled by default. You can change this after import in the Power Management section.

\n\n

Importing Your Ship From EDMC

\nTo import your ship from EDMC once your connection to the Frontier servers' companion API is working go to 'Settings ->Configuration' and set the 'Preferred Shipyard' to 'Coriolis'. Once this is set up clicking on your ship in the main window will open your default web browser in Coriolis with the ship's build.

\n\nNote that Internet Explorer and Edge might not import correctly, due to their internal restrictions on URL length. If you find that this is the case then please change your default browser to Chrome.

\n\n

Understanding And Using The Outfitting Panels

\nThe outfitting page is where you will spend most of your time, and contains the information for your ship. Information on each of the panels is provided below.

\n\n

Key Values

\nAlong the top of the screen are some of the key values for your build. This is a handy reference for the values, but more information is provided for the values in the further panels.

\n\nHere, along with most places in Coriolis, acronyms will have tooltips explaining what they mean. Hover over the acronym to obtain more detail, or look in the glossary at the end of this help.

\n\nAll values are the highest possible, assuming that you an optimal setup for that particular value (maximum pips in ENG for speed, minimum fuel for jump range, etc.). This means that these values will not be affected by changes to pip settings. Details of the specific setup for each value are listed in the associated tootip.

\n\n

Modules

\nThe next set of panels laid out horizontally across the screen contain the modules you have put in your build. From left to right these are the core modules, the internal modules, the hardpoints and the utility mounts. These represent the available slots in your ship and cannot be altered. Each slot has a class, or size, and in general any module up to a given size can fit in a given slot (exceptions being bulkheads, life support and sensors in core modules and restricted internal slots, which can only take a subset of module depending on their restrictions).

\n\nTo add a module to a slot left-click on the slot and select the required module. Only the modules capable of fitting in the selected slot will be shown.

\n\nTo remove a module from a slot right-click on the module.

\n\nTo move a module from one slot to another drag it. If you instead want to copy the module drag it whilst holding down the 'Alt' key.

\n\nClicking on the headings for each set of modules gives you the ability to either select an overall role for your ship (when clicking the core internal header) or a specific module with which you want to fill all applicable slots (when clicking the other headers).

\n\n

Ship Controls

\nThe ship controls allow you to set your pips, boost, and amount of fuel and cargo that your build carries. The changes made here will effect the information supplied in the subsequent panels, giving you a clearer view of what effect different changing these items will have.

\n\nShip control settings are saved as part of a build.

\n\n

Opponent

\nThe opponet selection allows you to choose your opponent. The opponent can be either a stock build of a ship or one of your own saved builds. You can also set the engagement range between you and your opponent. Your selection here will effect the information supplied in the subsequent panels, specifically the Offence and Defence panels.

\n\nOpponent settings are saved as part of a build.

\n\n

Power and Costs Sub-panels

\n

Power

\nThe power management panel provides information about power usage and priorities. It allows you to enable and disable individual modules, as well as set power priorities for each module. Disabled modules will not be included in the build's statistics, with the exception of Shield Cell Banks as they are usually disabled when not in use and only enabled when required.

\n\n

Costs

\nThe costs panel provides information about the costs for each of your modules, and the total cost and insurance for your build. By default Coriolis uses the standard costs, however discounts for your ship, modules and insurance can be altered in the 'Settings' at the top-right of the page.

\n\nThe retrofit costs provides information about the costs of changing the base build for your ship, or your saved build, to the current build.

\n\nThe reload costs provides information about the costs of reloading your current build.

\n\n

Profiles

\nProfiles provide graphs that show the general performance of modules in your build\n\n

Engine Profile

\nThe engine profile panel provides information about the capabilities of your current thrusters. The graph shows you how the maximum speed alters with the overall mass of your build. The vertical dashed line on the graph shows your current mass. Your engine profile can be altered by obtaining different thrusters or engineering your existing thrusters, and you can increase your maximum speed by adding pips to the ENG capacitor as well as reducing the amount of fuel and cargo you are carrying as well as reducing the overall weight of the build. You can also temporarily increase your speed by hitting the boost button.

\n\n

FSD Profile

\nThe FSD profile panel provides information about the capabilities of your current frame shift drive. The graph shows you how the maximum jump range alters with the overall mass of your build. The vertical dashed line on the graph shows your current maximum single jump range. Your FSD profile can be altered by obtaining a different FSD or engineering your existing FSD, and you can increase your maximum jump range by reducing the amount of fuel and cargo you are carrying as well as reducing the overall weight of the build,

\n\n

Movement Profile

\nThe movement profile panel provides information about the capabilities of your current thrusters with your current overall mass and ENG pips settings. The diagram shows your ability to move and rotate in the different axes:\n\n
\n
Speed
The fastest the ship can move, in metres per second
\n
Pitch
The fastest the ship can raise or lower its nose, in degrees per second
\n
Roll
The fastest the ship can roll its body, in degrees per second
\n
Yaw
The fastest the ship can turn its nose left or right, in degrees per second
\n
\n\nYour movement profile can be altered by obtaining different thrusters or engineering your existing thrusters, and you can increase your movement values by adding pips to the ENG capacitor as well as reducing the amount of fuel and cargo you are carrying as well as reducing the overall weight of the build. You can also temporarily increase your movement profile by hitting the boost button.

\n\n

Damage Profile

\nThe damage profile provides two graphs showing how the the build's damage to the opponent's shields and hull change with engagement range. The vertical dashed line on the graph shows your current engagement range. This combines information about the build's weapons with the opponent's shields and hull to provide an accurate picture of sustained damage that can be inflicted on the opponent.

\n\n

Offence

\n

Summary

\nThe offence summary provides per-weapon information about sustained damage per second inflicted to shields and hull, along with a measure of effectiveness of that weapon. The effectiveness value has a tooltip that provides a breakdown of the effectiveness, and can include reductions or increases due to range, resistance, and either power distributor (for shields) or hardness (for hull). The final effectiveness value is calculated by multiplying these percentages together.

\n\n

Offence Metrics

\nThe offence metrics panel provides information about your offence.

\n\nTime to drain is a measure of how quickly your WEP capacitor will drain when firing all weapons. It is affected by the number of pips you have in your WEP capacitor, with more pips resulting in a higher WEP recharge rate and hence a longer time to drain.

\n\nThe next value is the time it will take you to remove your opponent's shields. This assumes that you have 100% time on target and that your engagement range stays constant. Note that if your time to remove shields is longer than your time to drain this assumes that you continue firing throughout, inflicting lower damage due to the reduced energy in your WEP capacitor.

\n\nThe next value is the time it will take you to remove your opponent's armour. This follows the same logic as the time to remove shields.

\n\n

Shield Damage Sources

\nThe shield damage sources provides information about the sources of damage to your opponent by damage type. For each applicable type of damage (absolute explosive, kinetic, thermal) a sustained damage per second value is provided.

\n\n

Hull Damage Sources

\nThe hull damage sources provides information about the sources of damage to your opponent by damage type. For each applicable type of damage (absolute explosive, kinetic, thermal) a sustained damage per second value is provided.

\n\n

Defence

\n

Shield Metrics

\nThe shield metrics provides information about your shield defence.

\n\nRaw shield strength is the sum of the shield from your generator, boosters and shield cell banks. A tooltip provides a breakdown of these values.

\n\nThe time the shields will hold for is the time it will take your opponent' to remove your shields. This assumes that they have 100% time on target and that the engagement range stays constant. It also assumes that you fire all of your shield cell banks prior to your shields being lost.

\n\nThe time the shields will recover in is the time it will take your shields to go from collapsed (0%) to recovered (50%). This is affected by the number of pips you have in your SYS capacitor.

\n\nThe time the shields will recharge in is the time it will take your shields to go from recovered (50%) to full (100%). This is affected by the number of pips you have in your SYS capacitor.

\n\nShield Sources\nThis chart provides information about the sources of your shields. For each applicable source of shields (generator, boosters, shield cell banks) a value is provided.

\n\nDamage Taken\nThis graph shows how the initial damage from the weapons of each type are reduced before their damage is applied to the shields. For each type of damage (absolute, explosive, kinetic, thermal) a percentage of the initial damage is provided. A tooltip provides a breakdown of these values.

\n\nEffective Shield\nThis graph shows the effective shield for each damage type, found by dividing the raw shield value by the damage taken for that type.

\n\n

Amour Metrics

\nThe armour metrics provides information about your armour defence.

\n\nRaw armour strength is the sum of the armour from your bulkheads and hull reinforcement packages. A tooltip provides a breakdown of these values.

\n\nThe time the armour will hold for is the time it will take your opponent' to take your armour to 0. This assumes that they have 100% time on target, the engagement range stays constant, and that all damage is dealt to the armour rather than modules.

\n\nRaw module armour is the sum of the protection from your module reinforcement packages.

\n\nProtection for hardpoints is the amount of protection that your module reinforcement packages provide to hardpoints. This percentage of damage to the hardpoints will be diverted to the module reinforcement packages.

\n\nProtection for all other modules is the amount of protection that your module reinforcement packages provide to everything other than hardpoints. This percentage of damage to the modules will be diverted to the module reinforcement packages.

\n\nArmour Sources\nThis chart provides information about the sources of your armour. For each applicable source of shields (bulkheads, hull reinforcement packages) a value is provided.

\n\nDamage Taken\nThis graph shows how the initial damage from the weapons of each type are reduced before their damage is applied to the armour. For each type of damage (absolute, explosive, kinetic, thermal) a percentage of the initial damage is provided. A tooltip provides a breakdown of these values.

\n\nEffective Armour\nThis graph shows the effective armour for each damage type, found by dividing the raw armour value by the damage taken for that type.

\n\n

Keyboard Shortcuts

\n
\n
Ctrl-b
toggle boost
\n
Ctrl-e
open export dialogue (outfitting page only)
\n
Ctrl-h
open help dialogue
\n
Ctrl-i
open import dialogue
\n
Ctrl-o
open shortlink dialogue
\n
Ctrl-left-arrow
increase SYS capacitor
\n
Ctrl-up-arrow
increase ENG capacitor
\n
Ctrl-right-arrow
increase WEP capacitor
\n
Ctrl-down-arrow
reset power distributor
\n
Esc
close any open dialogue
\n
\n

Glossary

\n
\n
Absolute damage
A type of damage, without any protection. Absolute damage is always dealt at 100% regardless of if the damage is to shields, hull or modules, and irrespective of resistances
\n
DPS
Damage per second; the amount of damage that a weapon or a ship can deal per second to a target under optimum conditions
\n
EPS
Energy per second; the amount of energy that a weapon or a ship drains from the weapons capacitor per second when firing
\n
HPS
Heat per second; the amount of heat that a weapon or a ship generates per second when firing
\n
Effectivness
A comparison of the maximum DPS of a given weapon to the actual DPS of the given weapon in a specific situation. DPS can be reduced by range to the target, the target's hull and shield resistances, and the target's hardness
\n
Explosive damage
A type of damage, protected against by explosive resistance
\n
Hardness
The inherent resistance to damage of a ship's hull. Hardness is defined on a per-ship basis and there is currently nothing that can be done to change it. Hardness of a ship's hull is compared to the piercing of weapons: if piercing is higher than hardness the weapon does 100% damage, otherwise it does a fraction of its damage calculated as piercing/hardness
\n
Falloff
The distance at which a weapons starts to do less damage than its stated DPS
\n
Kinetic damage
A type of damage, protected against by kinetic resistance
\n
SDPS
Sustained damage per second; the amount of damage that a weapon or a ship can deal per second to a target, taking in to account ammunition reload
\n
SEPS
Sustained energy per second; the amount of energy that a weapon or a ship drains from the weapons capacitor per second when firing, taking in to account ammunition reload
\n
SHPS
Sustained heat per second; the amount of heat that a weapon or a ship generates per second when firing, taking in to account ammunition reload
\n
Thermal damage
A type of damage, protected against by thermal resistance
\n
\n\n " } \ No newline at end of file diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx index 17af3290..1b72e372 100644 --- a/src/app/pages/OutfittingPage.jsx +++ b/src/app/pages/OutfittingPage.jsx @@ -556,10 +556,25 @@ export default class OutfittingPage extends Page { const boostMarker = `${ship.canBoost(cargo, fuel)}`; const shipSummaryMarker = `${ship.name}${_sStr}${_iStr}${_hStr}${_pStr}${_mStr}${ship.ladenMass}${cargo}${fuel}`; + const requirements = Ships[ship.id].requirements; + var requirementElements = []; + + function renderRequirement(className, textKey, tooltipTextKey) { + requirementElements.push(
{translate(textKey)}
); + } + + if (requirements) { + requirements.federationRank && renderRequirement('federation', 'federation rank ' + requirements.federationRank, 'federation rank required'); + requirements.empireRank && renderRequirement('empire', 'empire rank ' + requirements.empireRank, 'empire rank required'); + requirements.horizons && renderRequirement('horizons', 'horizons', 'horizons required'); + requirements.horizonsEarlyAdoption && renderRequirement('horizons', 'horizons early adoption', 'horizons early adoption required'); + } + return (

{ship.name}

+
{requirementElements}