'
}, function(e, t) {
e.exports = '
{{preferencesGamesLocationItem.nvLocation}}
{{preferencesGamesLocationItem.nvLocation}} '
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
'
}, function(e, t, n) {
e.exports = '
{{preferencesGamesScan.totalGames}}
{{preferencesGamesScan.lastRereshTime | convertUTCToTimeAgo}}
{{preferencesGamesScan.scanStatus}} '
}, function(e, t, n) {
e.exports = '
{{preferencesGeneralAbout.version}} {{preferencesGeneralAbout.beta}}
{{preferencesGeneralAbout.getProgressString(preferencesGeneralAbout.gfeBetaUpdate)}}
{{preferencesGeneralAbout.gfeBetaUpdate.downloadStatus.downloadSpeed | convertBytesToKBMBGB}}/Sec
{{preferencesGeneralAbout.gfeBetaUpdate.downloadStatus.timeRemaining | convertSecondsToTime:true}}
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
{{language.name}} {{\'l10n.cancel\' | translate | uppercase}} {{\'l10n.done\' | translate | uppercase}}
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
{{device.gpuName | uppercase}}
{{device.gpuName | uppercase}}
{{effect.name | translate}}
{{style.style | translate}}
{{variation.name | translate}}
';
}, function(e, t) {
e.exports = '
'
}, function(e, t, n) {
e.exports = '
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
{{::vm.nvApp.AppData.Name}}
'
}, function(e, t, n) {
e.exports = '
{{item.description}} {{subItem}}
'
}, function(e, t) {
e.exports = '
new_releases
{{::rewardCard.rewardStatusIcon}} {{::rewardCard.rewardStatusMessage}}
lock
{{::rewardCard.nvReward.campaign.title}}
{{::rewardCard.rewardDate}}
{{::rewardCard.perkLevel}}
'
}, function(e, t, n) {
e.exports = '
'
}, function(e, t) {
e.exports = '
{{ searchCtrl.searchCategories[category] | translate | uppercase}}
'
}, , , , function(e, t) {
e.exports = '
play_circle_outline
{{nvContent.name}}
{{nvContent.description}}
{{nvContent.description}}
{{nvContent.description}}
'
}, function(e, t, n) {
e.exports = '
'
}, function(e, t) {
e.exports = "
"
}, function(e, t) {
e.exports = '
{{nvMessage}}
{{nvValue | number:0}}%
'
}, function(e, t, n) {
e.exports = '
{{\'l10n.available\' | translate | uppercase}}
{{updatesDriver.getProgressString(update)}}
{{update.downloadStatus.downloadSpeed | convertBytesToKBMBGB}}/Sec
{{update.downloadStatus.timeRemaining | convertSecondsToTime:true}}
pause play_arrow stop
{{updatesDriver.installedDriverHeaderText}}
file_download
{{updatesDriver.getProgressString(updatesDriver.installedDriver)}}
{{updatesDriver.installedDriver.downloadStatus.downloadSpeed | convertBytesToKBMBGB}}/Sec
{{updatesDriver.installedDriver.downloadStatus.timeRemaining | convertSecondsToTime:true}}
pause play_arrow stop
{{\'l10n.retry\' | translate | uppercase}}
';
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = "
"
}, function(e, t) {
e.exports = '
{{ \'l10n.performCleanInstallation\' | translate }} {{\'l10n.cleanInstallMessage\' | translate}}
'
}, function(e, t, n) {
e.exports = "
{{updateInstallationProgress.model.details()}}
'
}, function(e, t) {
e.exports = '
track_changes {{\'l10n.restartingInSecond\' | translate:{num:updatesInstallationReboot.interval} }}
{{\'l10n.afterRestartInstallation\' | translate}}
'
}, function(e, t) {
e.exports = '
check
{{updatesInstallerDialog.model.details() | translate:dialog.data}}
'
}, function(e, t) {
e.exports = '
{{updatesInstallerDialog.model.details() | translate:dialog.data}}
- {{bullet | translate:dialog.data}}
'
}, function(e, t) {
e.exports = '
{{updatesInstallerDialog.model.button2().text | translate | uppercase}} {{updatesInstallerDialog.model.button1().text | translate | uppercase}}
'
}, function(e, t) {
e.exports = '
{{nvMdIcon}} {{nvDriver.name | translate}}
{{\'l10n.betaWithHypen\' | translate:nvDriver}}
{{\'l10n.versionColon\' | translate}} {{nvDriver.version}} {{\'l10n.releaseDate\' | translate}} {{nvDriver.releaseDateTime | convertToUTCDate}}
'
}, function(e, t) {
e.exports = "
{{'l10n.updates' | translate}} archive {{'l10n.checkforUpdates' | translate | uppercase}}
"
}, function(e, t) {
e.exports = '
cloud_off
locked
{{achievement.title}} {{achievement.description}}
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
{{ levelDetails.nvLevel.name | translate }} {{ levelDetails.xpRangeString }}
'
}, function(e, t) {
e.exports = '
close
'
}, function(e, t) {
e.exports = '
close {{ missionDetailsCtrl.mission.name }}
{{ missionDetailsCtrl.mission.tasks[0].description }}
info
'
}, function(e, t) {
e.exports = '
check_circle {{ missionProgressCtrl.missionValue }}
{{ missionProgressCtrl.getProgress() }} '
}, function(e, t) {
e.exports = '
{{ missionTileCtrl.nvMission.name }}
{{ missionTileCtrl.nvMission.tasks[0].name }} '
}, function(e, t) {
e.exports = '
close
close {{ sweepstakeCtrl.tokensEntered }}
error {{ sweepstakeCtrl.errorMessage }}
{{ sweepstakeCtrl.giveaway.title }}
{{ sweepstakeCtrl.tokensEntered }} {{ sweepstakeCtrl.tokensSubmitMoment() }}
info
';
}, function(e, t) {
e.exports = '
{{userAchievements.titleBadge.title}} '
}, function(e, t) {
e.exports = '
{{ userActivityLog.activityMoment(log) }} {{ log.tokens }}
{{ log.xp }}
'
}, function(e, t) {
e.exports = '
{{ userGalleryDetails.mediaItem.folder }}
{{ userGalleryDetails.mediaItem.date }}
file_upload '
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
error
play_circle_outline
{{userGalleryTile.nvFile.duration}}
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
edit edit
{{ userProfile.profileDetail.displayName }}
edit {{ userProfile.profileDetail.description.bio.value }}
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = '
edit
{{item.description}} {{subItem}}
'
}, function(e, t) {
e.exports = '
'
}, function(e, t) {
e.exports = [{
bodyTags: ["l10n.versionColon", "l10n.releaseDate", "l10n.drivers"],
title: "Driver Item",
extraTags: [],
rawName: "nvDriverItem",
group: "main.auth.updates#Driver Item"
}, {
bodyTags: ["l10n.optimalSettingsAvailable", "l10n.drivers"],
title: "Highlight Tile",
extraTags: ["l10n.unableToFetchVideo"],
rawName: "nvHighlightTile",
group: "main.auth.updates#Highlight Tile"
}, {
bodyTags: ["l10n.checkforUpdates", "l10n.clickToChangeDriverPreference", "l10n.showDriverRecommendationFor", "l10n.gameReadyDriver", "l10n.recommendedForGameUpdates", "l10n.creatorReadyDriver", "l10n.recommendedForCreativeApp", "l10n.available", "l10n.download", "l10n.expressInstall", "l10n.customInstall", "l10n.reInstalledDriver", "l10n.downloadDriver", "l10n.drivers"],
title: "Updates Driver",
extraTags: ["l10n.currentlyInstalled", "l10n.latestGeforceUpdate", "l10n.latestGeforceCRDUpdate", "l10n.newGRDDriverAvailable", "l10n.newCRDDriverAvailable", "l10n.driverDownloadFailed", "l10n.checkingforUpdates", "l10n.preparingPackage", "l10n.downloading", "l10n.paused", "l10n.retrying", "l10n.unableToConnectToNvidia", "l10n.downloadPausedUnableToReachNvidia", "l10n.downloadDiskSpace"],
rawName: "nvUpdatesDriver",
group: "main.auth.updates#Updates Driver"
}, {
bodyTags: ["l10n.redeem", "l10n.filter", "l10n.allNumber", "l10n.availableNumber", "l10n.redeemedNumber", "l10n.expiredNumber", "l10n.whereToFindCoupons", "l10n.available", "l10n.readyToRedeem", "l10n.levelUpToUnlock", "l10n.redeemedAndExpired", "l10n.noRewardsRedeemedYet", "l10n.rewards"],
title: "Rewards Center",
extraTags: ["l10n.checkCouponRetailer", "l10n.gfeGiveaway", "l10n.tryAgain", "l10n.redemptionIncomplete", "l10n.updatingContent", "l10n.unableToReachNvidia", "l10n.learnMore", "l10n.couldNotRetrieveRedemptionHistory", "l10n.codeVerified", "l10n.enterCouponCode", "l10n.redeem"],
rawName: "nvRewardsCenter",
group: "main.auth.rewards#Rewards Center"
}]
}, function(e, t, n) {
e.exports = {
default: n(908),
__esModule: !0
}
}, function(e, t, n) {
e.exports = {
default: n(911),
__esModule: !0
}
}, function(e, t, n) {
"use strict";
function r(e) {
return e && e.__esModule ? e : {
default: e
}
}
t.__esModule = !0;
var o = n(904),
i = r(o),
a = n(903),
s = r(a),
l = n(99),
c = r(l);
t.default = function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + ("undefined" == typeof t ? "undefined" : (0, c.default)(t)));
e.prototype = (0, s.default)(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (i.default ? (0, i.default)(e, t) : e.__proto__ = t)
}
}, function(e, t, n) {
"use strict";
function r(e) {
return e && e.__esModule ? e : {
default: e
}
}
t.__esModule = !0;
var o = n(99),
i = r(o);
t.default = function(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== ("undefined" == typeof t ? "undefined" : (0, i.default)(t)) && "function" != typeof t ? e : t
}
}, , function(e, t, n) {
n(916);
var r = n(17).Object;
e.exports = function(e, t) {
return r.create(e, t)
}
}, , function(e, t, n) {
n(918), e.exports = n(17).Object.getPrototypeOf
}, function(e, t, n) {
n(919), e.exports = n(17).Object.setPrototypeOf
}, , function(e, t, n) {
var r = n(42),
o = n(47),
i = function(e, t) {
if (o(e), !r(t) && null !== t) throw TypeError(t + ": can't set as prototype!")
};
e.exports = {
set: Object.setPrototypeOf || ("__proto__" in {} ? function(e, t, r) {
try {
r = n(186)(Function.call, n(187).f(Object.prototype, "__proto__").set, 2), r(e, []), t = !(e instanceof Array)
} catch (e) {
t = !0
}
return function(e, n) {
return i(e, n), t ? e.__proto__ = n : r(e, n), e
}
}({}, !1) : void 0),
check: i
}
}, , , function(e, t, n) {
var r = n(41);
r(r.S, "Object", {
create: n(123)
})
}, , function(e, t, n) {
var r = n(64),
o = n(188);
n(189)("getPrototypeOf", function() {
return function(e) {
return o(r(e))
}
})
}, function(e, t, n) {
var r = n(41);
r(r.S, "Object", {
setPrototypeOf: n(913).set
})
}, function(e, t, n) {
var r, o;
! function() {
function i(e) {
return e && (e.ownerDocument || e.document || e).documentElement
}
function a(e) {
return e && (e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView)
}
function s(e, t) {
return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN
}
function l(e) {
return null === e ? NaN : +e
}
function c(e) {
return !isNaN(e)
}
function u(e) {
return {
left: function(t, n, r, o) {
for (arguments.length < 3 && (r = 0), arguments.length < 4 && (o = t.length); r < o;) {
var i = r + o >>> 1;
e(t[i], n) < 0 ? r = i + 1 : o = i
}
return r
},
right: function(t, n, r, o) {
for (arguments.length < 3 && (r = 0), arguments.length < 4 && (o = t.length); r < o;) {
var i = r + o >>> 1;
e(t[i], n) > 0 ? o = i : r = i + 1
}
return r
}
}
}
function d(e) {
return e.length
}
function f(e) {
for (var t = 1; e * t % 1;) t *= 10;
return t
}
function m(e, t) {
for (var n in t) Object.defineProperty(e.prototype, n, {
value: t[n],
enumerable: !1
})
}
function p() {
this._ = Object.create(null)
}
function g(e) {
return (e += "") === ya || e[0] === ba ? ba + e : e
}
function v(e) {
return (e += "")[0] === ba ? e.slice(1) : e
}
function h(e) {
return g(e) in this._
}
function y(e) {
return (e = g(e)) in this._ && delete this._[e]
}
function b() {
var e = [];
for (var t in this._) e.push(v(t));
return e
}
function E() {
var e = 0;
for (var t in this._) ++e;
return e
}
function S() {
for (var e in this._) return !1;
return !0
}
function _() {
this._ = Object.create(null)
}
function w(e) {
return e
}
function A(e, t, n) {
return function() {
var r = n.apply(t, arguments);
return r === t ? e : r
}
}
function T(e, t) {
if (t in e) return t;
t = t.charAt(0).toUpperCase() + t.slice(1);
for (var n = 0, r = Ea.length; n < r; ++n) {
var o = Ea[n] + t;
if (o in e) return o
}
}
function C() {}
function I() {}
function x(e) {
function t() {
for (var t, r = n, o = -1, i = r.length; ++o < i;)(t = r[o].on) && t.apply(this, arguments);
return e
}
var n = [],
r = new p;
return t.on = function(t, o) {
var i, a = r.get(t);
return arguments.length < 2 ? a && a.on : (a && (a.on = null, n = n.slice(0, i = n.indexOf(a)).concat(n.slice(i + 1)), r.remove(t)), o && n.push(r.set(t, {
on: o
})), e)
}, t
}
function D() {
sa.event.preventDefault()
}
function M() {
for (var e, t = sa.event; e = t.sourceEvent;) t = e;
return t
}
function O(e) {
for (var t = new I, n = 0, r = arguments.length; ++n < r;) t[arguments[n]] = x(t);
return t.of = function(n, r) {
return function(o) {
try {
var i = o.sourceEvent = sa.event;
o.target = e, sa.event = o, t[o.type].apply(n, r)
} finally {
sa.event = i
}
}
}, t
}
function R(e) {
return _a(e, Ca), e
}
function N(e) {
return "function" == typeof e ? e : function() {
return wa(e, this)
}
}
function L(e) {
return "function" == typeof e ? e : function() {
return Aa(e, this)
}
}
function k(e, t) {
function n() {
this.removeAttribute(e)
}
function r() {
this.removeAttributeNS(e.space, e.local)
}
function o() {
this.setAttribute(e, t)
}
function i() {
this.setAttributeNS(e.space, e.local, t)
}
function a() {
var n = t.apply(this, arguments);
null == n ? this.removeAttribute(e) : this.setAttribute(e, n)
}
function s() {
var n = t.apply(this, arguments);
null == n ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n)
}
return e = sa.ns.qualify(e), null == t ? e.local ? r : n : "function" == typeof t ? e.local ? s : a : e.local ? i : o
}
function P(e) {
return e.trim().replace(/\s+/g, " ")
}
function G(e) {
return new RegExp("(?:^|\\s+)" + sa.requote(e) + "(?:\\s+|$)", "g")
}
function F(e) {
return (e + "").trim().split(/^|\s+/)
}
function U(e, t) {
function n() {
for (var n = -1; ++n < o;) e[n](this, t)
}
function r() {
for (var n = -1, r = t.apply(this, arguments); ++n < o;) e[n](this, r)
}
e = F(e).map(V);
var o = e.length;
return "function" == typeof t ? r : n
}
function V(e) {
var t = G(e);
return function(n, r) {
if (o = n.classList) return r ? o.add(e) : o.remove(e);
var o = n.getAttribute("class") || "";
r ? (t.lastIndex = 0, t.test(o) || n.setAttribute("class", P(o + " " + e))) : n.setAttribute("class", P(o.replace(t, " ")))
}
}
function z(e, t, n) {
function r() {
this.style.removeProperty(e)
}
function o() {
this.style.setProperty(e, t, n)
}
function i() {
var r = t.apply(this, arguments);
null == r ? this.style.removeProperty(e) : this.style.setProperty(e, r, n)
}
return null == t ? r : "function" == typeof t ? i : o
}
function B(e, t) {
function n() {
delete this[e]
}
function r() {
this[e] = t
}
function o() {
var n = t.apply(this, arguments);
null == n ? delete this[e] : this[e] = n
}
return null == t ? n : "function" == typeof t ? o : r
}
function $(e) {
function t() {
var t = this.ownerDocument,
n = this.namespaceURI;
return n ? t.createElementNS(n, e) : t.createElement(e)
}
function n() {
return this.ownerDocument.createElementNS(e.space, e.local)
}
return "function" == typeof e ? e : (e = sa.ns.qualify(e)).local ? n : t
}
function W() {
var e = this.parentNode;
e && e.removeChild(this)
}
function H(e) {
return {
__data__: e
}
}
function j(e) {
return function() {
return Ta(this, e)
}
}
function Y(e) {
return arguments.length || (e = s),
function(t, n) {
return t && n ? e(t.__data__, n.__data__) : !t - !n
}
}
function q(e, t) {
for (var n = 0, r = e.length; n < r; n++)
for (var o, i = e[n], a = 0, s = i.length; a < s; a++)(o = i[a]) && t(o, a, n);
return e
}
function K(e) {
return _a(e, xa), e
}
function Z(e) {
var t, n;
return function(r, o, i) {
var a, s = e[i].update,
l = s.length;
for (i != n && (n = i, t = 0), o >= t && (t = o + 1); !(a = s[t]) && ++t < l;);
return a
}
}
function Q(e, t, n) {
function r() {
var t = this[a];
t && (this.removeEventListener(e, t, t.$), delete this[a])
}
function o() {
var o = l(t, ca(arguments));
r.call(this), this.addEventListener(e, this[a] = o, o.$ = n), o._ = t
}
function i() {
var t, n = new RegExp("^__on([^.]+)" + sa.requote(e) + "$");
for (var r in this)
if (t = r.match(n)) {
var o = this[r];
this.removeEventListener(t[1], o, o.$), delete this[r]
}
}
var a = "__on" + e,
s = e.indexOf("."),
l = X;
s > 0 && (e = e.slice(0, s));
var c = Da.get(e);
return c && (e = c, l = J), s ? t ? o : r : t ? C : i
}
function X(e, t) {
return function(n) {
var r = sa.event;
sa.event = n, t[0] = this.__data__;
try {
e.apply(this, t)
} finally {
sa.event = r
}
}
}
function J(e, t) {
var n = X(e, t);
return function(e) {
var t = this,
r = e.relatedTarget;
r && (r === t || 8 & r.compareDocumentPosition(t)) || n.call(t, e)
}
}
function ee(e) {
var t = ".dragsuppress-" + ++Oa,
n = "click" + t,
r = sa.select(a(e)).on("touchmove" + t, D).on("dragstart" + t, D).on("selectstart" + t, D);
if (null == Ma && (Ma = !("onselectstart" in e) && T(e.style, "userSelect")), Ma) {
var o = i(e).style,
s = o[Ma];
o[Ma] = "none"
}
return function(e) {
if (r.on(t, null), Ma && (o[Ma] = s), e) {
var i = function() {
r.on(n, null)
};
r.on(n, function() {
D(), i()
}, !0), setTimeout(i, 0)
}
}
}
function te(e, t) {
t.changedTouches && (t = t.changedTouches[0]);
var n = e.ownerSVGElement || e;
if (n.createSVGPoint) {
var r = n.createSVGPoint();
if (Ra < 0) {
var o = a(e);
if (o.scrollX || o.scrollY) {
n = sa.select("body").append("svg").style({
position: "absolute",
top: 0,
left: 0,
margin: 0,
padding: 0,
border: "none"
}, "important");
var i = n[0][0].getScreenCTM();
Ra = !(i.f || i.e), n.remove()
}
}
return Ra ? (r.x = t.pageX, r.y = t.pageY) : (r.x = t.clientX, r.y = t.clientY), r = r.matrixTransform(e.getScreenCTM().inverse()), [r.x, r.y]
}
var s = e.getBoundingClientRect();
return [t.clientX - s.left - e.clientLeft, t.clientY - s.top - e.clientTop]
}
function ne() {
return sa.event.changedTouches[0].identifier
}
function re(e) {
return e > 0 ? 1 : e < 0 ? -1 : 0
}
function oe(e, t, n) {
return (t[0] - e[0]) * (n[1] - e[1]) - (t[1] - e[1]) * (n[0] - e[0])
}
function ie(e) {
return e > 1 ? 0 : e < -1 ? ka : Math.acos(e)
}
function ae(e) {
return e > 1 ? Fa : e < -1 ? -Fa : Math.asin(e)
}
function se(e) {
return ((e = Math.exp(e)) - 1 / e) / 2
}
function le(e) {
return ((e = Math.exp(e)) + 1 / e) / 2
}
function ce(e) {
return ((e = Math.exp(2 * e)) - 1) / (e + 1)
}
function ue(e) {
return (e = Math.sin(e / 2)) * e
}
function de() {}
function fe(e, t, n) {
return this instanceof fe ? (this.h = +e, this.s = +t, void(this.l = +n)) : arguments.length < 2 ? e instanceof fe ? new fe(e.h, e.s, e.l) : Ce("" + e, Ie, fe) : new fe(e, t, n)
}
function me(e, t, n) {
function r(e) {
return e > 360 ? e -= 360 : e < 0 && (e += 360), e < 60 ? i + (a - i) * e / 60 : e < 180 ? a : e < 240 ? i + (a - i) * (240 - e) / 60 : i
}
function o(e) {
return Math.round(255 * r(e))
}
var i, a;
return e = isNaN(e) ? 0 : (e %= 360) < 0 ? e + 360 : e, t = isNaN(t) ? 0 : t < 0 ? 0 : t > 1 ? 1 : t, n = n < 0 ? 0 : n > 1 ? 1 : n, a = n <= .5 ? n * (1 + t) : n + t - n * t, i = 2 * n - a, new _e(o(e + 120), o(e), o(e - 120))
}
function pe(e, t, n) {
return this instanceof pe ? (this.h = +e, this.c = +t, void(this.l = +n)) : arguments.length < 2 ? e instanceof pe ? new pe(e.h, e.c, e.l) : e instanceof ve ? ye(e.l, e.a, e.b) : ye((e = xe((e = sa.rgb(e)).r, e.g, e.b)).l, e.a, e.b) : new pe(e, t, n)
}
function ge(e, t, n) {
return isNaN(e) && (e = 0), isNaN(t) && (t = 0), new ve(n, Math.cos(e *= Ua) * t, Math.sin(e) * t)
}
function ve(e, t, n) {
return this instanceof ve ? (this.l = +e, this.a = +t, void(this.b = +n)) : arguments.length < 2 ? e instanceof ve ? new ve(e.l, e.a, e.b) : e instanceof pe ? ge(e.h, e.c, e.l) : xe((e = _e(e)).r, e.g, e.b) : new ve(e, t, n)
}
function he(e, t, n) {
var r = (e + 16) / 116,
o = r + t / 500,
i = r - n / 200;
return o = be(o) * Za, r = be(r) * Qa, i = be(i) * Xa, new _e(Se(3.2404542 * o - 1.5371385 * r - .4985314 * i), Se(-.969266 * o + 1.8760108 * r + .041556 * i), Se(.0556434 * o - .2040259 * r + 1.0572252 * i))
}
function ye(e, t, n) {
return e > 0 ? new pe(Math.atan2(n, t) * Va, Math.sqrt(t * t + n * n), e) : new pe(NaN, NaN, e)
}
function be(e) {
return e > .206893034 ? e * e * e : (e - 4 / 29) / 7.787037
}
function Ee(e) {
return e > .008856 ? Math.pow(e, 1 / 3) : 7.787037 * e + 4 / 29
}
function Se(e) {
return Math.round(255 * (e <= .00304 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - .055));
}
function _e(e, t, n) {
return this instanceof _e ? (this.r = ~~e, this.g = ~~t, void(this.b = ~~n)) : arguments.length < 2 ? e instanceof _e ? new _e(e.r, e.g, e.b) : Ce("" + e, _e, me) : new _e(e, t, n)
}
function we(e) {
return new _e(e >> 16, e >> 8 & 255, 255 & e)
}
function Ae(e) {
return we(e) + ""
}
function Te(e) {
return e < 16 ? "0" + Math.max(0, e).toString(16) : Math.min(255, e).toString(16)
}
function Ce(e, t, n) {
e = e.toLowerCase();
var r, o, i, a = 0,
s = 0,
l = 0;
if (r = /([a-z]+)\((.*)\)/.exec(e)) switch (o = r[2].split(","), r[1]) {
case "hsl":
return n(parseFloat(o[0]), parseFloat(o[1]) / 100, parseFloat(o[2]) / 100);
case "rgb":
return t(Me(o[0]), Me(o[1]), Me(o[2]))
}
return (i = ts.get(e)) ? t(i.r, i.g, i.b) : (null == e || "#" !== e.charAt(0) || isNaN(i = parseInt(e.slice(1), 16)) || (4 === e.length ? (a = (3840 & i) >> 4, a |= a >> 4, s = 240 & i, s |= s >> 4, l = 15 & i, l |= l << 4) : 7 === e.length && (a = (16711680 & i) >> 16, s = (65280 & i) >> 8, l = 255 & i)), t(a, s, l))
}
function Ie(e, t, n) {
var r, o, i = Math.min(e /= 255, t /= 255, n /= 255),
a = Math.max(e, t, n),
s = a - i,
l = (a + i) / 2;
return s ? (o = l < .5 ? s / (a + i) : s / (2 - a - i), r = e == a ? (t - n) / s + (t < n ? 6 : 0) : t == a ? (n - e) / s + 2 : (e - t) / s + 4, r *= 60) : (r = NaN, o = l > 0 && l < 1 ? 0 : r), new fe(r, o, l)
}
function xe(e, t, n) {
e = De(e), t = De(t), n = De(n);
var r = Ee((.4124564 * e + .3575761 * t + .1804375 * n) / Za),
o = Ee((.2126729 * e + .7151522 * t + .072175 * n) / Qa),
i = Ee((.0193339 * e + .119192 * t + .9503041 * n) / Xa);
return ve(116 * o - 16, 500 * (r - o), 200 * (o - i))
}
function De(e) {
return (e /= 255) <= .04045 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4)
}
function Me(e) {
var t = parseFloat(e);
return "%" === e.charAt(e.length - 1) ? Math.round(2.55 * t) : t
}
function Oe(e) {
return "function" == typeof e ? e : function() {
return e
}
}
function Re(e) {
return function(t, n, r) {
return 2 === arguments.length && "function" == typeof n && (r = n, n = null), Ne(t, n, e, r)
}
}
function Ne(e, t, n, r) {
function o() {
var e, t = l.status;
if (!t && ke(l) || t >= 200 && t < 300 || 304 === t) {
try {
e = n.call(i, l)
} catch (e) {
return void a.error.call(i, e)
}
a.load.call(i, e)
} else a.error.call(i, l)
}
var i = {},
a = sa.dispatch("beforesend", "progress", "load", "error"),
s = {},
l = new XMLHttpRequest,
c = null;
return !this.XDomainRequest || "withCredentials" in l || !/^(http(s)?:)?\/\//.test(e) || (l = new XDomainRequest), "onload" in l ? l.onload = l.onerror = o : l.onreadystatechange = function() {
l.readyState > 3 && o()
}, l.onprogress = function(e) {
var t = sa.event;
sa.event = e;
try {
a.progress.call(i, l)
} finally {
sa.event = t
}
}, i.header = function(e, t) {
return e = (e + "").toLowerCase(), arguments.length < 2 ? s[e] : (null == t ? delete s[e] : s[e] = t + "", i)
}, i.mimeType = function(e) {
return arguments.length ? (t = null == e ? null : e + "", i) : t
}, i.responseType = function(e) {
return arguments.length ? (c = e, i) : c
}, i.response = function(e) {
return n = e, i
}, ["get", "post"].forEach(function(e) {
i[e] = function() {
return i.send.apply(i, [e].concat(ca(arguments)))
}
}), i.send = function(n, r, o) {
if (2 === arguments.length && "function" == typeof r && (o = r, r = null), l.open(n, e, !0), null == t || "accept" in s || (s.accept = t + ",*/*"), l.setRequestHeader)
for (var u in s) l.setRequestHeader(u, s[u]);
return null != t && l.overrideMimeType && l.overrideMimeType(t), null != c && (l.responseType = c), null != o && i.on("error", o).on("load", function(e) {
o(null, e)
}), a.beforesend.call(i, l), l.send(null == r ? null : r), i
}, i.abort = function() {
return l.abort(), i
}, sa.rebind(i, a, "on"), null == r ? i : i.get(Le(r))
}
function Le(e) {
return 1 === e.length ? function(t, n) {
e(null == t ? n : null)
} : e
}
function ke(e) {
var t = e.responseType;
return t && "text" !== t ? e.response : e.responseText
}
function Pe() {
var e = Ge(),
t = Fe() - e;
t > 24 ? (isFinite(t) && (clearTimeout(is), is = setTimeout(Pe, t)), os = 0) : (os = 1, ss(Pe))
}
function Ge() {
var e = Date.now();
for (as = ns; as;) e >= as.t && (as.f = as.c(e - as.t)), as = as.n;
return e
}
function Fe() {
for (var e, t = ns, n = 1 / 0; t;) t.f ? t = e ? e.n = t.n : ns = t.n : (t.t < n && (n = t.t), t = (e = t).n);
return rs = e, n
}
function Ue(e, t) {
return t - (e ? Math.ceil(Math.log(e) / Math.LN10) : 1)
}
function Ve(e, t) {
var n = Math.pow(10, 3 * ha(8 - t));
return {
scale: t > 8 ? function(e) {
return e / n
} : function(e) {
return e * n
},
symbol: e
}
}
function ze(e) {
var t = e.decimal,
n = e.thousands,
r = e.grouping,
o = e.currency,
i = r && n ? function(e, t) {
for (var o = e.length, i = [], a = 0, s = r[0], l = 0; o > 0 && s > 0 && (l + s + 1 > t && (s = Math.max(1, t - l)), i.push(e.substring(o -= s, o + s)), !((l += s + 1) > t));) s = r[a = (a + 1) % r.length];
return i.reverse().join(n)
} : w;
return function(e) {
var n = cs.exec(e),
r = n[1] || " ",
a = n[2] || ">",
s = n[3] || "-",
l = n[4] || "",
c = n[5],
u = +n[6],
d = n[7],
f = n[8],
m = n[9],
p = 1,
g = "",
v = "",
h = !1,
y = !0;
switch (f && (f = +f.substring(1)), (c || "0" === r && "=" === a) && (c = r = "0", a = "="), m) {
case "n":
d = !0, m = "g";
break;
case "%":
p = 100, v = "%", m = "f";
break;
case "p":
p = 100, v = "%", m = "r";
break;
case "b":
case "o":
case "x":
case "X":
"#" === l && (g = "0" + m.toLowerCase());
case "c":
y = !1;
case "d":
h = !0, f = 0;
break;
case "s":
p = -1, m = "r"
}
"$" === l && (g = o[0], v = o[1]), "r" != m || f || (m = "g"), null != f && ("g" == m ? f = Math.max(1, Math.min(21, f)) : "e" != m && "f" != m || (f = Math.max(0, Math.min(20, f)))), m = us.get(m) || Be;
var b = c && d;
return function(e) {
var n = v;
if (h && e % 1) return "";
var o = e < 0 || 0 === e && 1 / e < 0 ? (e = -e, "-") : "-" === s ? "" : s;
if (p < 0) {
var l = sa.formatPrefix(e, f);
e = l.scale(e), n = l.symbol + v
} else e *= p;
e = m(e, f);
var E, S, _ = e.lastIndexOf(".");
if (_ < 0) {
var w = y ? e.lastIndexOf("e") : -1;
w < 0 ? (E = e, S = "") : (E = e.substring(0, w), S = e.substring(w))
} else E = e.substring(0, _), S = t + e.substring(_ + 1);
!c && d && (E = i(E, 1 / 0));
var A = g.length + E.length + S.length + (b ? 0 : o.length),
T = A < u ? new Array(A = u - A + 1).join(r) : "";
return b && (E = i(T + E, T.length ? u - S.length : 1 / 0)), o += g, e = E + S, ("<" === a ? o + e + T : ">" === a ? T + o + e : "^" === a ? T.substring(0, A >>= 1) + o + e + T.substring(A) : o + (b ? e : T + e)) + n
}
}
}
function Be(e) {
return e + ""
}
function $e() {
this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0])
}
function We(e, t, n) {
function r(t) {
var n = e(t),
r = i(n, 1);
return t - n < r - t ? n : r
}
function o(n) {
return t(n = e(new fs(n - 1)), 1), n
}
function i(e, n) {
return t(e = new fs(+e), n), e
}
function a(e, r, i) {
var a = o(e),
s = [];
if (i > 1)
for (; a < r;) n(a) % i || s.push(new Date(+a)), t(a, 1);
else
for (; a < r;) s.push(new Date(+a)), t(a, 1);
return s
}
function s(e, t, n) {
try {
fs = $e;
var r = new $e;
return r._ = e, a(r, t, n)
} finally {
fs = Date
}
}
e.floor = e, e.round = r, e.ceil = o, e.offset = i, e.range = a;
var l = e.utc = He(e);
return l.floor = l, l.round = He(r), l.ceil = He(o), l.offset = He(i), l.range = s, e
}
function He(e) {
return function(t, n) {
try {
fs = $e;
var r = new $e;
return r._ = t, e(r, n)._
} finally {
fs = Date
}
}
}
function je(e) {
function t(e) {
function t(t) {
for (var n, o, i, a = [], s = -1, l = 0; ++s < r;) 37 === e.charCodeAt(s) && (a.push(e.slice(l, s)), null != (o = ps[n = e.charAt(++s)]) && (n = e.charAt(++s)), (i = x[n]) && (n = i(t, null == o ? "e" === n ? " " : "0" : o)), a.push(n), l = s + 1);
return a.push(e.slice(l, s)), a.join("")
}
var r = e.length;
return t.parse = function(t) {
var r = {
y: 1900,
m: 0,
d: 1,
H: 0,
M: 0,
S: 0,
L: 0,
Z: null
},
o = n(r, e, t, 0);
if (o != t.length) return null;
"p" in r && (r.H = r.H % 12 + 12 * r.p);
var i = null != r.Z && fs !== $e,
a = new(i ? $e : fs);
return "j" in r ? a.setFullYear(r.y, 0, r.j) : "w" in r && ("W" in r || "U" in r) ? (a.setFullYear(r.y, 0, 1), a.setFullYear(r.y, 0, "W" in r ? (r.w + 6) % 7 + 7 * r.W - (a.getDay() + 5) % 7 : r.w + 7 * r.U - (a.getDay() + 6) % 7)) : a.setFullYear(r.y, r.m, r.d), a.setHours(r.H + (r.Z / 100 | 0), r.M + r.Z % 100, r.S, r.L), i ? a._ : a
}, t.toString = function() {
return e
}, t
}
function n(e, t, n, r) {
for (var o, i, a, s = 0, l = t.length, c = n.length; s < l;) {
if (r >= c) return -1;
if (o = t.charCodeAt(s++), 37 === o) {
if (a = t.charAt(s++), i = D[a in ps ? t.charAt(s++) : a], !i || (r = i(e, n, r)) < 0) return -1
} else if (o != n.charCodeAt(r++)) return -1
}
return r
}
function r(e, t, n) {
_.lastIndex = 0;
var r = _.exec(t.slice(n));
return r ? (e.w = w.get(r[0].toLowerCase()), n + r[0].length) : -1
}
function o(e, t, n) {
E.lastIndex = 0;
var r = E.exec(t.slice(n));
return r ? (e.w = S.get(r[0].toLowerCase()), n + r[0].length) : -1
}
function i(e, t, n) {
C.lastIndex = 0;
var r = C.exec(t.slice(n));
return r ? (e.m = I.get(r[0].toLowerCase()), n + r[0].length) : -1
}
function a(e, t, n) {
A.lastIndex = 0;
var r = A.exec(t.slice(n));
return r ? (e.m = T.get(r[0].toLowerCase()), n + r[0].length) : -1
}
function s(e, t, r) {
return n(e, x.c.toString(), t, r)
}
function l(e, t, r) {
return n(e, x.x.toString(), t, r)
}
function c(e, t, r) {
return n(e, x.X.toString(), t, r)
}
function u(e, t, n) {
var r = b.get(t.slice(n, n += 2).toLowerCase());
return null == r ? -1 : (e.p = r, n)
}
var d = e.dateTime,
f = e.date,
m = e.time,
p = e.periods,
g = e.days,
v = e.shortDays,
h = e.months,
y = e.shortMonths;
t.utc = function(e) {
function n(e) {
try {
fs = $e;
var t = new fs;
return t._ = e, r(t)
} finally {
fs = Date
}
}
var r = t(e);
return n.parse = function(e) {
try {
fs = $e;
var t = r.parse(e);
return t && t._
} finally {
fs = Date
}
}, n.toString = r.toString, n
}, t.multi = t.utc.multi = ft;
var b = sa.map(),
E = qe(g),
S = Ke(g),
_ = qe(v),
w = Ke(v),
A = qe(h),
T = Ke(h),
C = qe(y),
I = Ke(y);
p.forEach(function(e, t) {
b.set(e.toLowerCase(), t)
});
var x = {
a: function(e) {
return v[e.getDay()]
},
A: function(e) {
return g[e.getDay()]
},
b: function(e) {
return y[e.getMonth()]
},
B: function(e) {
return h[e.getMonth()]
},
c: t(d),
d: function(e, t) {
return Ye(e.getDate(), t, 2)
},
e: function(e, t) {
return Ye(e.getDate(), t, 2)
},
H: function(e, t) {
return Ye(e.getHours(), t, 2)
},
I: function(e, t) {
return Ye(e.getHours() % 12 || 12, t, 2)
},
j: function(e, t) {
return Ye(1 + ds.dayOfYear(e), t, 3)
},
L: function(e, t) {
return Ye(e.getMilliseconds(), t, 3)
},
m: function(e, t) {
return Ye(e.getMonth() + 1, t, 2)
},
M: function(e, t) {
return Ye(e.getMinutes(), t, 2)
},
p: function(e) {
return p[+(e.getHours() >= 12)]
},
S: function(e, t) {
return Ye(e.getSeconds(), t, 2)
},
U: function(e, t) {
return Ye(ds.sundayOfYear(e), t, 2)
},
w: function(e) {
return e.getDay()
},
W: function(e, t) {
return Ye(ds.mondayOfYear(e), t, 2)
},
x: t(f),
X: t(m),
y: function(e, t) {
return Ye(e.getFullYear() % 100, t, 2)
},
Y: function(e, t) {
return Ye(e.getFullYear() % 1e4, t, 4)
},
Z: ut,
"%": function() {
return "%"
}
},
D = {
a: r,
A: o,
b: i,
B: a,
c: s,
d: ot,
e: ot,
H: at,
I: at,
j: it,
L: ct,
m: rt,
M: st,
p: u,
S: lt,
U: Qe,
w: Ze,
W: Xe,
x: l,
X: c,
y: et,
Y: Je,
Z: tt,
"%": dt
};
return t
}
function Ye(e, t, n) {
var r = e < 0 ? "-" : "",
o = (r ? -e : e) + "",
i = o.length;
return r + (i < n ? new Array(n - i + 1).join(t) + o : o)
}
function qe(e) {
return new RegExp("^(?:" + e.map(sa.requote).join("|") + ")", "i")
}
function Ke(e) {
for (var t = new p, n = -1, r = e.length; ++n < r;) t.set(e[n].toLowerCase(), n);
return t
}
function Ze(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 1));
return r ? (e.w = +r[0], n + r[0].length) : -1
}
function Qe(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n));
return r ? (e.U = +r[0], n + r[0].length) : -1
}
function Xe(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n));
return r ? (e.W = +r[0], n + r[0].length) : -1
}
function Je(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 4));
return r ? (e.y = +r[0], n + r[0].length) : -1
}
function et(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 2));
return r ? (e.y = nt(+r[0]), n + r[0].length) : -1
}
function tt(e, t, n) {
return /^[+-]\d{4}$/.test(t = t.slice(n, n + 5)) ? (e.Z = -t, n + 5) : -1
}
function nt(e) {
return e + (e > 68 ? 1900 : 2e3)
}
function rt(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 2));
return r ? (e.m = r[0] - 1, n + r[0].length) : -1
}
function ot(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 2));
return r ? (e.d = +r[0], n + r[0].length) : -1
}
function it(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 3));
return r ? (e.j = +r[0], n + r[0].length) : -1
}
function at(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 2));
return r ? (e.H = +r[0], n + r[0].length) : -1
}
function st(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 2));
return r ? (e.M = +r[0], n + r[0].length) : -1
}
function lt(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 2));
return r ? (e.S = +r[0], n + r[0].length) : -1
}
function ct(e, t, n) {
gs.lastIndex = 0;
var r = gs.exec(t.slice(n, n + 3));
return r ? (e.L = +r[0], n + r[0].length) : -1
}
function ut(e) {
var t = e.getTimezoneOffset(),
n = t > 0 ? "-" : "+",
r = ha(t) / 60 | 0,
o = ha(t) % 60;
return n + Ye(r, "0", 2) + Ye(o, "0", 2)
}
function dt(e, t, n) {
vs.lastIndex = 0;
var r = vs.exec(t.slice(n, n + 1));
return r ? n + r[0].length : -1
}
function ft(e) {
for (var t = e.length, n = -1; ++n < t;) e[n][0] = this(e[n][0]);
return function(t) {
for (var n = 0, r = e[n]; !r[1](t);) r = e[++n];
return r[0](t)
}
}
function mt() {}
function pt(e, t, n) {
var r = n.s = e + t,
o = r - e,
i = r - o;
n.t = e - i + (t - o)
}
function gt(e, t) {
e && Es.hasOwnProperty(e.type) && Es[e.type](e, t)
}
function vt(e, t, n) {
var r, o = -1,
i = e.length - n;
for (t.lineStart(); ++o < i;) r = e[o], t.point(r[0], r[1], r[2]);
t.lineEnd()
}
function ht(e, t) {
var n = -1,
r = e.length;
for (t.polygonStart(); ++n < r;) vt(e[n], t, 1);
t.polygonEnd()
}
function yt() {
function e(e, t) {
e *= Ua, t = t * Ua / 2 + ka / 4;
var n = e - r,
a = n >= 0 ? 1 : -1,
s = a * n,
l = Math.cos(t),
c = Math.sin(t),
u = i * c,
d = o * l + u * Math.cos(s),
f = u * a * Math.sin(s);
_s.add(Math.atan2(f, d)), r = e, o = l, i = c
}
var t, n, r, o, i;
ws.point = function(a, s) {
ws.point = e, r = (t = a) * Ua, o = Math.cos(s = (n = s) * Ua / 2 + ka / 4), i = Math.sin(s)
}, ws.lineEnd = function() {
e(t, n)
}
}
function bt(e) {
var t = e[0],
n = e[1],
r = Math.cos(n);
return [r * Math.cos(t), r * Math.sin(t), Math.sin(n)]
}
function Et(e, t) {
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2]
}
function St(e, t) {
return [e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2], e[0] * t[1] - e[1] * t[0]]
}
function _t(e, t) {
e[0] += t[0], e[1] += t[1], e[2] += t[2]
}
function wt(e, t) {
return [e[0] * t, e[1] * t, e[2] * t]
}
function At(e) {
var t = Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]);
e[0] /= t, e[1] /= t, e[2] /= t
}
function Tt(e) {
return [Math.atan2(e[1], e[0]), ae(e[2])]
}
function Ct(e, t) {
return ha(e[0] - t[0]) < Na && ha(e[1] - t[1]) < Na
}
function It(e, t) {
e *= Ua;
var n = Math.cos(t *= Ua);
xt(n * Math.cos(e), n * Math.sin(e), Math.sin(t))
}
function xt(e, t, n) {
++As, Cs += (e - Cs) / As, Is += (t - Is) / As, xs += (n - xs) / As
}
function Dt() {
function e(e, o) {
e *= Ua;
var i = Math.cos(o *= Ua),
a = i * Math.cos(e),
s = i * Math.sin(e),
l = Math.sin(o),
c = Math.atan2(Math.sqrt((c = n * l - r * s) * c + (c = r * a - t * l) * c + (c = t * s - n * a) * c), t * a + n * s + r * l);
Ts += c, Ds += c * (t + (t = a)), Ms += c * (n + (n = s)), Os += c * (r + (r = l)), xt(t, n, r)
}
var t, n, r;
ks.point = function(o, i) {
o *= Ua;
var a = Math.cos(i *= Ua);
t = a * Math.cos(o), n = a * Math.sin(o), r = Math.sin(i), ks.point = e, xt(t, n, r)
}
}
function Mt() {
ks.point = It
}
function Ot() {
function e(e, t) {
e *= Ua;
var n = Math.cos(t *= Ua),
a = n * Math.cos(e),
s = n * Math.sin(e),
l = Math.sin(t),
c = o * l - i * s,
u = i * a - r * l,
d = r * s - o * a,
f = Math.sqrt(c * c + u * u + d * d),
m = r * a + o * s + i * l,
p = f && -ie(m) / f,
g = Math.atan2(f, m);
Rs += p * c, Ns += p * u, Ls += p * d, Ts += g, Ds += g * (r + (r = a)), Ms += g * (o + (o = s)), Os += g * (i + (i = l)), xt(r, o, i)
}
var t, n, r, o, i;
ks.point = function(a, s) {
t = a, n = s, ks.point = e, a *= Ua;
var l = Math.cos(s *= Ua);
r = l * Math.cos(a), o = l * Math.sin(a), i = Math.sin(s), xt(r, o, i)
}, ks.lineEnd = function() {
e(t, n), ks.lineEnd = Mt, ks.point = It
}
}
function Rt(e, t) {
function n(n, r) {
return n = e(n, r), t(n[0], n[1])
}
return e.invert && t.invert && (n.invert = function(n, r) {
return n = t.invert(n, r), n && e.invert(n[0], n[1])
}), n
}
function Nt() {
return !0
}
function Lt(e, t, n, r, o) {
var i = [],
a = [];
if (e.forEach(function(e) {
if (!((t = e.length - 1) <= 0)) {
var t, n = e[0],
r = e[t];
if (Ct(n, r)) {
o.lineStart();
for (var s = 0; s < t; ++s) o.point((n = e[s])[0], n[1]);
return void o.lineEnd()
}
var l = new Pt(n, e, null, !0),
c = new Pt(n, null, l, !1);
l.o = c, i.push(l), a.push(c), l = new Pt(r, e, null, !1), c = new Pt(r, null, l, !0), l.o = c, i.push(l), a.push(c)
}
}), a.sort(t), kt(i), kt(a), i.length) {
for (var s = 0, l = n, c = a.length; s < c; ++s) a[s].e = l = !l;
for (var u, d, f = i[0];;) {
for (var m = f, p = !0; m.v;)
if ((m = m.n) === f) return;
u = m.z, o.lineStart();
do {
if (m.v = m.o.v = !0, m.e) {
if (p)
for (var s = 0, c = u.length; s < c; ++s) o.point((d = u[s])[0], d[1]);
else r(m.x, m.n.x, 1, o);
m = m.n
} else {
if (p) {
u = m.p.z;
for (var s = u.length - 1; s >= 0; --s) o.point((d = u[s])[0], d[1])
} else r(m.x, m.p.x, -1, o);
m = m.p
}
m = m.o, u = m.z, p = !p
} while (!m.v);
o.lineEnd()
}
}
}
function kt(e) {
if (t = e.length) {
for (var t, n, r = 0, o = e[0]; ++r < t;) o.n = n = e[r], n.p = o, o = n;
o.n = n = e[0], n.p = o
}
}
function Pt(e, t, n, r) {
this.x = e, this.z = t, this.o = n, this.e = r, this.v = !1, this.n = this.p = null
}
function Gt(e, t, n, r) {
return function(o, i) {
function a(t, n) {
var r = o(t, n);
e(t = r[0], n = r[1]) && i.point(t, n)
}
function s(e, t) {
var n = o(e, t);
v.point(n[0], n[1])
}
function l() {
y.point = s, v.lineStart()
}
function c() {
y.point = a, v.lineEnd()
}
function u(e, t) {
g.push([e, t]);
var n = o(e, t);
E.point(n[0], n[1])
}
function d() {
E.lineStart(), g = []
}
function f() {
u(g[0][0], g[0][1]), E.lineEnd();
var e, t = E.clean(),
n = b.buffer(),
r = n.length;
if (g.pop(), p.push(g), g = null, r)
if (1 & t) {
e = n[0];
var o, r = e.length - 1,
a = -1;
if (r > 0) {
for (S || (i.polygonStart(), S = !0), i.lineStart(); ++a < r;) i.point((o = e[a])[0], o[1]);
i.lineEnd()
}
} else r > 1 && 2 & t && n.push(n.pop().concat(n.shift())), m.push(n.filter(Ft))
}
var m, p, g, v = t(i),
h = o.invert(r[0], r[1]),
y = {
point: a,
lineStart: l,
lineEnd: c,
polygonStart: function() {
y.point = u, y.lineStart = d, y.lineEnd = f, m = [], p = []
},
polygonEnd: function() {
y.point = a, y.lineStart = l, y.lineEnd = c, m = sa.merge(m);
var e = Wt(h, p);
m.length ? (S || (i.polygonStart(), S = !0), Lt(m, Vt, e, n, i)) : e && (S || (i.polygonStart(), S = !0), i.lineStart(), n(null, null, 1, i), i.lineEnd()), S && (i.polygonEnd(), S = !1), m = p = null
},
sphere: function() {
i.polygonStart(), i.lineStart(), n(null, null, 1, i), i.lineEnd(), i.polygonEnd()
}
},
b = Ut(),
E = t(b),
S = !1;
return y
}
}
function Ft(e) {
return e.length > 1
}
function Ut() {
var e, t = [];
return {
lineStart: function() {
t.push(e = [])
},
point: function(t, n) {
e.push([t, n])
},
lineEnd: C,
buffer: function() {
var n = t;
return t = [], e = null, n
},
rejoin: function() {
t.length > 1 && t.push(t.pop().concat(t.shift()))
}
}
}
function Vt(e, t) {
return ((e = e.x)[0] < 0 ? e[1] - Fa - Na : Fa - e[1]) - ((t = t.x)[0] < 0 ? t[1] - Fa - Na : Fa - t[1])
}
function zt(e) {
var t, n = NaN,
r = NaN,
o = NaN;
return {
lineStart: function() {
e.lineStart(), t = 1
},
point: function(i, a) {
var s = i > 0 ? ka : -ka,
l = ha(i - n);
ha(l - ka) < Na ? (e.point(n, r = (r + a) / 2 > 0 ? Fa : -Fa), e.point(o, r), e.lineEnd(), e.lineStart(), e.point(s, r), e.point(i, r), t = 0) : o !== s && l >= ka && (ha(n - o) < Na && (n -= o * Na), ha(i - s) < Na && (i -= s * Na), r = Bt(n, r, i, a), e.point(o, r), e.lineEnd(), e.lineStart(), e.point(s, r), t = 0), e.point(n = i, r = a), o = s
},
lineEnd: function() {
e.lineEnd(), n = r = NaN
},
clean: function() {
return 2 - t
}
}
}
function Bt(e, t, n, r) {
var o, i, a = Math.sin(e - n);
return ha(a) > Na ? Math.atan((Math.sin(t) * (i = Math.cos(r)) * Math.sin(n) - Math.sin(r) * (o = Math.cos(t)) * Math.sin(e)) / (o * i * a)) : (t + r) / 2
}
function $t(e, t, n, r) {
var o;
if (null == e) o = n * Fa, r.point(-ka, o), r.point(0, o), r.point(ka, o), r.point(ka, 0), r.point(ka, -o), r.point(0, -o), r.point(-ka, -o), r.point(-ka, 0), r.point(-ka, o);
else if (ha(e[0] - t[0]) > Na) {
var i = e[0] < t[0] ? ka : -ka;
o = n * i / 2, r.point(-i, o), r.point(0, o), r.point(i, o)
} else r.point(t[0], t[1])
}
function Wt(e, t) {
var n = e[0],
r = e[1],
o = [Math.sin(n), -Math.cos(n), 0],
i = 0,
a = 0;
_s.reset();
for (var s = 0, l = t.length; s < l; ++s) {
var c = t[s],
u = c.length;
if (u)
for (var d = c[0], f = d[0], m = d[1] / 2 + ka / 4, p = Math.sin(m), g = Math.cos(m), v = 1;;) {
v === u && (v = 0), e = c[v];
var h = e[0],
y = e[1] / 2 + ka / 4,
b = Math.sin(y),
E = Math.cos(y),
S = h - f,
_ = S >= 0 ? 1 : -1,
w = _ * S,
A = w > ka,
T = p * b;
if (_s.add(Math.atan2(T * _ * Math.sin(w), g * E + T * Math.cos(w))), i += A ? S + _ * Pa : S, A ^ f >= n ^ h >= n) {
var C = St(bt(d), bt(e));
At(C);
var I = St(o, C);
At(I);
var x = (A ^ S >= 0 ? -1 : 1) * ae(I[2]);
(r > x || r === x && (C[0] || C[1])) && (a += A ^ S >= 0 ? 1 : -1)
}
if (!v++) break;
f = h, p = b, g = E, d = e
}
}
return (i < -Na || i < Na && _s < 0) ^ 1 & a
}
function Ht(e) {
function t(e, t) {
return Math.cos(e) * Math.cos(t) > i
}
function n(e) {
var n, i, l, c, u;
return {
lineStart: function() {
c = l = !1, u = 1
},
point: function(d, f) {
var m, p = [d, f],
g = t(d, f),
v = a ? g ? 0 : o(d, f) : g ? o(d + (d < 0 ? ka : -ka), f) : 0;
if (!n && (c = l = g) && e.lineStart(), g !== l && (m = r(n, p), (Ct(n, m) || Ct(p, m)) && (p[0] += Na, p[1] += Na, g = t(p[0], p[1]))), g !== l) u = 0, g ? (e.lineStart(), m = r(p, n), e.point(m[0], m[1])) : (m = r(n, p), e.point(m[0], m[1]), e.lineEnd()), n = m;
else if (s && n && a ^ g) {
var h;
v & i || !(h = r(p, n, !0)) || (u = 0, a ? (e.lineStart(), e.point(h[0][0], h[0][1]), e.point(h[1][0], h[1][1]), e.lineEnd()) : (e.point(h[1][0], h[1][1]), e.lineEnd(), e.lineStart(), e.point(h[0][0], h[0][1])))
}!g || n && Ct(n, p) || e.point(p[0], p[1]), n = p, l = g, i = v
},
lineEnd: function() {
l && e.lineEnd(), n = null
},
clean: function() {
return u | (c && l) << 1
}
}
}
function r(e, t, n) {
var r = bt(e),
o = bt(t),
a = [1, 0, 0],
s = St(r, o),
l = Et(s, s),
c = s[0],
u = l - c * c;
if (!u) return !n && e;
var d = i * l / u,
f = -i * c / u,
m = St(a, s),
p = wt(a, d),
g = wt(s, f);
_t(p, g);
var v = m,
h = Et(p, v),
y = Et(v, v),
b = h * h - y * (Et(p, p) - 1);
if (!(b < 0)) {
var E = Math.sqrt(b),
S = wt(v, (-h - E) / y);
if (_t(S, p), S = Tt(S), !n) return S;
var _, w = e[0],
A = t[0],
T = e[1],
C = t[1];
A < w && (_ = w, w = A, A = _);
var I = A - w,
x = ha(I - ka) < Na,
D = x || I < Na;
if (!x && C < T && (_ = T, T = C, C = _), D ? x ? T + C > 0 ^ S[1] < (ha(S[0] - w) < Na ? T : C) : T <= S[1] && S[1] <= C : I > ka ^ (w <= S[0] && S[0] <= A)) {
var M = wt(v, (-h + E) / y);
return _t(M, p), [S, Tt(M)]
}
}
}
function o(t, n) {
var r = a ? e : ka - e,
o = 0;
return t < -r ? o |= 1 : t > r && (o |= 2), n < -r ? o |= 4 : n > r && (o |= 8), o
}
var i = Math.cos(e),
a = i > 0,
s = ha(i) > Na,
l = bn(e, 6 * Ua);
return Gt(t, n, l, a ? [0, -e] : [-ka, e - ka])
}
function jt(e, t, n, r) {
return function(o) {
var i, a = o.a,
s = o.b,
l = a.x,
c = a.y,
u = s.x,
d = s.y,
f = 0,
m = 1,
p = u - l,
g = d - c;
if (i = e - l, p || !(i > 0)) {
if (i /= p, p < 0) {
if (i < f) return;
i < m && (m = i)
} else if (p > 0) {
if (i > m) return;
i > f && (f = i)
}
if (i = n - l, p || !(i < 0)) {
if (i /= p, p < 0) {
if (i > m) return;
i > f && (f = i)
} else if (p > 0) {
if (i < f) return;
i < m && (m = i)
}
if (i = t - c, g || !(i > 0)) {
if (i /= g, g < 0) {
if (i < f) return;
i < m && (m = i)
} else if (g > 0) {
if (i > m) return;
i > f && (f = i)
}
if (i = r - c, g || !(i < 0)) {
if (i /= g, g < 0) {
if (i > m) return;
i > f && (f = i)
} else if (g > 0) {
if (i < f) return;
i < m && (m = i)
}
return f > 0 && (o.a = {
x: l + f * p,
y: c + f * g
}), m < 1 && (o.b = {
x: l + m * p,
y: c + m * g
}), o
}
}
}
}
}
}
function Yt(e, t, n, r) {
function o(r, o) {
return ha(r[0] - e) < Na ? o > 0 ? 0 : 3 : ha(r[0] - n) < Na ? o > 0 ? 2 : 1 : ha(r[1] - t) < Na ? o > 0 ? 1 : 0 : o > 0 ? 3 : 2
}
function i(e, t) {
return a(e.x, t.x)
}
function a(e, t) {
var n = o(e, 1),
r = o(t, 1);
return n !== r ? n - r : 0 === n ? t[1] - e[1] : 1 === n ? e[0] - t[0] : 2 === n ? e[1] - t[1] : t[0] - e[0]
}
return function(s) {
function l(e) {
for (var t = 0, n = v.length, r = e[1], o = 0; o < n; ++o)
for (var i, a = 1, s = v[o], l = s.length, c = s[0]; a < l; ++a) i = s[a], c[1] <= r ? i[1] > r && oe(c, i, e) > 0 && ++t : i[1] <= r && oe(c, i, e) < 0 && --t, c = i;
return 0 !== t
}
function c(i, s, l, c) {
var u = 0,
d = 0;
if (null == i || (u = o(i, l)) !== (d = o(s, l)) || a(i, s) < 0 ^ l > 0) {
do c.point(0 === u || 3 === u ? e : n, u > 1 ? r : t); while ((u = (u + l + 4) % 4) !== d)
} else c.point(s[0], s[1])
}
function u(o, i) {
return e <= o && o <= n && t <= i && i <= r
}
function d(e, t) {
u(e, t) && s.point(e, t)
}
function f() {
D.point = p, v && v.push(h = []), A = !0, w = !1, S = _ = NaN
}
function m() {
g && (p(y, b), E && w && I.rejoin(), g.push(I.buffer())), D.point = d, w && s.lineEnd()
}
function p(e, t) {
e = Math.max(-Gs, Math.min(Gs, e)), t = Math.max(-Gs, Math.min(Gs, t));
var n = u(e, t);
if (v && h.push([e, t]), A) y = e, b = t, E = n, A = !1, n && (s.lineStart(), s.point(e, t));
else if (n && w) s.point(e, t);
else {
var r = {
a: {
x: S,
y: _
},
b: {
x: e,
y: t
}
};
x(r) ? (w || (s.lineStart(), s.point(r.a.x, r.a.y)), s.point(r.b.x, r.b.y), n || s.lineEnd(), T = !1) : n && (s.lineStart(), s.point(e, t), T = !1)
}
S = e, _ = t, w = n
}
var g, v, h, y, b, E, S, _, w, A, T, C = s,
I = Ut(),
x = jt(e, t, n, r),
D = {
point: d,
lineStart: f,
lineEnd: m,
polygonStart: function() {
s = I, g = [], v = [], T = !0
},
polygonEnd: function() {
s = C, g = sa.merge(g);
var t = l([e, r]),
n = T && t,
o = g.length;
(n || o) && (s.polygonStart(), n && (s.lineStart(), c(null, null, 1, s), s.lineEnd()), o && Lt(g, i, t, c, s), s.polygonEnd()), g = v = h = null
}
};
return D
}
}
function qt(e) {
var t = 0,
n = ka / 3,
r = dn(e),
o = r(t, n);
return o.parallels = function(e) {
return arguments.length ? r(t = e[0] * ka / 180, n = e[1] * ka / 180) : [t / ka * 180, n / ka * 180]
}, o
}
function Kt(e, t) {
function n(e, t) {
var n = Math.sqrt(i - 2 * o * Math.sin(t)) / o;
return [n * Math.sin(e *= o), a - n * Math.cos(e)]
}
var r = Math.sin(e),
o = (r + Math.sin(t)) / 2,
i = 1 + r * (2 * o - r),
a = Math.sqrt(i) / o;
return n.invert = function(e, t) {
var n = a - t;
return [Math.atan2(e, n) / o, ae((i - (e * e + n * n) * o * o) / (2 * o))]
}, n
}
function Zt() {
function e(e, t) {
Us += o * e - r * t, r = e, o = t
}
var t, n, r, o;
Ws.point = function(i, a) {
Ws.point = e, t = r = i, n = o = a
}, Ws.lineEnd = function() {
e(t, n)
}
}
function Qt(e, t) {
e < Vs && (Vs = e), e > Bs && (Bs = e), t < zs && (zs = t), t > $s && ($s = t)
}
function Xt() {
function e(e, t) {
a.push("M", e, ",", t, i)
}
function t(e, t) {
a.push("M", e, ",", t), s.point = n
}
function n(e, t) {
a.push("L", e, ",", t)
}
function r() {
s.point = e
}
function o() {
a.push("Z")
}
var i = Jt(4.5),
a = [],
s = {
point: e,
lineStart: function() {
s.point = t
},
lineEnd: r,
polygonStart: function() {
s.lineEnd = o
},
polygonEnd: function() {
s.lineEnd = r, s.point = e
},
pointRadius: function(e) {
return i = Jt(e), s
},
result: function() {
if (a.length) {
var e = a.join("");
return a = [], e
}
}
};
return s
}
function Jt(e) {
return "m0," + e + "a" + e + "," + e + " 0 1,1 0," + -2 * e + "a" + e + "," + e + " 0 1,1 0," + 2 * e + "z"
}
function en(e, t) {
Cs += e, Is += t, ++xs
}
function tn() {
function e(e, r) {
var o = e - t,
i = r - n,
a = Math.sqrt(o * o + i * i);
Ds += a * (t + e) / 2, Ms += a * (n + r) / 2, Os += a, en(t = e, n = r)
}
var t, n;
js.point = function(r, o) {
js.point = e, en(t = r, n = o)
}
}
function nn() {
js.point = en
}
function rn() {
function e(e, t) {
var n = e - r,
i = t - o,
a = Math.sqrt(n * n + i * i);
Ds += a * (r + e) / 2, Ms += a * (o + t) / 2, Os += a, a = o * e - r * t, Rs += a * (r + e), Ns += a * (o + t), Ls += 3 * a, en(r = e, o = t)
}
var t, n, r, o;
js.point = function(i, a) {
js.point = e, en(t = r = i, n = o = a)
}, js.lineEnd = function() {
e(t, n)
}
}
function on(e) {
function t(t, n) {
e.moveTo(t + a, n), e.arc(t, n, a, 0, Pa)
}
function n(t, n) {
e.moveTo(t, n), s.point = r
}
function r(t, n) {
e.lineTo(t, n)
}
function o() {
s.point = t
}
function i() {
e.closePath()
}
var a = 4.5,
s = {
point: t,
lineStart: function() {
s.point = n
},
lineEnd: o,
polygonStart: function() {
s.lineEnd = i
},
polygonEnd: function() {
s.lineEnd = o, s.point = t
},
pointRadius: function(e) {
return a = e, s
},
result: C
};
return s
}
function an(e) {
function t(e) {
return (s ? r : n)(e)
}
function n(t) {
return cn(t, function(n, r) {
n = e(n, r), t.point(n[0], n[1])
})
}
function r(t) {
function n(n, r) {
n = e(n, r), t.point(n[0], n[1])
}
function r() {
b = NaN, A.point = i, t.lineStart()
}
function i(n, r) {
var i = bt([n, r]),
a = e(n, r);
o(b, E, y, S, _, w, b = a[0], E = a[1], y = n, S = i[0], _ = i[1], w = i[2], s, t), t.point(b, E)
}
function a() {
A.point = n, t.lineEnd()
}
function l() {
r(), A.point = c, A.lineEnd = u
}
function c(e, t) {
i(d = e, f = t), m = b, p = E, g = S, v = _, h = w, A.point = i
}
function u() {
o(b, E, y, S, _, w, m, p, d, g, v, h, s, t), A.lineEnd = a, a()
}
var d, f, m, p, g, v, h, y, b, E, S, _, w, A = {
point: n,
lineStart: r,
lineEnd: a,
polygonStart: function() {
t.polygonStart(), A.lineStart = l
},
polygonEnd: function() {
t.polygonEnd(), A.lineStart = r
}
};
return A
}
function o(t, n, r, s, l, c, u, d, f, m, p, g, v, h) {
var y = u - t,
b = d - n,
E = y * y + b * b;
if (E > 4 * i && v--) {
var S = s + m,
_ = l + p,
w = c + g,
A = Math.sqrt(S * S + _ * _ + w * w),
T = Math.asin(w /= A),
C = ha(ha(w) - 1) < Na || ha(r - f) < Na ? (r + f) / 2 : Math.atan2(_, S),
I = e(C, T),
x = I[0],
D = I[1],
M = x - t,
O = D - n,
R = b * M - y * O;
(R * R / E > i || ha((y * M + b * O) / E - .5) > .3 || s * m + l * p + c * g < a) && (o(t, n, r, s, l, c, x, D, C, S /= A, _ /= A, w, v, h), h.point(x, D), o(x, D, C, S, _, w, u, d, f, m, p, g, v, h))
}
}
var i = .5,
a = Math.cos(30 * Ua),
s = 16;
return t.precision = function(e) {
return arguments.length ? (s = (i = e * e) > 0 && 16, t) : Math.sqrt(i)
}, t
}
function sn(e) {
var t = an(function(t, n) {
return e([t * Va, n * Va])
});
return function(e) {
return fn(t(e))
}
}
function ln(e) {
this.stream = e
}
function cn(e, t) {
return {
point: t,
sphere: function() {
e.sphere()
},
lineStart: function() {
e.lineStart()
},
lineEnd: function() {
e.lineEnd()
},
polygonStart: function() {
e.polygonStart()
},
polygonEnd: function() {
e.polygonEnd()
}
}
}
function un(e) {
return dn(function() {
return e
})()
}
function dn(e) {
function t(e) {
return e = s(e[0] * Ua, e[1] * Ua), [e[0] * f + l, c - e[1] * f]
}
function n(e) {
return e = s.invert((e[0] - l) / f, (c - e[1]) / f), e && [e[0] * Va, e[1] * Va]
}
function r() {
s = Rt(a = gn(h, y, b), i);
var e = i(g, v);
return l = m - e[0] * f, c = p + e[1] * f, o()
}
function o() {
return u && (u.valid = !1, u = null), t
}
var i, a, s, l, c, u, d = an(function(e, t) {
return e = i(e, t), [e[0] * f + l, c - e[1] * f]
}),
f = 150,
m = 480,
p = 250,
g = 0,
v = 0,
h = 0,
y = 0,
b = 0,
E = Ps,
S = w,
_ = null,
A = null;
return t.stream = function(e) {
return u && (u.valid = !1), u = fn(E(a, d(S(e)))), u.valid = !0, u
}, t.clipAngle = function(e) {
return arguments.length ? (E = null == e ? (_ = e, Ps) : Ht((_ = +e) * Ua), o()) : _
}, t.clipExtent = function(e) {
return arguments.length ? (A = e, S = e ? Yt(e[0][0], e[0][1], e[1][0], e[1][1]) : w, o()) : A
}, t.scale = function(e) {
return arguments.length ? (f = +e, r()) : f
}, t.translate = function(e) {
return arguments.length ? (m = +e[0], p = +e[1], r()) : [m, p]
}, t.center = function(e) {
return arguments.length ? (g = e[0] % 360 * Ua, v = e[1] % 360 * Ua, r()) : [g * Va, v * Va]
}, t.rotate = function(e) {
return arguments.length ? (h = e[0] % 360 * Ua, y = e[1] % 360 * Ua, b = e.length > 2 ? e[2] % 360 * Ua : 0, r()) : [h * Va, y * Va, b * Va]
}, sa.rebind(t, d, "precision"),
function() {
return i = e.apply(this, arguments), t.invert = i.invert && n, r()
}
}
function fn(e) {
return cn(e, function(t, n) {
e.point(t * Ua, n * Ua)
})
}
function mn(e, t) {
return [e, t]
}
function pn(e, t) {
return [e > ka ? e - Pa : e < -ka ? e + Pa : e, t]
}
function gn(e, t, n) {
return e ? t || n ? Rt(hn(e), yn(t, n)) : hn(e) : t || n ? yn(t, n) : pn
}
function vn(e) {
return function(t, n) {
return t += e, [t > ka ? t - Pa : t < -ka ? t + Pa : t, n]
}
}
function hn(e) {
var t = vn(e);
return t.invert = vn(-e), t
}
function yn(e, t) {
function n(e, t) {
var n = Math.cos(t),
s = Math.cos(e) * n,
l = Math.sin(e) * n,
c = Math.sin(t),
u = c * r + s * o;
return [Math.atan2(l * i - u * a, s * r - c * o), ae(u * i + l * a)]
}
var r = Math.cos(e),
o = Math.sin(e),
i = Math.cos(t),
a = Math.sin(t);
return n.invert = function(e, t) {
var n = Math.cos(t),
s = Math.cos(e) * n,
l = Math.sin(e) * n,
c = Math.sin(t),
u = c * i - l * a;
return [Math.atan2(l * i + c * a, s * r + u * o), ae(u * r - s * o)]
}, n
}
function bn(e, t) {
var n = Math.cos(e),
r = Math.sin(e);
return function(o, i, a, s) {
var l = a * t;
null != o ? (o = En(n, o), i = En(n, i), (a > 0 ? o < i : o > i) && (o += a * Pa)) : (o = e + a * Pa, i = e - .5 * l);
for (var c, u = o; a > 0 ? u > i : u < i; u -= l) s.point((c = Tt([n, -r * Math.cos(u), -r * Math.sin(u)]))[0], c[1])
}
}
function En(e, t) {
var n = bt(t);
n[0] -= e, At(n);
var r = ie(-n[1]);
return ((-n[2] < 0 ? -r : r) + 2 * Math.PI - Na) % (2 * Math.PI)
}
function Sn(e, t, n) {
var r = sa.range(e, t - Na, n).concat(t);
return function(e) {
return r.map(function(t) {
return [e, t]
})
}
}
function _n(e, t, n) {
var r = sa.range(e, t - Na, n).concat(t);
return function(e) {
return r.map(function(t) {
return [t, e]
})
}
}
function wn(e) {
return e.source
}
function An(e) {
return e.target
}
function Tn(e, t, n, r) {
var o = Math.cos(t),
i = Math.sin(t),
a = Math.cos(r),
s = Math.sin(r),
l = o * Math.cos(e),
c = o * Math.sin(e),
u = a * Math.cos(n),
d = a * Math.sin(n),
f = 2 * Math.asin(Math.sqrt(ue(r - t) + o * a * ue(n - e))),
m = 1 / Math.sin(f),
p = f ? function(e) {
var t = Math.sin(e *= f) * m,
n = Math.sin(f - e) * m,
r = n * l + t * u,
o = n * c + t * d,
a = n * i + t * s;
return [Math.atan2(o, r) * Va, Math.atan2(a, Math.sqrt(r * r + o * o)) * Va]
} : function() {
return [e * Va, t * Va]
};
return p.distance = f, p
}
function Cn() {
function e(e, o) {
var i = Math.sin(o *= Ua),
a = Math.cos(o),
s = ha((e *= Ua) - t),
l = Math.cos(s);
Ys += Math.atan2(Math.sqrt((s = a * Math.sin(s)) * s + (s = r * i - n * a * l) * s), n * i + r * a * l), t = e, n = i, r = a
}
var t, n, r;
qs.point = function(o, i) {
t = o * Ua, n = Math.sin(i *= Ua), r = Math.cos(i), qs.point = e
}, qs.lineEnd = function() {
qs.point = qs.lineEnd = C
}
}
function In(e, t) {
function n(t, n) {
var r = Math.cos(t),
o = Math.cos(n),
i = e(r * o);
return [i * o * Math.sin(t), i * Math.sin(n)]
}
return n.invert = function(e, n) {
var r = Math.sqrt(e * e + n * n),
o = t(r),
i = Math.sin(o),
a = Math.cos(o);
return [Math.atan2(e * i, r * a), Math.asin(r && n * i / r)]
}, n
}
function xn(e, t) {
function n(e, t) {
a > 0 ? t < -Fa + Na && (t = -Fa + Na) : t > Fa - Na && (t = Fa - Na);
var n = a / Math.pow(o(t), i);
return [n * Math.sin(i * e), a - n * Math.cos(i * e)]
}
var r = Math.cos(e),
o = function(e) {
return Math.tan(ka / 4 + e / 2)
},
i = e === t ? Math.sin(e) : Math.log(r / Math.cos(t)) / Math.log(o(t) / o(e)),
a = r * Math.pow(o(e), i) / i;
return i ? (n.invert = function(e, t) {
var n = a - t,
r = re(i) * Math.sqrt(e * e + n * n);
return [Math.atan2(e, n) / i, 2 * Math.atan(Math.pow(a / r, 1 / i)) - Fa]
}, n) : Mn
}
function Dn(e, t) {
function n(e, t) {
var n = i - t;
return [n * Math.sin(o * e), i - n * Math.cos(o * e)]
}
var r = Math.cos(e),
o = e === t ? Math.sin(e) : (r - Math.cos(t)) / (t - e),
i = r / o + e;
return ha(o) < Na ? mn : (n.invert = function(e, t) {
var n = i - t;
return [Math.atan2(e, n) / o, i - re(o) * Math.sqrt(e * e + n * n)]
}, n)
}
function Mn(e, t) {
return [e, Math.log(Math.tan(ka / 4 + t / 2))]
}
function On(e) {
var t, n = un(e),
r = n.scale,
o = n.translate,
i = n.clipExtent;
return n.scale = function() {
var e = r.apply(n, arguments);
return e === n ? t ? n.clipExtent(null) : n : e
}, n.translate = function() {
var e = o.apply(n, arguments);
return e === n ? t ? n.clipExtent(null) : n : e
}, n.clipExtent = function(e) {
var a = i.apply(n, arguments);
if (a === n) {
if (t = null == e) {
var s = ka * r(),
l = o();
i([
[l[0] - s, l[1] - s],
[l[0] + s, l[1] + s]
])
}
} else t && (a = null);
return a
}, n.clipExtent(null)
}
function Rn(e, t) {
return [Math.log(Math.tan(ka / 4 + t / 2)), -e]
}
function Nn(e) {
return e[0]
}
function Ln(e) {
return e[1]
}
function kn(e) {
for (var t = e.length, n = [0, 1], r = 2, o = 2; o < t; o++) {
for (; r > 1 && oe(e[n[r - 2]], e[n[r - 1]], e[o]) <= 0;) --r;
n[r++] = o
}
return n.slice(0, r)
}
function Pn(e, t) {
return e[0] - t[0] || e[1] - t[1]
}
function Gn(e, t, n) {
return (n[0] - t[0]) * (e[1] - t[1]) < (n[1] - t[1]) * (e[0] - t[0])
}
function Fn(e, t, n, r) {
var o = e[0],
i = n[0],
a = t[0] - o,
s = r[0] - i,
l = e[1],
c = n[1],
u = t[1] - l,
d = r[1] - c,
f = (s * (l - c) - d * (o - i)) / (d * a - s * u);
return [o + f * a, l + f * u]
}
function Un(e) {
var t = e[0],
n = e[e.length - 1];
return !(t[0] - n[0] || t[1] - n[1])
}
function Vn() {
sr(this), this.edge = this.site = this.circle = null
}
function zn(e) {
var t = al.pop() || new Vn;
return t.site = e, t
}
function Bn(e) {
Xn(e), rl.remove(e), al.push(e), sr(e)
}
function $n(e) {
var t = e.circle,
n = t.x,
r = t.cy,
o = {
x: n,
y: r
},
i = e.P,
a = e.N,
s = [e];
Bn(e);
for (var l = i; l.circle && ha(n - l.circle.x) < Na && ha(r - l.circle.cy) < Na;) i = l.P, s.unshift(l), Bn(l), l = i;
s.unshift(l), Xn(l);
for (var c = a; c.circle && ha(n - c.circle.x) < Na && ha(r - c.circle.cy) < Na;) a = c.N, s.push(c), Bn(c), c = a;
s.push(c), Xn(c);
var u, d = s.length;
for (u = 1; u < d; ++u) c = s[u], l = s[u - 1], or(c.edge, l.site, c.site, o);
l = s[0], c = s[d - 1], c.edge = nr(l.site, c.site, null, o), Qn(l), Qn(c)
}
function Wn(e) {
for (var t, n, r, o, i = e.x, a = e.y, s = rl._; s;)
if (r = Hn(s, a) - i, r > Na) s = s.L;
else {
if (o = i - jn(s, a), !(o > Na)) {
r > -Na ? (t = s.P, n = s) : o > -Na ? (t = s, n = s.N) : t = n = s;
break
}
if (!s.R) {
t = s;
break
}
s = s.R
} var l = zn(e);
if (rl.insert(t, l), t || n) {
if (t === n) return Xn(t), n = zn(t.site), rl.insert(l, n), l.edge = n.edge = nr(t.site, l.site), Qn(t), void Qn(n);
if (!n) return void(l.edge = nr(t.site, l.site));
Xn(t), Xn(n);
var c = t.site,
u = c.x,
d = c.y,
f = e.x - u,
m = e.y - d,
p = n.site,
g = p.x - u,
v = p.y - d,
h = 2 * (f * v - m * g),
y = f * f + m * m,
b = g * g + v * v,
E = {
x: (v * y - m * b) / h + u,
y: (f * b - g * y) / h + d
};
or(n.edge, c, p, E), l.edge = nr(c, e, null, E), n.edge = nr(e, p, null, E), Qn(t), Qn(n)
}
}
function Hn(e, t) {
var n = e.site,
r = n.x,
o = n.y,
i = o - t;
if (!i) return r;
var a = e.P;
if (!a) return -(1 / 0);
n = a.site;
var s = n.x,
l = n.y,
c = l - t;
if (!c) return s;
var u = s - r,
d = 1 / i - 1 / c,
f = u / c;
return d ? (-f + Math.sqrt(f * f - 2 * d * (u * u / (-2 * c) - l + c / 2 + o - i / 2))) / d + r : (r + s) / 2
}
function jn(e, t) {
var n = e.N;
if (n) return Hn(n, t);
var r = e.site;
return r.y === t ? r.x : 1 / 0
}
function Yn(e) {
this.site = e, this.edges = []
}
function qn(e) {
for (var t, n, r, o, i, a, s, l, c, u, d = e[0][0], f = e[1][0], m = e[0][1], p = e[1][1], g = nl, v = g.length; v--;)
if (i = g[v], i && i.prepare())
for (s = i.edges, l = s.length, a = 0; a < l;) u = s[a].end(), r = u.x, o = u.y, c = s[++a % l].start(), t = c.x, n = c.y, (ha(r - t) > Na || ha(o - n) > Na) && (s.splice(a, 0, new ir(rr(i.site, u, ha(r - d) < Na && p - o > Na ? {
x: d,
y: ha(t - d) < Na ? n : p
} : ha(o - p) < Na && f - r > Na ? {
x: ha(n - p) < Na ? t : f,
y: p
} : ha(r - f) < Na && o - m > Na ? {
x: f,
y: ha(t - f) < Na ? n : m
} : ha(o - m) < Na && r - d > Na ? {
x: ha(n - m) < Na ? t : d,
y: m
} : null), i.site, null)), ++l)
}
function Kn(e, t) {
return t.angle - e.angle
}
function Zn() {
sr(this), this.x = this.y = this.arc = this.site = this.cy = null;
}
function Qn(e) {
var t = e.P,
n = e.N;
if (t && n) {
var r = t.site,
o = e.site,
i = n.site;
if (r !== i) {
var a = o.x,
s = o.y,
l = r.x - a,
c = r.y - s,
u = i.x - a,
d = i.y - s,
f = 2 * (l * d - c * u);
if (!(f >= -La)) {
var m = l * l + c * c,
p = u * u + d * d,
g = (d * m - c * p) / f,
v = (l * p - u * m) / f,
d = v + s,
h = sl.pop() || new Zn;
h.arc = e, h.site = o, h.x = g + a, h.y = d + Math.sqrt(g * g + v * v), h.cy = d, e.circle = h;
for (var y = null, b = il._; b;)
if (h.y < b.y || h.y === b.y && h.x <= b.x) {
if (!b.L) {
y = b.P;
break
}
b = b.L
} else {
if (!b.R) {
y = b;
break
}
b = b.R
} il.insert(y, h), y || (ol = h)
}
}
}
}
function Xn(e) {
var t = e.circle;
t && (t.P || (ol = t.N), il.remove(t), sl.push(t), sr(t), e.circle = null)
}
function Jn(e) {
for (var t, n = tl, r = jt(e[0][0], e[0][1], e[1][0], e[1][1]), o = n.length; o--;) t = n[o], (!er(t, e) || !r(t) || ha(t.a.x - t.b.x) < Na && ha(t.a.y - t.b.y) < Na) && (t.a = t.b = null, n.splice(o, 1))
}
function er(e, t) {
var n = e.b;
if (n) return !0;
var r, o, i = e.a,
a = t[0][0],
s = t[1][0],
l = t[0][1],
c = t[1][1],
u = e.l,
d = e.r,
f = u.x,
m = u.y,
p = d.x,
g = d.y,
v = (f + p) / 2,
h = (m + g) / 2;
if (g === m) {
if (v < a || v >= s) return;
if (f > p) {
if (i) {
if (i.y >= c) return
} else i = {
x: v,
y: l
};
n = {
x: v,
y: c
}
} else {
if (i) {
if (i.y < l) return
} else i = {
x: v,
y: c
};
n = {
x: v,
y: l
}
}
} else if (r = (f - p) / (g - m), o = h - r * v, r < -1 || r > 1)
if (f > p) {
if (i) {
if (i.y >= c) return
} else i = {
x: (l - o) / r,
y: l
};
n = {
x: (c - o) / r,
y: c
}
} else {
if (i) {
if (i.y < l) return
} else i = {
x: (c - o) / r,
y: c
};
n = {
x: (l - o) / r,
y: l
}
}
else if (m < g) {
if (i) {
if (i.x >= s) return
} else i = {
x: a,
y: r * a + o
};
n = {
x: s,
y: r * s + o
}
} else {
if (i) {
if (i.x < a) return
} else i = {
x: s,
y: r * s + o
};
n = {
x: a,
y: r * a + o
}
}
return e.a = i, e.b = n, !0
}
function tr(e, t) {
this.l = e, this.r = t, this.a = this.b = null
}
function nr(e, t, n, r) {
var o = new tr(e, t);
return tl.push(o), n && or(o, e, t, n), r && or(o, t, e, r), nl[e.i].edges.push(new ir(o, e, t)), nl[t.i].edges.push(new ir(o, t, e)), o
}
function rr(e, t, n) {
var r = new tr(e, null);
return r.a = t, r.b = n, tl.push(r), r
}
function or(e, t, n, r) {
e.a || e.b ? e.l === n ? e.b = r : e.a = r : (e.a = r, e.l = t, e.r = n)
}
function ir(e, t, n) {
var r = e.a,
o = e.b;
this.edge = e, this.site = t, this.angle = n ? Math.atan2(n.y - t.y, n.x - t.x) : e.l === t ? Math.atan2(o.x - r.x, r.y - o.y) : Math.atan2(r.x - o.x, o.y - r.y)
}
function ar() {
this._ = null
}
function sr(e) {
e.U = e.C = e.L = e.R = e.P = e.N = null
}
function lr(e, t) {
var n = t,
r = t.R,
o = n.U;
o ? o.L === n ? o.L = r : o.R = r : e._ = r, r.U = o, n.U = r, n.R = r.L, n.R && (n.R.U = n), r.L = n
}
function cr(e, t) {
var n = t,
r = t.L,
o = n.U;
o ? o.L === n ? o.L = r : o.R = r : e._ = r, r.U = o, n.U = r, n.L = r.R, n.L && (n.L.U = n), r.R = n
}
function ur(e) {
for (; e.L;) e = e.L;
return e
}
function dr(e, t) {
var n, r, o, i = e.sort(fr).pop();
for (tl = [], nl = new Array(e.length), rl = new ar, il = new ar;;)
if (o = ol, i && (!o || i.y < o.y || i.y === o.y && i.x < o.x)) i.x === n && i.y === r || (nl[i.i] = new Yn(i), Wn(i), n = i.x, r = i.y), i = e.pop();
else {
if (!o) break;
$n(o.arc)
} t && (Jn(t), qn(t));
var a = {
cells: nl,
edges: tl
};
return rl = il = tl = nl = null, a
}
function fr(e, t) {
return t.y - e.y || t.x - e.x
}
function mr(e, t, n) {
return (e.x - n.x) * (t.y - e.y) - (e.x - t.x) * (n.y - e.y)
}
function pr(e) {
return e.x
}
function gr(e) {
return e.y
}
function vr() {
return {
leaf: !0,
nodes: [],
point: null,
x: null,
y: null
}
}
function hr(e, t, n, r, o, i) {
if (!e(t, n, r, o, i)) {
var a = .5 * (n + o),
s = .5 * (r + i),
l = t.nodes;
l[0] && hr(e, l[0], n, r, a, s), l[1] && hr(e, l[1], a, r, o, s), l[2] && hr(e, l[2], n, s, a, i), l[3] && hr(e, l[3], a, s, o, i)
}
}
function yr(e, t, n, r, o, i, a) {
var s, l = 1 / 0;
return function e(c, u, d, f, m) {
if (!(u > i || d > a || f < r || m < o)) {
if (p = c.point) {
var p, g = t - c.x,
v = n - c.y,
h = g * g + v * v;
if (h < l) {
var y = Math.sqrt(l = h);
r = t - y, o = n - y, i = t + y, a = n + y, s = p
}
}
for (var b = c.nodes, E = .5 * (u + f), S = .5 * (d + m), _ = t >= E, w = n >= S, A = w << 1 | _, T = A + 4; A < T; ++A)
if (c = b[3 & A]) switch (3 & A) {
case 0:
e(c, u, d, E, S);
break;
case 1:
e(c, E, d, f, S);
break;
case 2:
e(c, u, S, E, m);
break;
case 3:
e(c, E, S, f, m)
}
}
}(e, r, o, i, a), s
}
function br(e, t) {
e = sa.rgb(e), t = sa.rgb(t);
var n = e.r,
r = e.g,
o = e.b,
i = t.r - n,
a = t.g - r,
s = t.b - o;
return function(e) {
return "#" + Te(Math.round(n + i * e)) + Te(Math.round(r + a * e)) + Te(Math.round(o + s * e))
}
}
function Er(e, t) {
var n, r = {},
o = {};
for (n in e) n in t ? r[n] = wr(e[n], t[n]) : o[n] = e[n];
for (n in t) n in e || (o[n] = t[n]);
return function(e) {
for (n in r) o[n] = r[n](e);
return o
}
}
function Sr(e, t) {
return e = +e, t = +t,
function(n) {
return e * (1 - n) + t * n
}
}
function _r(e, t) {
var n, r, o, i = cl.lastIndex = ul.lastIndex = 0,
a = -1,
s = [],
l = [];
for (e += "", t += "";
(n = cl.exec(e)) && (r = ul.exec(t));)(o = r.index) > i && (o = t.slice(i, o), s[a] ? s[a] += o : s[++a] = o), (n = n[0]) === (r = r[0]) ? s[a] ? s[a] += r : s[++a] = r : (s[++a] = null, l.push({
i: a,
x: Sr(n, r)
})), i = ul.lastIndex;
return i < t.length && (o = t.slice(i), s[a] ? s[a] += o : s[++a] = o), s.length < 2 ? l[0] ? (t = l[0].x, function(e) {
return t(e) + ""
}) : function() {
return t
} : (t = l.length, function(e) {
for (var n, r = 0; r < t; ++r) s[(n = l[r]).i] = n.x(e);
return s.join("")
})
}
function wr(e, t) {
for (var n, r = sa.interpolators.length; --r >= 0 && !(n = sa.interpolators[r](e, t)););
return n
}
function Ar(e, t) {
var n, r = [],
o = [],
i = e.length,
a = t.length,
s = Math.min(e.length, t.length);
for (n = 0; n < s; ++n) r.push(wr(e[n], t[n]));
for (; n < i; ++n) o[n] = e[n];
for (; n < a; ++n) o[n] = t[n];
return function(e) {
for (n = 0; n < s; ++n) o[n] = r[n](e);
return o
}
}
function Tr(e) {
return function(t) {
return t <= 0 ? 0 : t >= 1 ? 1 : e(t)
}
}
function Cr(e) {
return function(t) {
return 1 - e(1 - t)
}
}
function Ir(e) {
return function(t) {
return .5 * (t < .5 ? e(2 * t) : 2 - e(2 - 2 * t))
}
}
function xr(e) {
return e * e
}
function Dr(e) {
return e * e * e
}
function Mr(e) {
if (e <= 0) return 0;
if (e >= 1) return 1;
var t = e * e,
n = t * e;
return 4 * (e < .5 ? n : 3 * (e - t) + n - .75)
}
function Or(e) {
return function(t) {
return Math.pow(t, e)
}
}
function Rr(e) {
return 1 - Math.cos(e * Fa)
}
function Nr(e) {
return Math.pow(2, 10 * (e - 1))
}
function Lr(e) {
return 1 - Math.sqrt(1 - e * e)
}
function kr(e, t) {
var n;
return arguments.length < 2 && (t = .45), arguments.length ? n = t / Pa * Math.asin(1 / e) : (e = 1, n = t / 4),
function(r) {
return 1 + e * Math.pow(2, -10 * r) * Math.sin((r - n) * Pa / t)
}
}
function Pr(e) {
return e || (e = 1.70158),
function(t) {
return t * t * ((e + 1) * t - e)
}
}
function Gr(e) {
return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
}
function Fr(e, t) {
e = sa.hcl(e), t = sa.hcl(t);
var n = e.h,
r = e.c,
o = e.l,
i = t.h - n,
a = t.c - r,
s = t.l - o;
return isNaN(a) && (a = 0, r = isNaN(r) ? t.c : r), isNaN(i) ? (i = 0, n = isNaN(n) ? t.h : n) : i > 180 ? i -= 360 : i < -180 && (i += 360),
function(e) {
return ge(n + i * e, r + a * e, o + s * e) + ""
}
}
function Ur(e, t) {
e = sa.hsl(e), t = sa.hsl(t);
var n = e.h,
r = e.s,
o = e.l,
i = t.h - n,
a = t.s - r,
s = t.l - o;
return isNaN(a) && (a = 0, r = isNaN(r) ? t.s : r), isNaN(i) ? (i = 0, n = isNaN(n) ? t.h : n) : i > 180 ? i -= 360 : i < -180 && (i += 360),
function(e) {
return me(n + i * e, r + a * e, o + s * e) + ""
}
}
function Vr(e, t) {
e = sa.lab(e), t = sa.lab(t);
var n = e.l,
r = e.a,
o = e.b,
i = t.l - n,
a = t.a - r,
s = t.b - o;
return function(e) {
return he(n + i * e, r + a * e, o + s * e) + ""
}
}
function zr(e, t) {
return t -= e,
function(n) {
return Math.round(e + t * n)
}
}
function Br(e) {
var t = [e.a, e.b],
n = [e.c, e.d],
r = Wr(t),
o = $r(t, n),
i = Wr(Hr(n, t, -o)) || 0;
t[0] * n[1] < n[0] * t[1] && (t[0] *= -1, t[1] *= -1, r *= -1, o *= -1), this.rotate = (r ? Math.atan2(t[1], t[0]) : Math.atan2(-n[0], n[1])) * Va, this.translate = [e.e, e.f], this.scale = [r, i], this.skew = i ? Math.atan2(o, i) * Va : 0
}
function $r(e, t) {
return e[0] * t[0] + e[1] * t[1]
}
function Wr(e) {
var t = Math.sqrt($r(e, e));
return t && (e[0] /= t, e[1] /= t), t
}
function Hr(e, t, n) {
return e[0] += n * t[0], e[1] += n * t[1], e
}
function jr(e, t) {
var n, r = [],
o = [],
i = sa.transform(e),
a = sa.transform(t),
s = i.translate,
l = a.translate,
c = i.rotate,
u = a.rotate,
d = i.skew,
f = a.skew,
m = i.scale,
p = a.scale;
return s[0] != l[0] || s[1] != l[1] ? (r.push("translate(", null, ",", null, ")"), o.push({
i: 1,
x: Sr(s[0], l[0])
}, {
i: 3,
x: Sr(s[1], l[1])
})) : l[0] || l[1] ? r.push("translate(" + l + ")") : r.push(""), c != u ? (c - u > 180 ? u += 360 : u - c > 180 && (c += 360), o.push({
i: r.push(r.pop() + "rotate(", null, ")") - 2,
x: Sr(c, u)
})) : u && r.push(r.pop() + "rotate(" + u + ")"), d != f ? o.push({
i: r.push(r.pop() + "skewX(", null, ")") - 2,
x: Sr(d, f)
}) : f && r.push(r.pop() + "skewX(" + f + ")"), m[0] != p[0] || m[1] != p[1] ? (n = r.push(r.pop() + "scale(", null, ",", null, ")"), o.push({
i: n - 4,
x: Sr(m[0], p[0])
}, {
i: n - 2,
x: Sr(m[1], p[1])
})) : 1 == p[0] && 1 == p[1] || r.push(r.pop() + "scale(" + p + ")"), n = o.length,
function(e) {
for (var t, i = -1; ++i < n;) r[(t = o[i]).i] = t.x(e);
return r.join("")
}
}
function Yr(e, t) {
return t = (t -= e = +e) || 1 / t,
function(n) {
return (n - e) / t
}
}
function qr(e, t) {
return t = (t -= e = +e) || 1 / t,
function(n) {
return Math.max(0, Math.min(1, (n - e) / t))
}
}
function Kr(e) {
for (var t = e.source, n = e.target, r = Qr(t, n), o = [t]; t !== r;) t = t.parent, o.push(t);
for (var i = o.length; n !== r;) o.splice(i, 0, n), n = n.parent;
return o
}
function Zr(e) {
for (var t = [], n = e.parent; null != n;) t.push(e), e = n, n = n.parent;
return t.push(e), t
}
function Qr(e, t) {
if (e === t) return e;
for (var n = Zr(e), r = Zr(t), o = n.pop(), i = r.pop(), a = null; o === i;) a = o, o = n.pop(), i = r.pop();
return a
}
function Xr(e) {
e.fixed |= 2
}
function Jr(e) {
e.fixed &= -7
}
function eo(e) {
e.fixed |= 4, e.px = e.x, e.py = e.y
}
function to(e) {
e.fixed &= -5
}
function no(e, t, n) {
var r = 0,
o = 0;
if (e.charge = 0, !e.leaf)
for (var i, a = e.nodes, s = a.length, l = -1; ++l < s;) i = a[l], null != i && (no(i, t, n), e.charge += i.charge, r += i.charge * i.cx, o += i.charge * i.cy);
if (e.point) {
e.leaf || (e.point.x += Math.random() - .5, e.point.y += Math.random() - .5);
var c = t * n[e.point.index];
e.charge += e.pointCharge = c, r += c * e.point.x, o += c * e.point.y
}
e.cx = r / e.charge, e.cy = o / e.charge
}
function ro(e, t) {
return sa.rebind(e, t, "sort", "children", "value"), e.nodes = e, e.links = co, e
}
function oo(e, t) {
for (var n = [e]; null != (e = n.pop());)
if (t(e), (o = e.children) && (r = o.length))
for (var r, o; --r >= 0;) n.push(o[r])
}
function io(e, t) {
for (var n = [e], r = []; null != (e = n.pop());)
if (r.push(e), (i = e.children) && (o = i.length))
for (var o, i, a = -1; ++a < o;) n.push(i[a]);
for (; null != (e = r.pop());) t(e)
}
function ao(e) {
return e.children
}
function so(e) {
return e.value
}
function lo(e, t) {
return t.value - e.value
}
function co(e) {
return sa.merge(e.map(function(e) {
return (e.children || []).map(function(t) {
return {
source: e,
target: t
}
})
}))
}
function uo(e) {
return e.x
}
function fo(e) {
return e.y
}
function mo(e, t, n) {
e.y0 = t, e.y = n
}
function po(e) {
return sa.range(e.length)
}
function go(e) {
for (var t = -1, n = e[0].length, r = []; ++t < n;) r[t] = 0;
return r
}
function vo(e) {
for (var t, n = 1, r = 0, o = e[0][1], i = e.length; n < i; ++n)(t = e[n][1]) > o && (r = n, o = t);
return r
}
function ho(e) {
return e.reduce(yo, 0)
}
function yo(e, t) {
return e + t[1]
}
function bo(e, t) {
return Eo(e, Math.ceil(Math.log(t.length) / Math.LN2 + 1))
}
function Eo(e, t) {
for (var n = -1, r = +e[0], o = (e[1] - r) / t, i = []; ++n <= t;) i[n] = o * n + r;
return i
}
function So(e) {
return [sa.min(e), sa.max(e)]
}
function _o(e, t) {
return e.value - t.value
}
function wo(e, t) {
var n = e._pack_next;
e._pack_next = t, t._pack_prev = e, t._pack_next = n, n._pack_prev = t
}
function Ao(e, t) {
e._pack_next = t, t._pack_prev = e
}
function To(e, t) {
var n = t.x - e.x,
r = t.y - e.y,
o = e.r + t.r;
return .999 * o * o > n * n + r * r
}
function Co(e) {
function t(e) {
u = Math.min(e.x - e.r, u), d = Math.max(e.x + e.r, d), f = Math.min(e.y - e.r, f), m = Math.max(e.y + e.r, m)
}
if ((n = e.children) && (c = n.length)) {
var n, r, o, i, a, s, l, c, u = 1 / 0,
d = -(1 / 0),
f = 1 / 0,
m = -(1 / 0);
if (n.forEach(Io), r = n[0], r.x = -r.r, r.y = 0, t(r), c > 1 && (o = n[1], o.x = o.r, o.y = 0, t(o), c > 2))
for (i = n[2], Mo(r, o, i), t(i), wo(r, i), r._pack_prev = i, wo(i, o), o = r._pack_next, a = 3; a < c; a++) {
Mo(r, o, i = n[a]);
var p = 0,
g = 1,
v = 1;
for (s = o._pack_next; s !== o; s = s._pack_next, g++)
if (To(s, i)) {
p = 1;
break
} if (1 == p)
for (l = r._pack_prev; l !== s._pack_prev && !To(l, i); l = l._pack_prev, v++);
p ? (g < v || g == v && o.r < r.r ? Ao(r, o = s) : Ao(r = l, o), a--) : (wo(r, i), o = i, t(i))
}
var h = (u + d) / 2,
y = (f + m) / 2,
b = 0;
for (a = 0; a < c; a++) i = n[a], i.x -= h, i.y -= y, b = Math.max(b, i.r + Math.sqrt(i.x * i.x + i.y * i.y));
e.r = b, n.forEach(xo)
}
}
function Io(e) {
e._pack_next = e._pack_prev = e
}
function xo(e) {
delete e._pack_next, delete e._pack_prev
}
function Do(e, t, n, r) {
var o = e.children;
if (e.x = t += r * e.x, e.y = n += r * e.y, e.r *= r, o)
for (var i = -1, a = o.length; ++i < a;) Do(o[i], t, n, r)
}
function Mo(e, t, n) {
var r = e.r + n.r,
o = t.x - e.x,
i = t.y - e.y;
if (r && (o || i)) {
var a = t.r + n.r,
s = o * o + i * i;
a *= a, r *= r;
var l = .5 + (r - a) / (2 * s),
c = Math.sqrt(Math.max(0, 2 * a * (r + s) - (r -= s) * r - a * a)) / (2 * s);
n.x = e.x + l * o + c * i, n.y = e.y + l * i - c * o
} else n.x = e.x + r, n.y = e.y
}
function Oo(e, t) {
return e.parent == t.parent ? 1 : 2
}
function Ro(e) {
var t = e.children;
return t.length ? t[0] : e.t
}
function No(e) {
var t, n = e.children;
return (t = n.length) ? n[t - 1] : e.t
}
function Lo(e, t, n) {
var r = n / (t.i - e.i);
t.c -= r, t.s += n, e.c += r, t.z += n, t.m += n
}
function ko(e) {
for (var t, n = 0, r = 0, o = e.children, i = o.length; --i >= 0;) t = o[i], t.z += n, t.m += n, n += t.s + (r += t.c)
}
function Po(e, t, n) {
return e.a.parent === t.parent ? e.a : n
}
function Go(e) {
return 1 + sa.max(e, function(e) {
return e.y
})
}
function Fo(e) {
return e.reduce(function(e, t) {
return e + t.x
}, 0) / e.length
}
function Uo(e) {
var t = e.children;
return t && t.length ? Uo(t[0]) : e
}
function Vo(e) {
var t, n = e.children;
return n && (t = n.length) ? Vo(n[t - 1]) : e
}
function zo(e) {
return {
x: e.x,
y: e.y,
dx: e.dx,
dy: e.dy
}
}
function Bo(e, t) {
var n = e.x + t[3],
r = e.y + t[0],
o = e.dx - t[1] - t[3],
i = e.dy - t[0] - t[2];
return o < 0 && (n += o / 2, o = 0), i < 0 && (r += i / 2, i = 0), {
x: n,
y: r,
dx: o,
dy: i
}
}
function $o(e) {
var t = e[0],
n = e[e.length - 1];
return t < n ? [t, n] : [n, t]
}
function Wo(e) {
return e.rangeExtent ? e.rangeExtent() : $o(e.range())
}
function Ho(e, t, n, r) {
var o = n(e[0], e[1]),
i = r(t[0], t[1]);
return function(e) {
return i(o(e))
}
}
function jo(e, t) {
var n, r = 0,
o = e.length - 1,
i = e[r],
a = e[o];
return a < i && (n = r, r = o, o = n, n = i, i = a, a = n), e[r] = t.floor(i), e[o] = t.ceil(a), e
}
function Yo(e) {
return e ? {
floor: function(t) {
return Math.floor(t / e) * e
},
ceil: function(t) {
return Math.ceil(t / e) * e
}
} : Sl
}
function qo(e, t, n, r) {
var o = [],
i = [],
a = 0,
s = Math.min(e.length, t.length) - 1;
for (e[s] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++a <= s;) o.push(n(e[a - 1], e[a])), i.push(r(t[a - 1], t[a]));
return function(t) {
var n = sa.bisect(e, t, 1, s) - 1;
return i[n](o[n](t))
}
}
function Ko(e, t, n, r) {
function o() {
var o = Math.min(e.length, t.length) > 2 ? qo : Ho,
l = r ? qr : Yr;
return a = o(e, t, l, n), s = o(t, e, l, wr), i
}
function i(e) {
return a(e)
}
var a, s;
return i.invert = function(e) {
return s(e)
}, i.domain = function(t) {
return arguments.length ? (e = t.map(Number), o()) : e
}, i.range = function(e) {
return arguments.length ? (t = e, o()) : t
}, i.rangeRound = function(e) {
return i.range(e).interpolate(zr)
}, i.clamp = function(e) {
return arguments.length ? (r = e, o()) : r
}, i.interpolate = function(e) {
return arguments.length ? (n = e, o()) : n
}, i.ticks = function(t) {
return Jo(e, t)
}, i.tickFormat = function(t, n) {
return ei(e, t, n)
}, i.nice = function(t) {
return Qo(e, t), o()
}, i.copy = function() {
return Ko(e, t, n, r)
}, o()
}
function Zo(e, t) {
return sa.rebind(e, t, "range", "rangeRound", "interpolate", "clamp")
}
function Qo(e, t) {
return jo(e, Yo(Xo(e, t)[2]))
}
function Xo(e, t) {
null == t && (t = 10);
var n = $o(e),
r = n[1] - n[0],
o = Math.pow(10, Math.floor(Math.log(r / t) / Math.LN10)),
i = t / r * o;
return i <= .15 ? o *= 10 : i <= .35 ? o *= 5 : i <= .75 && (o *= 2), n[0] = Math.ceil(n[0] / o) * o, n[1] = Math.floor(n[1] / o) * o + .5 * o, n[2] = o, n
}
function Jo(e, t) {
return sa.range.apply(sa, Xo(e, t))
}
function ei(e, t, n) {
var r = Xo(e, t);
if (n) {
var o = cs.exec(n);
if (o.shift(), "s" === o[8]) {
var i = sa.formatPrefix(Math.max(ha(r[0]), ha(r[1])));
return o[7] || (o[7] = "." + ti(i.scale(r[2]))), o[8] = "f", n = sa.format(o.join("")),
function(e) {
return n(i.scale(e)) + i.symbol
}
}
o[7] || (o[7] = "." + ni(o[8], r)), n = o.join("")
} else n = ",." + ti(r[2]) + "f";
return sa.format(n)
}
function ti(e) {
return -Math.floor(Math.log(e) / Math.LN10 + .01)
}
function ni(e, t) {
var n = ti(t[2]);
return e in _l ? Math.abs(n - ti(Math.max(ha(t[0]), ha(t[1])))) + +("e" !== e) : n - 2 * ("%" === e)
}
function ri(e, t, n, r) {
function o(e) {
return (n ? Math.log(e < 0 ? 0 : e) : -Math.log(e > 0 ? 0 : -e)) / Math.log(t)
}
function i(e) {
return n ? Math.pow(t, e) : -Math.pow(t, -e)
}
function a(t) {
return e(o(t))
}
return a.invert = function(t) {
return i(e.invert(t))
}, a.domain = function(t) {
return arguments.length ? (n = t[0] >= 0, e.domain((r = t.map(Number)).map(o)), a) : r
}, a.base = function(n) {
return arguments.length ? (t = +n, e.domain(r.map(o)), a) : t
}, a.nice = function() {
var t = jo(r.map(o), n ? Math : Al);
return e.domain(t), r = t.map(i), a
}, a.ticks = function() {
var e = $o(r),
a = [],
s = e[0],
l = e[1],
c = Math.floor(o(s)),
u = Math.ceil(o(l)),
d = t % 1 ? 2 : t;
if (isFinite(u - c)) {
if (n) {
for (; c < u; c++)
for (var f = 1; f < d; f++) a.push(i(c) * f);
a.push(i(c))
} else
for (a.push(i(c)); c++ < u;)
for (var f = d - 1; f > 0; f--) a.push(i(c) * f);
for (c = 0; a[c] < s; c++);
for (u = a.length; a[u - 1] > l; u--);
a = a.slice(c, u)
}
return a
}, a.tickFormat = function(e, t) {
if (!arguments.length) return wl;
arguments.length < 2 ? t = wl : "function" != typeof t && (t = sa.format(t));
var r, s = Math.max(.1, e / a.ticks().length),
l = n ? (r = 1e-12, Math.ceil) : (r = -1e-12, Math.floor);
return function(e) {
return e / i(l(o(e) + r)) <= s ? t(e) : ""
}
}, a.copy = function() {
return ri(e.copy(), t, n, r)
}, Zo(a, e)
}
function oi(e, t, n) {
function r(t) {
return e(o(t))
}
var o = ii(t),
i = ii(1 / t);
return r.invert = function(t) {
return i(e.invert(t))
}, r.domain = function(t) {
return arguments.length ? (e.domain((n = t.map(Number)).map(o)), r) : n
}, r.ticks = function(e) {
return Jo(n, e)
}, r.tickFormat = function(e, t) {
return ei(n, e, t)
}, r.nice = function(e) {
return r.domain(Qo(n, e))
}, r.exponent = function(a) {
return arguments.length ? (o = ii(t = a), i = ii(1 / t), e.domain(n.map(o)), r) : t
}, r.copy = function() {
return oi(e.copy(), t, n)
}, Zo(r, e)
}
function ii(e) {
return function(t) {
return t < 0 ? -Math.pow(-t, e) : Math.pow(t, e)
}
}
function ai(e, t) {
function n(n) {
return i[((o.get(n) || ("range" === t.t ? o.set(n, e.push(n)) : NaN)) - 1) % i.length]
}
function r(t, n) {
return sa.range(e.length).map(function(e) {
return t + n * e
})
}
var o, i, a;
return n.domain = function(r) {
if (!arguments.length) return e;
e = [], o = new p;
for (var i, a = -1, s = r.length; ++a < s;) o.has(i = r[a]) || o.set(i, e.push(i));
return n[t.t].apply(n, t.a)
}, n.range = function(e) {
return arguments.length ? (i = e, a = 0, t = {
t: "range",
a: arguments
}, n) : i
}, n.rangePoints = function(o, s) {
arguments.length < 2 && (s = 0);
var l = o[0],
c = o[1],
u = e.length < 2 ? (l = (l + c) / 2, 0) : (c - l) / (e.length - 1 + s);
return i = r(l + u * s / 2, u), a = 0, t = {
t: "rangePoints",
a: arguments
}, n
}, n.rangeRoundPoints = function(o, s) {
arguments.length < 2 && (s = 0);
var l = o[0],
c = o[1],
u = e.length < 2 ? (l = c = Math.round((l + c) / 2), 0) : (c - l) / (e.length - 1 + s) | 0;
return i = r(l + Math.round(u * s / 2 + (c - l - (e.length - 1 + s) * u) / 2), u), a = 0, t = {
t: "rangeRoundPoints",
a: arguments
}, n
}, n.rangeBands = function(o, s, l) {
arguments.length < 2 && (s = 0), arguments.length < 3 && (l = s);
var c = o[1] < o[0],
u = o[c - 0],
d = o[1 - c],
f = (d - u) / (e.length - s + 2 * l);
return i = r(u + f * l, f), c && i.reverse(), a = f * (1 - s), t = {
t: "rangeBands",
a: arguments
}, n
}, n.rangeRoundBands = function(o, s, l) {
arguments.length < 2 && (s = 0), arguments.length < 3 && (l = s);
var c = o[1] < o[0],
u = o[c - 0],
d = o[1 - c],
f = Math.floor((d - u) / (e.length - s + 2 * l));
return i = r(u + Math.round((d - u - (e.length - s) * f) / 2), f), c && i.reverse(), a = Math.round(f * (1 - s)), t = {
t: "rangeRoundBands",
a: arguments
}, n
}, n.rangeBand = function() {
return a
}, n.rangeExtent = function() {
return $o(t.a[0])
}, n.copy = function() {
return ai(e, t)
}, n.domain(e)
}
function si(e, t) {
function n() {
var n = 0,
i = t.length;
for (o = []; ++n < i;) o[n - 1] = sa.quantile(e, n / i);
return r
}
function r(e) {
if (!isNaN(e = +e)) return t[sa.bisect(o, e)]
}
var o;
return r.domain = function(t) {
return arguments.length ? (e = t.map(l).filter(c).sort(s), n()) : e
}, r.range = function(e) {
return arguments.length ? (t = e, n()) : t
}, r.quantiles = function() {
return o
}, r.invertExtent = function(n) {
return n = t.indexOf(n), n < 0 ? [NaN, NaN] : [n > 0 ? o[n - 1] : e[0], n < o.length ? o[n] : e[e.length - 1]]
}, r.copy = function() {
return si(e, t)
}, n()
}
function li(e, t, n) {
function r(t) {
return n[Math.max(0, Math.min(a, Math.floor(i * (t - e))))]
}
function o() {
return i = n.length / (t - e), a = n.length - 1, r
}
var i, a;
return r.domain = function(n) {
return arguments.length ? (e = +n[0], t = +n[n.length - 1], o()) : [e, t]
}, r.range = function(e) {
return arguments.length ? (n = e, o()) : n
}, r.invertExtent = function(t) {
return t = n.indexOf(t), t = t < 0 ? NaN : t / i + e, [t, t + 1 / i]
}, r.copy = function() {
return li(e, t, n)
}, o()
}
function ci(e, t) {
function n(n) {
if (n <= n) return t[sa.bisect(e, n)]
}
return n.domain = function(t) {
return arguments.length ? (e = t, n) : e
}, n.range = function(e) {
return arguments.length ? (t = e, n) : t
}, n.invertExtent = function(n) {
return n = t.indexOf(n), [e[n - 1], e[n]]
}, n.copy = function() {
return ci(e, t)
}, n
}
function ui(e) {
function t(e) {
return +e
}
return t.invert = t, t.domain = t.range = function(n) {
return arguments.length ? (e = n.map(t), t) : e
}, t.ticks = function(t) {
return Jo(e, t)
}, t.tickFormat = function(t, n) {
return ei(e, t, n)
}, t.copy = function() {
return ui(e)
}, t
}
function di() {
return 0
}
function fi(e) {
return e.innerRadius
}
function mi(e) {
return e.outerRadius
}
function pi(e) {
return e.startAngle
}
function gi(e) {
return e.endAngle
}
function vi(e) {
return e && e.padAngle
}
function hi(e, t, n, r) {
return (e - n) * t - (t - r) * e > 0 ? 0 : 1
}
function yi(e, t, n, r, o) {
var i = e[0] - t[0],
a = e[1] - t[1],
s = (o ? r : -r) / Math.sqrt(i * i + a * a),
l = s * a,
c = -s * i,
u = e[0] + l,
d = e[1] + c,
f = t[0] + l,
m = t[1] + c,
p = (u + f) / 2,
g = (d + m) / 2,
v = f - u,
h = m - d,
y = v * v + h * h,
b = n - r,
E = u * m - f * d,
S = (h < 0 ? -1 : 1) * Math.sqrt(b * b * y - E * E),
_ = (E * h - v * S) / y,
w = (-E * v - h * S) / y,
A = (E * h + v * S) / y,
T = (-E * v + h * S) / y,
C = _ - p,
I = w - g,
x = A - p,
D = T - g;
return C * C + I * I > x * x + D * D && (_ = A, w = T), [
[_ - l, w - c],
[_ * n / b, w * n / b]
]
}
function bi(e) {
function t(t) {
function a() {
c.push("M", i(e(u), s))
}
for (var l, c = [], u = [], d = -1, f = t.length, m = Oe(n), p = Oe(r); ++d < f;) o.call(this, l = t[d], d) ? u.push([+m.call(this, l, d), +p.call(this, l, d)]) : u.length && (a(), u = []);
return u.length && a(), c.length ? c.join("") : null
}
var n = Nn,
r = Ln,
o = Nt,
i = Ei,
a = i.key,
s = .7;
return t.x = function(e) {
return arguments.length ? (n = e, t) : n
}, t.y = function(e) {
return arguments.length ? (r = e, t) : r
}, t.defined = function(e) {
return arguments.length ? (o = e, t) : o
}, t.interpolate = function(e) {
return arguments.length ? (a = "function" == typeof e ? i = e : (i = Ml.get(e) || Ei).key, t) : a
}, t.tension = function(e) {
return arguments.length ? (s = e, t) : s
}, t
}
function Ei(e) {
return e.join("L")
}
function Si(e) {
return Ei(e) + "Z"
}
function _i(e) {
for (var t = 0, n = e.length, r = e[0], o = [r[0], ",", r[1]]; ++t < n;) o.push("H", (r[0] + (r = e[t])[0]) / 2, "V", r[1]);
return n > 1 && o.push("H", r[0]), o.join("")
}
function wi(e) {
for (var t = 0, n = e.length, r = e[0], o = [r[0], ",", r[1]]; ++t < n;) o.push("V", (r = e[t])[1], "H", r[0]);
return o.join("")
}
function Ai(e) {
for (var t = 0, n = e.length, r = e[0], o = [r[0], ",", r[1]]; ++t < n;) o.push("H", (r = e[t])[0], "V", r[1]);
return o.join("")
}
function Ti(e, t) {
return e.length < 4 ? Ei(e) : e[1] + xi(e.slice(1, -1), Di(e, t))
}
function Ci(e, t) {
return e.length < 3 ? Ei(e) : e[0] + xi((e.push(e[0]), e), Di([e[e.length - 2]].concat(e, [e[1]]), t))
}
function Ii(e, t) {
return e.length < 3 ? Ei(e) : e[0] + xi(e, Di(e, t))
}
function xi(e, t) {
if (t.length < 1 || e.length != t.length && e.length != t.length + 2) return Ei(e);
var n = e.length != t.length,
r = "",
o = e[0],
i = e[1],
a = t[0],
s = a,
l = 1;
if (n && (r += "Q" + (i[0] - 2 * a[0] / 3) + "," + (i[1] - 2 * a[1] / 3) + "," + i[0] + "," + i[1], o = e[1], l = 2), t.length > 1) {
s = t[1], i = e[l], l++, r += "C" + (o[0] + a[0]) + "," + (o[1] + a[1]) + "," + (i[0] - s[0]) + "," + (i[1] - s[1]) + "," + i[0] + "," + i[1];
for (var c = 2; c < t.length; c++, l++) i = e[l], s = t[c], r += "S" + (i[0] - s[0]) + "," + (i[1] - s[1]) + "," + i[0] + "," + i[1]
}
if (n) {
var u = e[l];
r += "Q" + (i[0] + 2 * s[0] / 3) + "," + (i[1] + 2 * s[1] / 3) + "," + u[0] + "," + u[1]
}
return r
}
function Di(e, t) {
for (var n, r = [], o = (1 - t) / 2, i = e[0], a = e[1], s = 1, l = e.length; ++s < l;) n = i, i = a, a = e[s], r.push([o * (a[0] - n[0]), o * (a[1] - n[1])]);
return r
}
function Mi(e) {
if (e.length < 3) return Ei(e);
var t = 1,
n = e.length,
r = e[0],
o = r[0],
i = r[1],
a = [o, o, o, (r = e[1])[0]],
s = [i, i, i, r[1]],
l = [o, ",", i, "L", Li(Nl, a), ",", Li(Nl, s)];
for (e.push(e[n - 1]); ++t <= n;) r = e[t], a.shift(), a.push(r[0]), s.shift(), s.push(r[1]), ki(l, a, s);
return e.pop(), l.push("L", r), l.join("")
}
function Oi(e) {
if (e.length < 4) return Ei(e);
for (var t, n = [], r = -1, o = e.length, i = [0], a = [0]; ++r < 3;) t = e[r], i.push(t[0]), a.push(t[1]);
for (n.push(Li(Nl, i) + "," + Li(Nl, a)), --r; ++r < o;) t = e[r], i.shift(), i.push(t[0]), a.shift(), a.push(t[1]), ki(n, i, a);
return n.join("")
}
function Ri(e) {
for (var t, n, r = -1, o = e.length, i = o + 4, a = [], s = []; ++r < 4;) n = e[r % o], a.push(n[0]), s.push(n[1]);
for (t = [Li(Nl, a), ",", Li(Nl, s)], --r; ++r < i;) n = e[r % o], a.shift(), a.push(n[0]), s.shift(), s.push(n[1]), ki(t, a, s);
return t.join("")
}
function Ni(e, t) {
var n = e.length - 1;
if (n)
for (var r, o, i = e[0][0], a = e[0][1], s = e[n][0] - i, l = e[n][1] - a, c = -1; ++c <= n;) r = e[c], o = c / n, r[0] = t * r[0] + (1 - t) * (i + o * s), r[1] = t * r[1] + (1 - t) * (a + o * l);
return Mi(e)
}
function Li(e, t) {
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3]
}
function ki(e, t, n) {
e.push("C", Li(Ol, t), ",", Li(Ol, n), ",", Li(Rl, t), ",", Li(Rl, n), ",", Li(Nl, t), ",", Li(Nl, n))
}
function Pi(e, t) {
return (t[1] - e[1]) / (t[0] - e[0])
}
function Gi(e) {
for (var t = 0, n = e.length - 1, r = [], o = e[0], i = e[1], a = r[0] = Pi(o, i); ++t < n;) r[t] = (a + (a = Pi(o = i, i = e[t + 1]))) / 2;
return r[t] = a, r
}
function Fi(e) {
for (var t, n, r, o, i = [], a = Gi(e), s = -1, l = e.length - 1; ++s < l;) t = Pi(e[s], e[s + 1]), ha(t) < Na ? a[s] = a[s + 1] = 0 : (n = a[s] / t, r = a[s + 1] / t, o = n * n + r * r, o > 9 && (o = 3 * t / Math.sqrt(o), a[s] = o * n, a[s + 1] = o * r));
for (s = -1; ++s <= l;) o = (e[Math.min(l, s + 1)][0] - e[Math.max(0, s - 1)][0]) / (6 * (1 + a[s] * a[s])), i.push([o || 0, a[s] * o || 0]);
return i
}
function Ui(e) {
return e.length < 3 ? Ei(e) : e[0] + xi(e, Fi(e))
}
function Vi(e) {
for (var t, n, r, o = -1, i = e.length; ++o < i;) t = e[o], n = t[0], r = t[1] - Fa, t[0] = n * Math.cos(r), t[1] = n * Math.sin(r);
return e
}
function zi(e) {
function t(t) {
function l() {
g.push("M", s(e(h), d), u, c(e(v.reverse()), d), "Z")
}
for (var f, m, p, g = [], v = [], h = [], y = -1, b = t.length, E = Oe(n), S = Oe(o), _ = n === r ? function() {
return m
} : Oe(r), w = o === i ? function() {
return p
} : Oe(i); ++y < b;) a.call(this, f = t[y], y) ? (v.push([m = +E.call(this, f, y), p = +S.call(this, f, y)]), h.push([+_.call(this, f, y), +w.call(this, f, y)])) : v.length && (l(), v = [], h = []);
return v.length && l(), g.length ? g.join("") : null
}
var n = Nn,
r = Nn,
o = 0,
i = Ln,
a = Nt,
s = Ei,
l = s.key,
c = s,
u = "L",
d = .7;
return t.x = function(e) {
return arguments.length ? (n = r = e, t) : r
}, t.x0 = function(e) {
return arguments.length ? (n = e, t) : n
}, t.x1 = function(e) {
return arguments.length ? (r = e, t) : r
}, t.y = function(e) {
return arguments.length ? (o = i = e, t) : i
}, t.y0 = function(e) {
return arguments.length ? (o = e, t) : o
}, t.y1 = function(e) {
return arguments.length ? (i = e, t) : i
}, t.defined = function(e) {
return arguments.length ? (a = e, t) : a
}, t.interpolate = function(e) {
return arguments.length ? (l = "function" == typeof e ? s = e : (s = Ml.get(e) || Ei).key, c = s.reverse || s, u = s.closed ? "M" : "L", t) : l
}, t.tension = function(e) {
return arguments.length ? (d = e, t) : d
}, t
}
function Bi(e) {
return e.radius
}
function $i(e) {
return [e.x, e.y]
}
function Wi(e) {
return function() {
var t = e.apply(this, arguments),
n = t[0],
r = t[1] - Fa;
return [n * Math.cos(r), n * Math.sin(r)]
}
}
function Hi() {
return 64
}
function ji() {
return "circle"
}
function Yi(e) {
var t = Math.sqrt(e / ka);
return "M0," + t + "A" + t + "," + t + " 0 1,1 0," + -t + "A" + t + "," + t + " 0 1,1 0," + t + "Z"
}
function qi(e) {
return function() {
var t, n;
(t = this[e]) && (n = t[t.active]) && (--t.count ? delete t[t.active] : delete this[e], t.active += .5, n.event && n.event.interrupt.call(this, this.__data__, n.index))
}
}
function Ki(e, t, n) {
return _a(e, Vl), e.namespace = t, e.id = n, e
}
function Zi(e, t, n, r) {
var o = e.id,
i = e.namespace;
return q(e, "function" == typeof n ? function(e, a, s) {
e[i][o].tween.set(t, r(n.call(e, e.__data__, a, s)))
} : (n = r(n), function(e) {
e[i][o].tween.set(t, n)
}))
}
function Qi(e) {
return null == e && (e = ""),
function() {
this.textContent = e
}
}
function Xi(e) {
return null == e ? "__transition__" : "__transition_" + e + "__"
}
function Ji(e, t, n, r, o) {
var i = e[n] || (e[n] = {
active: 0,
count: 0
}),
a = i[r];
if (!a) {
var s = o.time;
a = i[r] = {
tween: new p,
time: s,
delay: o.delay,
duration: o.duration,
ease: o.ease,
index: t
}, o = null, ++i.count, sa.timer(function(o) {
function l(n) {
if (i.active > r) return u();
var o = i[i.active];
o && (--i.count, delete i[i.active], o.event && o.event.interrupt.call(e, e.__data__, o.index)), i.active = r, a.event && a.event.start.call(e, e.__data__, t), a.tween.forEach(function(n, r) {
(r = r.call(e, e.__data__, t)) && g.push(r)
}), f = a.ease, d = a.duration, sa.timer(function() {
return p.c = c(n || 1) ? Nt : c, 1
}, 0, s)
}
function c(n) {
if (i.active !== r) return 1;
for (var o = n / d, s = f(o), l = g.length; l > 0;) g[--l].call(e, s);
return o >= 1 ? (a.event && a.event.end.call(e, e.__data__, t), u()) : void 0
}
function u() {
return --i.count ? delete i[r] : delete e[n], 1
}
var d, f, m = a.delay,
p = as,
g = [];
return p.t = m + s, m <= o ? l(o - m) : void(p.c = l)
}, 0, s)
}
}
function ea(e, t, n) {
e.attr("transform", function(e) {
var r = t(e);
return "translate(" + (isFinite(r) ? r : n(e)) + ",0)"
})
}
function ta(e, t, n) {
e.attr("transform", function(e) {
var r = t(e);
return "translate(0," + (isFinite(r) ? r : n(e)) + ")"
})
}
function na(e) {
return e.toISOString()
}
function ra(e, t, n) {
function r(t) {
return e(t)
}
function o(e, n) {
var r = e[1] - e[0],
o = r / n,
i = sa.bisect(Kl, o);
return i == Kl.length ? [t.year, Xo(e.map(function(e) {
return e / 31536e6
}), n)[2]] : i ? t[o / Kl[i - 1] < Kl[i] / o ? i - 1 : i] : [Xl, Xo(e, n)[2]]
}
return r.invert = function(t) {
return oa(e.invert(t))
}, r.domain = function(t) {
return arguments.length ? (e.domain(t), r) : e.domain().map(oa)
}, r.nice = function(e, t) {
function n(n) {
return !isNaN(n) && !e.range(n, oa(+n + 1), t).length
}
var i = r.domain(),
a = $o(i),
s = null == e ? o(a, 10) : "number" == typeof e && o(a, e);
return s && (e = s[0], t = s[1]), r.domain(jo(i, t > 1 ? {
floor: function(t) {
for (; n(t = e.floor(t));) t = oa(t - 1);
return t
},
ceil: function(t) {
for (; n(t = e.ceil(t));) t = oa(+t + 1);
return t
}
} : e))
}, r.ticks = function(e, t) {
var n = $o(r.domain()),
i = null == e ? o(n, 10) : "number" == typeof e ? o(n, e) : !e.range && [{
range: e
}, t];
return i && (e = i[0], t = i[1]), e.range(n[0], oa(+n[1] + 1), t < 1 ? 1 : t)
}, r.tickFormat = function() {
return n
}, r.copy = function() {
return ra(e.copy(), t, n)
}, Zo(r, e)
}
function oa(e) {
return new Date(e)
}
function ia(e) {
return JSON.parse(e.responseText)
}
function aa(e) {
var t = ua.createRange();
return t.selectNode(ua.body), t.createContextualFragment(e.responseText)
}
var sa = {
version: "3.5.6"
},
la = [].slice,
ca = function(e) {
return la.call(e)
},
ua = this.document;
if (ua) try {
ca(ua.documentElement.childNodes)[0].nodeType
} catch (e) {
ca = function(e) {
for (var t = e.length, n = new Array(t); t--;) n[t] = e[t];
return n
}
}
if (Date.now || (Date.now = function() {
return +new Date
}), ua) try {
ua.createElement("DIV").style.setProperty("opacity", 0, "")
} catch (e) {
var da = this.Element.prototype,
fa = da.setAttribute,
ma = da.setAttributeNS,
pa = this.CSSStyleDeclaration.prototype,
ga = pa.setProperty;
da.setAttribute = function(e, t) {
fa.call(this, e, t + "")
}, da.setAttributeNS = function(e, t, n) {
ma.call(this, e, t, n + "")
}, pa.setProperty = function(e, t, n) {
ga.call(this, e, t + "", n)
}
}
sa.ascending = s, sa.descending = function(e, t) {
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN
}, sa.min = function(e, t) {
var n, r, o = -1,
i = e.length;
if (1 === arguments.length) {
for (; ++o < i;)
if (null != (r = e[o]) && r >= r) {
n = r;
break
} for (; ++o < i;) null != (r = e[o]) && n > r && (n = r)
} else {
for (; ++o < i;)
if (null != (r = t.call(e, e[o], o)) && r >= r) {
n = r;
break
} for (; ++o < i;) null != (r = t.call(e, e[o], o)) && n > r && (n = r)
}
return n
}, sa.max = function(e, t) {
var n, r, o = -1,
i = e.length;
if (1 === arguments.length) {
for (; ++o < i;)
if (null != (r = e[o]) && r >= r) {
n = r;
break
} for (; ++o < i;) null != (r = e[o]) && r > n && (n = r)
} else {
for (; ++o < i;)
if (null != (r = t.call(e, e[o], o)) && r >= r) {
n = r;
break
} for (; ++o < i;) null != (r = t.call(e, e[o], o)) && r > n && (n = r)
}
return n
}, sa.extent = function(e, t) {
var n, r, o, i = -1,
a = e.length;
if (1 === arguments.length) {
for (; ++i < a;)
if (null != (r = e[i]) && r >= r) {
n = o = r;
break
} for (; ++i < a;) null != (r = e[i]) && (n > r && (n = r), o < r && (o = r))
} else {
for (; ++i < a;)
if (null != (r = t.call(e, e[i], i)) && r >= r) {
n = o = r;
break
} for (; ++i < a;) null != (r = t.call(e, e[i], i)) && (n > r && (n = r), o < r && (o = r))
}
return [n, o]
}, sa.sum = function(e, t) {
var n, r = 0,
o = e.length,
i = -1;
if (1 === arguments.length)
for (; ++i < o;) c(n = +e[i]) && (r += n);
else
for (; ++i < o;) c(n = +t.call(e, e[i], i)) && (r += n);
return r
}, sa.mean = function(e, t) {
var n, r = 0,
o = e.length,
i = -1,
a = o;
if (1 === arguments.length)
for (; ++i < o;) c(n = l(e[i])) ? r += n : --a;
else
for (; ++i < o;) c(n = l(t.call(e, e[i], i))) ? r += n : --a;
if (a) return r / a
}, sa.quantile = function(e, t) {
var n = (e.length - 1) * t + 1,
r = Math.floor(n),
o = +e[r - 1],
i = n - r;
return i ? o + i * (e[r] - o) : o
}, sa.median = function(e, t) {
var n, r = [],
o = e.length,
i = -1;
if (1 === arguments.length)
for (; ++i < o;) c(n = l(e[i])) && r.push(n);
else
for (; ++i < o;) c(n = l(t.call(e, e[i], i))) && r.push(n);
if (r.length) return sa.quantile(r.sort(s), .5)
}, sa.variance = function(e, t) {
var n, r, o = e.length,
i = 0,
a = 0,
s = -1,
u = 0;
if (1 === arguments.length)
for (; ++s < o;) c(n = l(e[s])) && (r = n - i, i += r / ++u, a += r * (n - i));
else
for (; ++s < o;) c(n = l(t.call(e, e[s], s))) && (r = n - i, i += r / ++u, a += r * (n - i));
if (u > 1) return a / (u - 1)
}, sa.deviation = function() {
var e = sa.variance.apply(this, arguments);
return e ? Math.sqrt(e) : e
};
var va = u(s);
sa.bisectLeft = va.left, sa.bisect = sa.bisectRight = va.right, sa.bisector = function(e) {
return u(1 === e.length ? function(t, n) {
return s(e(t), n)
} : e)
}, sa.shuffle = function(e, t, n) {
(i = arguments.length) < 3 && (n = e.length, i < 2 && (t = 0));
for (var r, o, i = n - t; i;) o = Math.random() * i-- | 0, r = e[i + t], e[i + t] = e[o + t], e[o + t] = r;
return e
}, sa.permute = function(e, t) {
for (var n = t.length, r = new Array(n); n--;) r[n] = e[t[n]];
return r
}, sa.pairs = function(e) {
for (var t, n = 0, r = e.length - 1, o = e[0], i = new Array(r < 0 ? 0 : r); n < r;) i[n] = [t = o, o = e[++n]];
return i
}, sa.zip = function() {
if (!(r = arguments.length)) return [];
for (var e = -1, t = sa.min(arguments, d), n = new Array(t); ++e < t;)
for (var r, o = -1, i = n[e] = new Array(r); ++o < r;) i[o] = arguments[o][e];
return n
}, sa.transpose = function(e) {
return sa.zip.apply(sa, e)
}, sa.keys = function(e) {
var t = [];
for (var n in e) t.push(n);
return t
}, sa.values = function(e) {
var t = [];
for (var n in e) t.push(e[n]);
return t
}, sa.entries = function(e) {
var t = [];
for (var n in e) t.push({
key: n,
value: e[n]
});
return t
}, sa.merge = function(e) {
for (var t, n, r, o = e.length, i = -1, a = 0; ++i < o;) a += e[i].length;
for (n = new Array(a); --o >= 0;)
for (r = e[o], t = r.length; --t >= 0;) n[--a] = r[t];
return n
};
var ha = Math.abs;
sa.range = function(e, t, n) {
if (arguments.length < 3 && (n = 1, arguments.length < 2 && (t = e, e = 0)), (t - e) / n === 1 / 0) throw new Error("infinite range");
var r, o = [],
i = f(ha(n)),
a = -1;
if (e *= i, t *= i, n *= i, n < 0)
for (;
(r = e + n * ++a) > t;) o.push(r / i);
else
for (;
(r = e + n * ++a) < t;) o.push(r / i);
return o
}, sa.map = function(e, t) {
var n = new p;
if (e instanceof p) e.forEach(function(e, t) {
n.set(e, t)
});
else if (Array.isArray(e)) {
var r, o = -1,
i = e.length;
if (1 === arguments.length)
for (; ++o < i;) n.set(o, e[o]);
else
for (; ++o < i;) n.set(t.call(e, r = e[o], o), r)
} else
for (var a in e) n.set(a, e[a]);
return n
};
var ya = "__proto__",
ba = "\0";
m(p, {
has: h,
get: function(e) {
return this._[g(e)]
},
set: function(e, t) {
return this._[g(e)] = t
},
remove: y,
keys: b,
values: function() {
var e = [];
for (var t in this._) e.push(this._[t]);
return e
},
entries: function() {
var e = [];
for (var t in this._) e.push({
key: v(t),
value: this._[t]
});
return e
},
size: E,
empty: S,
forEach: function(e) {
for (var t in this._) e.call(this, v(t), this._[t])
}
}), sa.nest = function() {
function e(t, a, s) {
if (s >= i.length) return r ? r.call(o, a) : n ? a.sort(n) : a;
for (var l, c, u, d, f = -1, m = a.length, g = i[s++], v = new p; ++f < m;)(d = v.get(l = g(c = a[f]))) ? d.push(c) : v.set(l, [c]);
return t ? (c = t(), u = function(n, r) {
c.set(n, e(t, r, s))
}) : (c = {}, u = function(n, r) {
c[n] = e(t, r, s)
}), v.forEach(u), c
}
function t(e, n) {
if (n >= i.length) return e;
var r = [],
o = a[n++];
return e.forEach(function(e, o) {
r.push({
key: e,
values: t(o, n)
})
}), o ? r.sort(function(e, t) {
return o(e.key, t.key)
}) : r
}
var n, r, o = {},
i = [],
a = [];
return o.map = function(t, n) {
return e(n, t, 0)
}, o.entries = function(n) {
return t(e(sa.map, n, 0), 0)
}, o.key = function(e) {
return i.push(e), o
}, o.sortKeys = function(e) {
return a[i.length - 1] = e, o
}, o.sortValues = function(e) {
return n = e, o
}, o.rollup = function(e) {
return r = e, o
}, o
}, sa.set = function(e) {
var t = new _;
if (e)
for (var n = 0, r = e.length; n < r; ++n) t.add(e[n]);
return t
}, m(_, {
has: h,
add: function(e) {
return this._[g(e += "")] = !0, e
},
remove: y,
values: b,
size: E,
empty: S,
forEach: function(e) {
for (var t in this._) e.call(this, v(t))
}
}), sa.behavior = {}, sa.rebind = function(e, t) {
for (var n, r = 1, o = arguments.length; ++r < o;) e[n = arguments[r]] = A(e, t, t[n]);
return e
};
var Ea = ["webkit", "ms", "moz", "Moz", "o", "O"];
sa.dispatch = function() {
for (var e = new I, t = -1, n = arguments.length; ++t < n;) e[arguments[t]] = x(e);
return e
}, I.prototype.on = function(e, t) {
var n = e.indexOf("."),
r = "";
if (n >= 0 && (r = e.slice(n + 1), e = e.slice(0, n)), e) return arguments.length < 2 ? this[e].on(r) : this[e].on(r, t);
if (2 === arguments.length) {
if (null == t)
for (e in this) this.hasOwnProperty(e) && this[e].on(r, null);
return this
}
}, sa.event = null, sa.requote = function(e) {
return e.replace(Sa, "\\$&")
};
var Sa = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,
_a = {}.__proto__ ? function(e, t) {
e.__proto__ = t
} : function(e, t) {
for (var n in t) e[n] = t[n]
},
wa = function(e, t) {
return t.querySelector(e)
},
Aa = function(e, t) {
return t.querySelectorAll(e)
},
Ta = function(e, t) {
var n = e.matches || e[T(e, "matchesSelector")];
return (Ta = function(e, t) {
return n.call(e, t)
})(e, t)
};
"function" == typeof Sizzle && (wa = function(e, t) {
return Sizzle(e, t)[0] || null
}, Aa = Sizzle, Ta = Sizzle.matchesSelector), sa.selection = function() {
return sa.select(ua.documentElement)
};
var Ca = sa.selection.prototype = [];
Ca.select = function(e) {
var t, n, r, o, i = [];
e = N(e);
for (var a = -1, s = this.length; ++a < s;) {
i.push(t = []), t.parentNode = (r = this[a]).parentNode;
for (var l = -1, c = r.length; ++l < c;)(o = r[l]) ? (t.push(n = e.call(o, o.__data__, l, a)), n && "__data__" in o && (n.__data__ = o.__data__)) : t.push(null)
}
return R(i)
}, Ca.selectAll = function(e) {
var t, n, r = [];
e = L(e);
for (var o = -1, i = this.length; ++o < i;)
for (var a = this[o], s = -1, l = a.length; ++s < l;)(n = a[s]) && (r.push(t = ca(e.call(n, n.__data__, s, o))), t.parentNode = n);
return R(r)
};
var Ia = {
svg: "http://www.w3.org/2000/svg",
xhtml: "http://www.w3.org/1999/xhtml",
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
sa.ns = {
prefix: Ia,
qualify: function(e) {
var t = e.indexOf(":"),
n = e;
return t >= 0 && (n = e.slice(0, t), e = e.slice(t + 1)), Ia.hasOwnProperty(n) ? {
space: Ia[n],
local: e
} : e
}
}, Ca.attr = function(e, t) {
if (arguments.length < 2) {
if ("string" == typeof e) {
var n = this.node();
return e = sa.ns.qualify(e), e.local ? n.getAttributeNS(e.space, e.local) : n.getAttribute(e)
}
for (t in e) this.each(k(t, e[t]));
return this
}
return this.each(k(e, t))
}, Ca.classed = function(e, t) {
if (arguments.length < 2) {
if ("string" == typeof e) {
var n = this.node(),
r = (e = F(e)).length,
o = -1;
if (t = n.classList) {
for (; ++o < r;)
if (!t.contains(e[o])) return !1
} else
for (t = n.getAttribute("class"); ++o < r;)
if (!G(e[o]).test(t)) return !1;
return !0
}
for (t in e) this.each(U(t, e[t]));
return this
}
return this.each(U(e, t))
}, Ca.style = function(e, t, n) {
var r = arguments.length;
if (r < 3) {
if ("string" != typeof e) {
r < 2 && (t = "");
for (n in e) this.each(z(n, e[n], t));
return this
}
if (r < 2) {
var o = this.node();
return a(o).getComputedStyle(o, null).getPropertyValue(e)
}
n = ""
}
return this.each(z(e, t, n))
}, Ca.property = function(e, t) {
if (arguments.length < 2) {
if ("string" == typeof e) return this.node()[e];
for (t in e) this.each(B(t, e[t]));
return this
}
return this.each(B(e, t))
}, Ca.text = function(e) {
return arguments.length ? this.each("function" == typeof e ? function() {
var t = e.apply(this, arguments);
this.textContent = null == t ? "" : t
} : null == e ? function() {
this.textContent = ""
} : function() {
this.textContent = e
}) : this.node().textContent
}, Ca.html = function(e) {
return arguments.length ? this.each("function" == typeof e ? function() {
var t = e.apply(this, arguments);
this.innerHTML = null == t ? "" : t
} : null == e ? function() {
this.innerHTML = ""
} : function() {
this.innerHTML = e
}) : this.node().innerHTML
}, Ca.append = function(e) {
return e = $(e), this.select(function() {
return this.appendChild(e.apply(this, arguments))
})
}, Ca.insert = function(e, t) {
return e = $(e), t = N(t), this.select(function() {
return this.insertBefore(e.apply(this, arguments), t.apply(this, arguments) || null)
})
}, Ca.remove = function() {
return this.each(W)
}, Ca.data = function(e, t) {
function n(e, n) {
var r, o, i, a = e.length,
u = n.length,
d = Math.min(a, u),
f = new Array(u),
m = new Array(u),
g = new Array(a);
if (t) {
var v, h = new p,
y = new Array(a);
for (r = -1; ++r < a;) h.has(v = t.call(o = e[r], o.__data__, r)) ? g[r] = o : h.set(v, o), y[r] = v;
for (r = -1; ++r < u;)(o = h.get(v = t.call(n, i = n[r], r))) ? o !== !0 && (f[r] = o, o.__data__ = i) : m[r] = H(i), h.set(v, !0);
for (r = -1; ++r < a;) h.get(y[r]) !== !0 && (g[r] = e[r])
} else {
for (r = -1; ++r < d;) o = e[r], i = n[r], o ? (o.__data__ = i, f[r] = o) : m[r] = H(i);
for (; r < u; ++r) m[r] = H(n[r]);
for (; r < a; ++r) g[r] = e[r]
}
m.update = f, m.parentNode = f.parentNode = g.parentNode = e.parentNode, s.push(m), l.push(f), c.push(g)
}
var r, o, i = -1,
a = this.length;
if (!arguments.length) {
for (e = new Array(a = (r = this[0]).length); ++i < a;)(o = r[i]) && (e[i] = o.__data__);
return e
}
var s = K([]),
l = R([]),
c = R([]);
if ("function" == typeof e)
for (; ++i < a;) n(r = this[i], e.call(r, r.parentNode.__data__, i));
else
for (; ++i < a;) n(r = this[i], e);
return l.enter = function() {
return s
}, l.exit = function() {
return c
}, l
}, Ca.datum = function(e) {
return arguments.length ? this.property("__data__", e) : this.property("__data__")
}, Ca.filter = function(e) {
var t, n, r, o = [];
"function" != typeof e && (e = j(e));
for (var i = 0, a = this.length; i < a; i++) {
o.push(t = []), t.parentNode = (n = this[i]).parentNode;
for (var s = 0, l = n.length; s < l; s++)(r = n[s]) && e.call(r, r.__data__, s, i) && t.push(r)
}
return R(o)
}, Ca.order = function() {
for (var e = -1, t = this.length; ++e < t;)
for (var n, r = this[e], o = r.length - 1, i = r[o]; --o >= 0;)(n = r[o]) && (i && i !== n.nextSibling && i.parentNode.insertBefore(n, i), i = n);
return this
}, Ca.sort = function(e) {
e = Y.apply(this, arguments);
for (var t = -1, n = this.length; ++t < n;) this[t].sort(e);
return this.order()
}, Ca.each = function(e) {
return q(this, function(t, n, r) {
e.call(t, t.__data__, n, r)
})
}, Ca.call = function(e) {
var t = ca(arguments);
return e.apply(t[0] = this, t), this
}, Ca.empty = function() {
return !this.node()
}, Ca.node = function() {
for (var e = 0, t = this.length; e < t; e++)
for (var n = this[e], r = 0, o = n.length; r < o; r++) {
var i = n[r];
if (i) return i
}
return null
}, Ca.size = function() {
var e = 0;
return q(this, function() {
++e
}), e
};
var xa = [];
sa.selection.enter = K, sa.selection.enter.prototype = xa, xa.append = Ca.append, xa.empty = Ca.empty, xa.node = Ca.node, xa.call = Ca.call, xa.size = Ca.size, xa.select = function(e) {
for (var t, n, r, o, i, a = [], s = -1, l = this.length; ++s < l;) {
r = (o = this[s]).update, a.push(t = []), t.parentNode = o.parentNode;
for (var c = -1, u = o.length; ++c < u;)(i = o[c]) ? (t.push(r[c] = n = e.call(o.parentNode, i.__data__, c, s)), n.__data__ = i.__data__) : t.push(null)
}
return R(a)
}, xa.insert = function(e, t) {
return arguments.length < 2 && (t = Z(this)), Ca.insert.call(this, e, t)
}, sa.select = function(e) {
var t;
return "string" == typeof e ? (t = [wa(e, ua)], t.parentNode = ua.documentElement) : (t = [e], t.parentNode = i(e)), R([t])
}, sa.selectAll = function(e) {
var t;
return "string" == typeof e ? (t = ca(Aa(e, ua)), t.parentNode = ua.documentElement) : (t = e, t.parentNode = null), R([t])
}, Ca.on = function(e, t, n) {
var r = arguments.length;
if (r < 3) {
if ("string" != typeof e) {
r < 2 && (t = !1);
for (n in e) this.each(Q(n, e[n], t));
return this
}
if (r < 2) return (r = this.node()["__on" + e]) && r._;
n = !1
}
return this.each(Q(e, t, n))
};
var Da = sa.map({
mouseenter: "mouseover",
mouseleave: "mouseout"
});
ua && Da.forEach(function(e) {
"on" + e in ua && Da.remove(e)
});
var Ma, Oa = 0;
sa.mouse = function(e) {
return te(e, M())
};
var Ra = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
sa.touch = function(e, t, n) {
if (arguments.length < 3 && (n = t, t = M().changedTouches), t)
for (var r, o = 0, i = t.length; o < i; ++o)
if ((r = t[o]).identifier === n) return te(e, r)
}, sa.behavior.drag = function() {
function e() {
this.on("mousedown.drag", o).on("touchstart.drag", i)
}
function t(e, t, o, i, a) {
return function() {
function s() {
var e, n, r = t(f, g);
r && (e = r[0] - b[0], n = r[1] - b[1], p |= e | n, b = r, m({
type: "drag",
x: r[0] + c[0],
y: r[1] + c[1],
dx: e,
dy: n
}))
}
function l() {
t(f, g) && (h.on(i + v, null).on(a + v, null), y(p && sa.event.target === d), m({
type: "dragend"
}))
}
var c, u = this,
d = sa.event.target,
f = u.parentNode,
m = n.of(u, arguments),
p = 0,
g = e(),
v = ".drag" + (null == g ? "" : "-" + g),
h = sa.select(o(d)).on(i + v, s).on(a + v, l),
y = ee(d),
b = t(f, g);
r ? (c = r.apply(u, arguments), c = [c.x - b[0], c.y - b[1]]) : c = [0, 0], m({
type: "dragstart"
})
}
}
var n = O(e, "drag", "dragstart", "dragend"),
r = null,
o = t(C, sa.mouse, a, "mousemove", "mouseup"),
i = t(ne, sa.touch, w, "touchmove", "touchend");
return e.origin = function(t) {
return arguments.length ? (r = t, e) : r
}, sa.rebind(e, n, "on")
}, sa.touches = function(e, t) {
return arguments.length < 2 && (t = M().touches), t ? ca(t).map(function(t) {
var n = te(e, t);
return n.identifier = t.identifier, n
}) : []
};
var Na = 1e-6,
La = Na * Na,
ka = Math.PI,
Pa = 2 * ka,
Ga = Pa - Na,
Fa = ka / 2,
Ua = ka / 180,
Va = 180 / ka,
za = Math.SQRT2,
Ba = 2,
$a = 4;
sa.interpolateZoom = function(e, t) {
function n(e) {
var t = e * y;
if (h) {
var n = le(g),
a = i / (Ba * f) * (n * ce(za * t + g) - se(g));
return [r + a * c, o + a * u, i * n / le(za * t + g)]
}
return [r + e * c, o + e * u, i * Math.exp(za * t)]
}
var r = e[0],
o = e[1],
i = e[2],
a = t[0],
s = t[1],
l = t[2],
c = a - r,
u = s - o,
d = c * c + u * u,
f = Math.sqrt(d),
m = (l * l - i * i + $a * d) / (2 * i * Ba * f),
p = (l * l - i * i - $a * d) / (2 * l * Ba * f),
g = Math.log(Math.sqrt(m * m + 1) - m),
v = Math.log(Math.sqrt(p * p + 1) - p),
h = v - g,
y = (h || Math.log(l / i)) / za;
return n.duration = 1e3 * y, n
}, sa.behavior.zoom = function() {
function e(e) {
e.on(M, d).on(Ha + ".zoom", m).on("dblclick.zoom", p).on(L, f)
}
function t(e) {
return [(e[0] - A.x) / A.k, (e[1] - A.y) / A.k]
}
function n(e) {
return [e[0] * A.k + A.x, e[1] * A.k + A.y]
}
function r(e) {
A.k = Math.max(C[0], Math.min(C[1], e))
}
function o(e, t) {
t = n(t), A.x += e[0] - t[0], A.y += e[1] - t[1]
}
function i(t, n, i, a) {
t.__chart__ = {
x: A.x,
y: A.y,
k: A.k
}, r(Math.pow(2, a)), o(v = n, i), t = sa.select(t), I > 0 && (t = t.transition().duration(I)), t.call(e.event)
}
function s() {
S && S.domain(E.range().map(function(e) {
return (e - A.x) / A.k
}).map(E.invert)), w && w.domain(_.range().map(function(e) {
return (e - A.y) / A.k
}).map(_.invert))
}
function l(e) {
x++ || e({
type: "zoomstart"
})
}
function c(e) {
s(), e({
type: "zoom",
scale: A.k,
translate: [A.x, A.y]
})
}
function u(e) {
--x || (e({
type: "zoomend"
}), v = null)
}
function d() {
function e() {
d = 1, o(sa.mouse(r), m), c(s)
}
function n() {
f.on(R, null).on(N, null), p(d && sa.event.target === i), u(s)
}
var r = this,
i = sa.event.target,
s = k.of(r, arguments),
d = 0,
f = sa.select(a(r)).on(R, e).on(N, n),
m = t(sa.mouse(r)),
p = ee(r);
Ul.call(r), l(s)
}
function f() {
function e() {
var e = sa.touches(p);
return m = A.k, e.forEach(function(e) {
e.identifier in v && (v[e.identifier] = t(e))
}), e
}
function n() {
var t = sa.event.target;
sa.select(t).on(E, a).on(S, s), _.push(t);
for (var n = sa.event.changedTouches, r = 0, o = n.length; r < o; ++r) v[n[r].identifier] = null;
var l = e(),
c = Date.now();
if (1 === l.length) {
if (c - b < 500) {
var u = l[0];
i(p, u, v[u.identifier], Math.floor(Math.log(A.k) / Math.LN2) + 1), D()
}
b = c
} else if (l.length > 1) {
var u = l[0],
d = l[1],
f = u[0] - d[0],
m = u[1] - d[1];
h = f * f + m * m
}
}
function a() {
var e, t, n, i, a = sa.touches(p);
Ul.call(p);
for (var s = 0, l = a.length; s < l; ++s, i = null)
if (n = a[s], i = v[n.identifier]) {
if (t) break;
e = n, t = i
} if (i) {
var u = (u = n[0] - e[0]) * u + (u = n[1] - e[1]) * u,
d = h && Math.sqrt(u / h);
e = [(e[0] + n[0]) / 2, (e[1] + n[1]) / 2], t = [(t[0] + i[0]) / 2, (t[1] + i[1]) / 2], r(d * m)
}
b = null, o(e, t), c(g)
}
function s() {
if (sa.event.touches.length) {
for (var t = sa.event.changedTouches, n = 0, r = t.length; n < r; ++n) delete v[t[n].identifier];
for (var o in v) return void e()
}
sa.selectAll(_).on(y, null), w.on(M, d).on(L, f), T(), u(g)
}
var m, p = this,
g = k.of(p, arguments),
v = {},
h = 0,
y = ".zoom-" + sa.event.changedTouches[0].identifier,
E = "touchmove" + y,
S = "touchend" + y,
_ = [],
w = sa.select(p),
T = ee(p);
n(), l(g), w.on(M, null).on(L, n)
}
function m() {
var e = k.of(this, arguments);
y ? clearTimeout(y) : (Ul.call(this), g = t(v = h || sa.mouse(this)), l(e)), y = setTimeout(function() {
y = null, u(e)
}, 50), D(), r(Math.pow(2, .002 * Wa()) * A.k), o(v, g), c(e)
}
function p() {
var e = sa.mouse(this),
n = Math.log(A.k) / Math.LN2;
i(this, e, t(e), sa.event.shiftKey ? Math.ceil(n) - 1 : Math.floor(n) + 1)
}
var g, v, h, y, b, E, S, _, w, A = {
x: 0,
y: 0,
k: 1
},
T = [960, 500],
C = ja,
I = 250,
x = 0,
M = "mousedown.zoom",
R = "mousemove.zoom",
N = "mouseup.zoom",
L = "touchstart.zoom",
k = O(e, "zoomstart", "zoom", "zoomend");
return Ha || (Ha = "onwheel" in ua ? (Wa = function() {
return -sa.event.deltaY * (sa.event.deltaMode ? 120 : 1)
}, "wheel") : "onmousewheel" in ua ? (Wa = function() {
return sa.event.wheelDelta
}, "mousewheel") : (Wa = function() {
return -sa.event.detail
}, "MozMousePixelScroll")), e.event = function(e) {
e.each(function() {
var e = k.of(this, arguments),
t = A;
Gl ? sa.select(this).transition().each("start.zoom", function() {
A = this.__chart__ || {
x: 0,
y: 0,
k: 1
}, l(e)
}).tween("zoom:zoom", function() {
var n = T[0],
r = T[1],
o = v ? v[0] : n / 2,
i = v ? v[1] : r / 2,
a = sa.interpolateZoom([(o - A.x) / A.k, (i - A.y) / A.k, n / A.k], [(o - t.x) / t.k, (i - t.y) / t.k, n / t.k]);
return function(t) {
var r = a(t),
s = n / r[2];
this.__chart__ = A = {
x: o - r[0] * s,
y: i - r[1] * s,
k: s
}, c(e)
}
}).each("interrupt.zoom", function() {
u(e)
}).each("end.zoom", function() {
u(e)
}) : (this.__chart__ = A, l(e), c(e), u(e))
})
}, e.translate = function(t) {
return arguments.length ? (A = {
x: +t[0],
y: +t[1],
k: A.k
}, s(), e) : [A.x, A.y]
}, e.scale = function(t) {
return arguments.length ? (A = {
x: A.x,
y: A.y,
k: +t
}, s(), e) : A.k
}, e.scaleExtent = function(t) {
return arguments.length ? (C = null == t ? ja : [+t[0], +t[1]], e) : C
}, e.center = function(t) {
return arguments.length ? (h = t && [+t[0], +t[1]], e) : h
}, e.size = function(t) {
return arguments.length ? (T = t && [+t[0], +t[1]], e) : T
}, e.duration = function(t) {
return arguments.length ? (I = +t, e) : I
}, e.x = function(t) {
return arguments.length ? (S = t, E = t.copy(), A = {
x: 0,
y: 0,
k: 1
}, e) : S
}, e.y = function(t) {
return arguments.length ? (w = t, _ = t.copy(), A = {
x: 0,
y: 0,
k: 1
}, e) : w
}, sa.rebind(e, k, "on")
};
var Wa, Ha, ja = [0, 1 / 0];
sa.color = de, de.prototype.toString = function() {
return this.rgb() + ""
}, sa.hsl = fe;
var Ya = fe.prototype = new de;
Ya.brighter = function(e) {
return e = Math.pow(.7, arguments.length ? e : 1), new fe(this.h, this.s, this.l / e)
}, Ya.darker = function(e) {
return e = Math.pow(.7, arguments.length ? e : 1), new fe(this.h, this.s, e * this.l)
}, Ya.rgb = function() {
return me(this.h, this.s, this.l)
}, sa.hcl = pe;
var qa = pe.prototype = new de;
qa.brighter = function(e) {
return new pe(this.h, this.c, Math.min(100, this.l + Ka * (arguments.length ? e : 1)))
}, qa.darker = function(e) {
return new pe(this.h, this.c, Math.max(0, this.l - Ka * (arguments.length ? e : 1)))
}, qa.rgb = function() {
return ge(this.h, this.c, this.l).rgb()
}, sa.lab = ve;
var Ka = 18,
Za = .95047,
Qa = 1,
Xa = 1.08883,
Ja = ve.prototype = new de;
Ja.brighter = function(e) {
return new ve(Math.min(100, this.l + Ka * (arguments.length ? e : 1)), this.a, this.b)
}, Ja.darker = function(e) {
return new ve(Math.max(0, this.l - Ka * (arguments.length ? e : 1)), this.a, this.b)
}, Ja.rgb = function() {
return he(this.l, this.a, this.b)
}, sa.rgb = _e;
var es = _e.prototype = new de;
es.brighter = function(e) {
e = Math.pow(.7, arguments.length ? e : 1);
var t = this.r,
n = this.g,
r = this.b,
o = 30;
return t || n || r ? (t && t < o && (t = o), n && n < o && (n = o), r && r < o && (r = o), new _e(Math.min(255, t / e), Math.min(255, n / e), Math.min(255, r / e))) : new _e(o, o, o)
}, es.darker = function(e) {
return e = Math.pow(.7, arguments.length ? e : 1), new _e(e * this.r, e * this.g, e * this.b)
}, es.hsl = function() {
return Ie(this.r, this.g, this.b)
}, es.toString = function() {
return "#" + Te(this.r) + Te(this.g) + Te(this.b)
};
var ts = sa.map({
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
});
ts.forEach(function(e, t) {
ts.set(e, we(t))
}), sa.functor = Oe, sa.xhr = Re(w), sa.dsv = function(e, t) {
function n(e, n, i) {
arguments.length < 3 && (i = n, n = null);
var a = Ne(e, t, null == n ? r : o(n), i);
return a.row = function(e) {
return arguments.length ? a.response(null == (n = e) ? r : o(e)) : n
}, a
}
function r(e) {
return n.parse(e.responseText)
}
function o(e) {
return function(t) {
return n.parse(t.responseText, e)
}
}
function i(t) {
return t.map(a).join(e)
}
function a(e) {
return s.test(e) ? '"' + e.replace(/\"/g, '""') + '"' : e
}
var s = new RegExp('["' + e + "\n]"),
l = e.charCodeAt(0);
return n.parse = function(e, t) {
var r;
return n.parseRows(e, function(e, n) {
if (r) return r(e, n - 1);
var o = new Function("d", "return {" + e.map(function(e, t) {
return JSON.stringify(e) + ": d[" + t + "]"
}).join(",") + "}");
r = t ? function(e, n) {
return t(o(e), n)
} : o
})
}, n.parseRows = function(e, t) {
function n() {
if (u >= c) return a;
if (o) return o = !1, i;
var t = u;
if (34 === e.charCodeAt(t)) {
for (var n = t; n++ < c;)
if (34 === e.charCodeAt(n)) {
if (34 !== e.charCodeAt(n + 1)) break;
++n
} u = n + 2;
var r = e.charCodeAt(n + 1);
return 13 === r ? (o = !0, 10 === e.charCodeAt(n + 2) && ++u) : 10 === r && (o = !0), e.slice(t + 1, n).replace(/""/g, '"')
}
for (; u < c;) {
var r = e.charCodeAt(u++),
s = 1;
if (10 === r) o = !0;
else if (13 === r) o = !0, 10 === e.charCodeAt(u) && (++u, ++s);
else if (r !== l) continue;
return e.slice(t, u - s)
}
return e.slice(t)
}
for (var r, o, i = {}, a = {}, s = [], c = e.length, u = 0, d = 0;
(r = n()) !== a;) {
for (var f = []; r !== i && r !== a;) f.push(r), r = n();
t && null == (f = t(f, d++)) || s.push(f)
}
return s
}, n.format = function(t) {
if (Array.isArray(t[0])) return n.formatRows(t);
var r = new _,
o = [];
return t.forEach(function(e) {
for (var t in e) r.has(t) || o.push(r.add(t))
}), [o.map(a).join(e)].concat(t.map(function(t) {
return o.map(function(e) {
return a(t[e])
}).join(e)
})).join("\n")
}, n.formatRows = function(e) {
return e.map(i).join("\n")
}, n
}, sa.csv = sa.dsv(",", "text/csv"), sa.tsv = sa.dsv("\t", "text/tab-separated-values");
var ns, rs, os, is, as, ss = this[T(this, "requestAnimationFrame")] || function(e) {
setTimeout(e, 17)
};
sa.timer = function(e, t, n) {
var r = arguments.length;
r < 2 && (t = 0), r < 3 && (n = Date.now());
var o = n + t,
i = {
c: e,
t: o,
f: !1,
n: null
};
rs ? rs.n = i : ns = i, rs = i, os || (is = clearTimeout(is), os = 1, ss(Pe))
}, sa.timer.flush = function() {
Ge(), Fe()
}, sa.round = function(e, t) {
return t ? Math.round(e * (t = Math.pow(10, t))) / t : Math.round(e)
};
var ls = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"].map(Ve);
sa.formatPrefix = function(e, t) {
var n = 0;
return e && (e < 0 && (e *= -1), t && (e = sa.round(e, Ue(e, t))), n = 1 + Math.floor(1e-12 + Math.log(e) / Math.LN10), n = Math.max(-24, Math.min(24, 3 * Math.floor((n - 1) / 3)))), ls[8 + n / 3]
};
var cs = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,
us = sa.map({
b: function(e) {
return e.toString(2)
},
c: function(e) {
return String.fromCharCode(e)
},
o: function(e) {
return e.toString(8)
},
x: function(e) {
return e.toString(16)
},
X: function(e) {
return e.toString(16).toUpperCase()
},
g: function(e, t) {
return e.toPrecision(t)
},
e: function(e, t) {
return e.toExponential(t)
},
f: function(e, t) {
return e.toFixed(t)
},
r: function(e, t) {
return (e = sa.round(e, Ue(e, t))).toFixed(Math.max(0, Math.min(20, Ue(e * (1 + 1e-15), t))))
}
}),
ds = sa.time = {},
fs = Date;
$e.prototype = {
getDate: function() {
return this._.getUTCDate()
},
getDay: function() {
return this._.getUTCDay()
},
getFullYear: function() {
return this._.getUTCFullYear()
},
getHours: function() {
return this._.getUTCHours()
},
getMilliseconds: function() {
return this._.getUTCMilliseconds()
},
getMinutes: function() {
return this._.getUTCMinutes()
},
getMonth: function() {
return this._.getUTCMonth()
},
getSeconds: function() {
return this._.getUTCSeconds()
},
getTime: function() {
return this._.getTime()
},
getTimezoneOffset: function() {
return 0
},
valueOf: function() {
return this._.valueOf()
},
setDate: function() {
ms.setUTCDate.apply(this._, arguments)
},
setDay: function() {
ms.setUTCDay.apply(this._, arguments)
},
setFullYear: function() {
ms.setUTCFullYear.apply(this._, arguments)
},
setHours: function() {
ms.setUTCHours.apply(this._, arguments)
},
setMilliseconds: function() {
ms.setUTCMilliseconds.apply(this._, arguments)
},
setMinutes: function() {
ms.setUTCMinutes.apply(this._, arguments)
},
setMonth: function() {
ms.setUTCMonth.apply(this._, arguments)
},
setSeconds: function() {
ms.setUTCSeconds.apply(this._, arguments)
},
setTime: function() {
ms.setTime.apply(this._, arguments)
}
};
var ms = Date.prototype;
ds.year = We(function(e) {
return e = ds.day(e), e.setMonth(0, 1), e
}, function(e, t) {
e.setFullYear(e.getFullYear() + t)
}, function(e) {
return e.getFullYear()
}), ds.years = ds.year.range, ds.years.utc = ds.year.utc.range, ds.day = We(function(e) {
var t = new fs(2e3, 0);
return t.setFullYear(e.getFullYear(), e.getMonth(), e.getDate()), t
}, function(e, t) {
e.setDate(e.getDate() + t)
}, function(e) {
return e.getDate() - 1
}), ds.days = ds.day.range, ds.days.utc = ds.day.utc.range, ds.dayOfYear = function(e) {
var t = ds.year(e);
return Math.floor((e - t - 6e4 * (e.getTimezoneOffset() - t.getTimezoneOffset())) / 864e5)
}, ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"].forEach(function(e, t) {
t = 7 - t;
var n = ds[e] = We(function(e) {
return (e = ds.day(e)).setDate(e.getDate() - (e.getDay() + t) % 7), e
}, function(e, t) {
e.setDate(e.getDate() + 7 * Math.floor(t))
}, function(e) {
var n = ds.year(e).getDay();
return Math.floor((ds.dayOfYear(e) + (n + t) % 7) / 7) - (n !== t)
});
ds[e + "s"] = n.range, ds[e + "s"].utc = n.utc.range, ds[e + "OfYear"] = function(e) {
var n = ds.year(e).getDay();
return Math.floor((ds.dayOfYear(e) + (n + t) % 7) / 7)
}
}), ds.week = ds.sunday, ds.weeks = ds.sunday.range, ds.weeks.utc = ds.sunday.utc.range, ds.weekOfYear = ds.sundayOfYear;
var ps = {
"-": "",
_: " ",
0: "0"
},
gs = /^\s*\d+/,
vs = /^%/;
sa.locale = function(e) {
return {
numberFormat: ze(e),
timeFormat: je(e)
}
};
var hs = sa.locale({
decimal: ".",
thousands: ",",
grouping: [3],
currency: ["$", ""],
dateTime: "%a %b %e %X %Y",
date: "%m/%d/%Y",
time: "%H:%M:%S",
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"]
});
sa.format = hs.numberFormat, sa.geo = {}, mt.prototype = {
s: 0,
t: 0,
add: function(e) {
pt(e, this.t, ys), pt(ys.s, this.s, this), this.s ? this.t += ys.t : this.s = ys.t
},
reset: function() {
this.s = this.t = 0
},
valueOf: function() {
return this.s
}
};
var ys = new mt;
sa.geo.stream = function(e, t) {
e && bs.hasOwnProperty(e.type) ? bs[e.type](e, t) : gt(e, t)
};
var bs = {
Feature: function(e, t) {
gt(e.geometry, t)
},
FeatureCollection: function(e, t) {
for (var n = e.features, r = -1, o = n.length; ++r < o;) gt(n[r].geometry, t)
}
},
Es = {
Sphere: function(e, t) {
t.sphere()
},
Point: function(e, t) {
e = e.coordinates, t.point(e[0], e[1], e[2])
},
MultiPoint: function(e, t) {
for (var n = e.coordinates, r = -1, o = n.length; ++r < o;) e = n[r], t.point(e[0], e[1], e[2])
},
LineString: function(e, t) {
vt(e.coordinates, t, 0)
},
MultiLineString: function(e, t) {
for (var n = e.coordinates, r = -1, o = n.length; ++r < o;) vt(n[r], t, 0)
},
Polygon: function(e, t) {
ht(e.coordinates, t)
},
MultiPolygon: function(e, t) {
for (var n = e.coordinates, r = -1, o = n.length; ++r < o;) ht(n[r], t)
},
GeometryCollection: function(e, t) {
for (var n = e.geometries, r = -1, o = n.length; ++r < o;) gt(n[r], t)
}
};
sa.geo.area = function(e) {
return Ss = 0, sa.geo.stream(e, ws), Ss
};
var Ss, _s = new mt,
ws = {
sphere: function() {
Ss += 4 * ka
},
point: C,
lineStart: C,
lineEnd: C,
polygonStart: function() {
_s.reset(), ws.lineStart = yt
},
polygonEnd: function() {
var e = 2 * _s;
Ss += e < 0 ? 4 * ka + e : e, ws.lineStart = ws.lineEnd = ws.point = C
}
};
sa.geo.bounds = function() {
function e(e, t) {
b.push(E = [u = e, f = e]), t < d && (d = t), t > m && (m = t)
}
function t(t, n) {
var r = bt([t * Ua, n * Ua]);
if (h) {
var o = St(h, r),
i = [o[1], -o[0], 0],
a = St(i, o);
At(a), a = Tt(a);
var l = t - p,
c = l > 0 ? 1 : -1,
g = a[0] * Va * c,
v = ha(l) > 180;
if (v ^ (c * p < g && g < c * t)) {
var y = a[1] * Va;
y > m && (m = y)
} else if (g = (g + 360) % 360 - 180, v ^ (c * p < g && g < c * t)) {
var y = -a[1] * Va;
y < d && (d = y)
} else n < d && (d = n), n > m && (m = n);
v ? t < p ? s(u, t) > s(u, f) && (f = t) : s(t, f) > s(u, f) && (u = t) : f >= u ? (t < u && (u = t), t > f && (f = t)) : t > p ? s(u, t) > s(u, f) && (f = t) : s(t, f) > s(u, f) && (u = t)
} else e(t, n);
h = r, p = t
}
function n() {
S.point = t
}
function r() {
E[0] = u, E[1] = f, S.point = e, h = null
}
function o(e, n) {
if (h) {
var r = e - p;
y += ha(r) > 180 ? r + (r > 0 ? 360 : -360) : r
} else g = e, v = n;
ws.point(e, n), t(e, n)
}
function i() {
ws.lineStart()
}
function a() {
o(g, v), ws.lineEnd(), ha(y) > Na && (u = -(f = 180)), E[0] = u, E[1] = f, h = null
}
function s(e, t) {
return (t -= e) < 0 ? t + 360 : t
}
function l(e, t) {
return e[0] - t[0]
}
function c(e, t) {
return t[0] <= t[1] ? t[0] <= e && e <= t[1] : e < t[0] || t[1] < e
}
var u, d, f, m, p, g, v, h, y, b, E, S = {
point: e,
lineStart: n,
lineEnd: r,
polygonStart: function() {
S.point = o, S.lineStart = i, S.lineEnd = a, y = 0, ws.polygonStart()
},
polygonEnd: function() {
ws.polygonEnd(), S.point = e, S.lineStart = n, S.lineEnd = r, _s < 0 ? (u = -(f = 180), d = -(m = 90)) : y > Na ? m = 90 : y < -Na && (d = -90), E[0] = u, E[1] = f
}
};
return function(e) {
m = f = -(u = d = 1 / 0), b = [], sa.geo.stream(e, S);
var t = b.length;
if (t) {
b.sort(l);
for (var n, r = 1, o = b[0], i = [o]; r < t; ++r) n = b[r], c(n[0], o) || c(n[1], o) ? (s(o[0], n[1]) > s(o[0], o[1]) && (o[1] = n[1]), s(n[0], o[1]) > s(o[0], o[1]) && (o[0] = n[0])) : i.push(o = n);
for (var a, n, p = -(1 / 0), t = i.length - 1, r = 0, o = i[t]; r <= t; o = n, ++r) n = i[r], (a = s(o[1], n[0])) > p && (p = a, u = n[0], f = o[1])
}
return b = E = null, u === 1 / 0 || d === 1 / 0 ? [
[NaN, NaN],
[NaN, NaN]
] : [
[u, d],
[f, m]
]
}
}(), sa.geo.centroid = function(e) {
As = Ts = Cs = Is = xs = Ds = Ms = Os = Rs = Ns = Ls = 0, sa.geo.stream(e, ks);
var t = Rs,
n = Ns,
r = Ls,
o = t * t + n * n + r * r;
return o < La && (t = Ds, n = Ms, r = Os, Ts < Na && (t = Cs, n = Is, r = xs), o = t * t + n * n + r * r, o < La) ? [NaN, NaN] : [Math.atan2(n, t) * Va, ae(r / Math.sqrt(o)) * Va]
};
var As, Ts, Cs, Is, xs, Ds, Ms, Os, Rs, Ns, Ls, ks = {
sphere: C,
point: It,
lineStart: Dt,
lineEnd: Mt,
polygonStart: function() {
ks.lineStart = Ot
},
polygonEnd: function() {
ks.lineStart = Dt
}
},
Ps = Gt(Nt, zt, $t, [-ka, -ka / 2]),
Gs = 1e9;
sa.geo.clipExtent = function() {
var e, t, n, r, o, i, a = {
stream: function(e) {
return o && (o.valid = !1), o = i(e), o.valid = !0, o
},
extent: function(s) {
return arguments.length ? (i = Yt(e = +s[0][0], t = +s[0][1], n = +s[1][0], r = +s[1][1]), o && (o.valid = !1, o = null), a) : [
[e, t],
[n, r]
]
}
};
return a.extent([
[0, 0],
[960, 500]
])
}, (sa.geo.conicEqualArea = function() {
return qt(Kt)
}).raw = Kt, sa.geo.albers = function() {
return sa.geo.conicEqualArea().rotate([96, 0]).center([-.6, 38.7]).parallels([29.5, 45.5]).scale(1070)
}, sa.geo.albersUsa = function() {
function e(e) {
var i = e[0],
a = e[1];
return t = null, n(i, a), t || (r(i, a), t) || o(i, a), t
}
var t, n, r, o, i = sa.geo.albers(),
a = sa.geo.conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]),
s = sa.geo.conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]),
l = {
point: function(e, n) {
t = [e, n]
}
};
return e.invert = function(e) {
var t = i.scale(),
n = i.translate(),
r = (e[0] - n[0]) / t,
o = (e[1] - n[1]) / t;
return (o >= .12 && o < .234 && r >= -.425 && r < -.214 ? a : o >= .166 && o < .234 && r >= -.214 && r < -.115 ? s : i).invert(e)
}, e.stream = function(e) {
var t = i.stream(e),
n = a.stream(e),
r = s.stream(e);
return {
point: function(e, o) {
t.point(e, o), n.point(e, o), r.point(e, o)
},
sphere: function() {
t.sphere(), n.sphere(), r.sphere()
},
lineStart: function() {
t.lineStart(), n.lineStart(), r.lineStart()
},
lineEnd: function() {
t.lineEnd(), n.lineEnd(), r.lineEnd()
},
polygonStart: function() {
t.polygonStart(), n.polygonStart(), r.polygonStart()
},
polygonEnd: function() {
t.polygonEnd(), n.polygonEnd(), r.polygonEnd()
}
}
}, e.precision = function(t) {
return arguments.length ? (i.precision(t), a.precision(t), s.precision(t), e) : i.precision()
}, e.scale = function(t) {
return arguments.length ? (i.scale(t), a.scale(.35 * t), s.scale(t), e.translate(i.translate())) : i.scale()
}, e.translate = function(t) {
if (!arguments.length) return i.translate();
var c = i.scale(),
u = +t[0],
d = +t[1];
return n = i.translate(t).clipExtent([
[u - .455 * c, d - .238 * c],
[u + .455 * c, d + .238 * c]
]).stream(l).point, r = a.translate([u - .307 * c, d + .201 * c]).clipExtent([
[u - .425 * c + Na, d + .12 * c + Na],
[u - .214 * c - Na, d + .234 * c - Na]
]).stream(l).point, o = s.translate([u - .205 * c, d + .212 * c]).clipExtent([
[u - .214 * c + Na, d + .166 * c + Na],
[u - .115 * c - Na, d + .234 * c - Na]
]).stream(l).point, e
}, e.scale(1070)
};
var Fs, Us, Vs, zs, Bs, $s, Ws = {
point: C,
lineStart: C,
lineEnd: C,
polygonStart: function() {
Us = 0, Ws.lineStart = Zt
},
polygonEnd: function() {
Ws.lineStart = Ws.lineEnd = Ws.point = C, Fs += ha(Us / 2)
}
},
Hs = {
point: Qt,
lineStart: C,
lineEnd: C,
polygonStart: C,
polygonEnd: C
},
js = {
point: en,
lineStart: tn,
lineEnd: nn,
polygonStart: function() {
js.lineStart = rn
},
polygonEnd: function() {
js.point = en, js.lineStart = tn, js.lineEnd = nn
}
};
sa.geo.path = function() {
function e(e) {
return e && ("function" == typeof s && i.pointRadius(+s.apply(this, arguments)), a && a.valid || (a = o(i)), sa.geo.stream(e, a)), i.result()
}
function t() {
return a = null, e
}
var n, r, o, i, a, s = 4.5;
return e.area = function(e) {
return Fs = 0, sa.geo.stream(e, o(Ws)), Fs
}, e.centroid = function(e) {
return Cs = Is = xs = Ds = Ms = Os = Rs = Ns = Ls = 0, sa.geo.stream(e, o(js)), Ls ? [Rs / Ls, Ns / Ls] : Os ? [Ds / Os, Ms / Os] : xs ? [Cs / xs, Is / xs] : [NaN, NaN]
}, e.bounds = function(e) {
return Bs = $s = -(Vs = zs = 1 / 0), sa.geo.stream(e, o(Hs)), [
[Vs, zs],
[Bs, $s]
]
}, e.projection = function(e) {
return arguments.length ? (o = (n = e) ? e.stream || sn(e) : w, t()) : n
}, e.context = function(e) {
return arguments.length ? (i = null == (r = e) ? new Xt : new on(e), "function" != typeof s && i.pointRadius(s), t()) : r
}, e.pointRadius = function(t) {
return arguments.length ? (s = "function" == typeof t ? t : (i.pointRadius(+t), +t), e) : s
}, e.projection(sa.geo.albersUsa()).context(null)
}, sa.geo.transform = function(e) {
return {
stream: function(t) {
var n = new ln(t);
for (var r in e) n[r] = e[r];
return n
}
}
}, ln.prototype = {
point: function(e, t) {
this.stream.point(e, t)
},
sphere: function() {
this.stream.sphere()
},
lineStart: function() {
this.stream.lineStart()
},
lineEnd: function() {
this.stream.lineEnd()
},
polygonStart: function() {
this.stream.polygonStart()
},
polygonEnd: function() {
this.stream.polygonEnd()
}
}, sa.geo.projection = un, sa.geo.projectionMutator = dn, (sa.geo.equirectangular = function() {
return un(mn)
}).raw = mn.invert = mn, sa.geo.rotation = function(e) {
function t(t) {
return t = e(t[0] * Ua, t[1] * Ua), t[0] *= Va, t[1] *= Va, t
}
return e = gn(e[0] % 360 * Ua, e[1] * Ua, e.length > 2 ? e[2] * Ua : 0), t.invert = function(t) {
return t = e.invert(t[0] * Ua, t[1] * Ua), t[0] *= Va, t[1] *= Va, t
}, t
}, pn.invert = mn, sa.geo.circle = function() {
function e() {
var e = "function" == typeof r ? r.apply(this, arguments) : r,
t = gn(-e[0] * Ua, -e[1] * Ua, 0).invert,
o = [];
return n(null, null, 1, {
point: function(e, n) {
o.push(e = t(e, n)), e[0] *= Va, e[1] *= Va
}
}), {
type: "Polygon",
coordinates: [o]
}
}
var t, n, r = [0, 0],
o = 6;
return e.origin = function(t) {
return arguments.length ? (r = t, e) : r
}, e.angle = function(r) {
return arguments.length ? (n = bn((t = +r) * Ua, o * Ua), e) : t
}, e.precision = function(r) {
return arguments.length ? (n = bn(t * Ua, (o = +r) * Ua), e) : o
}, e.angle(90)
}, sa.geo.distance = function(e, t) {
var n, r = (t[0] - e[0]) * Ua,
o = e[1] * Ua,
i = t[1] * Ua,
a = Math.sin(r),
s = Math.cos(r),
l = Math.sin(o),
c = Math.cos(o),
u = Math.sin(i),
d = Math.cos(i);
return Math.atan2(Math.sqrt((n = d * a) * n + (n = c * u - l * d * s) * n), l * u + c * d * s)
}, sa.geo.graticule = function() {
function e() {
return {
type: "MultiLineString",
coordinates: t()
}
}
function t() {
return sa.range(Math.ceil(i / v) * v, o, v).map(f).concat(sa.range(Math.ceil(c / h) * h, l, h).map(m)).concat(sa.range(Math.ceil(r / p) * p, n, p).filter(function(e) {
return ha(e % v) > Na
}).map(u)).concat(sa.range(Math.ceil(s / g) * g, a, g).filter(function(e) {
return ha(e % h) > Na
}).map(d))
}
var n, r, o, i, a, s, l, c, u, d, f, m, p = 10,
g = p,
v = 90,
h = 360,
y = 2.5;
return e.lines = function() {
return t().map(function(e) {
return {
type: "LineString",
coordinates: e
}
})
}, e.outline = function() {
return {
type: "Polygon",
coordinates: [f(i).concat(m(l).slice(1), f(o).reverse().slice(1), m(c).reverse().slice(1))]
}
}, e.extent = function(t) {
return arguments.length ? e.majorExtent(t).minorExtent(t) : e.minorExtent()
}, e.majorExtent = function(t) {
return arguments.length ? (i = +t[0][0], o = +t[1][0], c = +t[0][1], l = +t[1][1], i > o && (t = i, i = o, o = t), c > l && (t = c, c = l, l = t), e.precision(y)) : [
[i, c],
[o, l]
]
}, e.minorExtent = function(t) {
return arguments.length ? (r = +t[0][0], n = +t[1][0], s = +t[0][1], a = +t[1][1], r > n && (t = r, r = n, n = t), s > a && (t = s, s = a, a = t), e.precision(y)) : [
[r, s],
[n, a]
]
}, e.step = function(t) {
return arguments.length ? e.majorStep(t).minorStep(t) : e.minorStep()
}, e.majorStep = function(t) {
return arguments.length ? (v = +t[0], h = +t[1], e) : [v, h]
}, e.minorStep = function(t) {
return arguments.length ? (p = +t[0], g = +t[1], e) : [p, g]
}, e.precision = function(t) {
return arguments.length ? (y = +t, u = Sn(s, a, 90), d = _n(r, n, y), f = Sn(c, l, 90), m = _n(i, o, y), e) : y
}, e.majorExtent([
[-180, -90 + Na],
[180, 90 - Na]
]).minorExtent([
[-180, -80 - Na],
[180, 80 + Na]
])
}, sa.geo.greatArc = function() {
function e() {
return {
type: "LineString",
coordinates: [t || r.apply(this, arguments), n || o.apply(this, arguments)]
}
}
var t, n, r = wn,
o = An;
return e.distance = function() {
return sa.geo.distance(t || r.apply(this, arguments), n || o.apply(this, arguments))
}, e.source = function(n) {
return arguments.length ? (r = n, t = "function" == typeof n ? null : n, e) : r
}, e.target = function(t) {
return arguments.length ? (o = t, n = "function" == typeof t ? null : t, e) : o
}, e.precision = function() {
return arguments.length ? e : 0
}, e
}, sa.geo.interpolate = function(e, t) {
return Tn(e[0] * Ua, e[1] * Ua, t[0] * Ua, t[1] * Ua)
}, sa.geo.length = function(e) {
return Ys = 0, sa.geo.stream(e, qs), Ys
};
var Ys, qs = {
sphere: C,
point: C,
lineStart: Cn,
lineEnd: C,
polygonStart: C,
polygonEnd: C
},
Ks = In(function(e) {
return Math.sqrt(2 / (1 + e))
}, function(e) {
return 2 * Math.asin(e / 2)
});
(sa.geo.azimuthalEqualArea = function() {
return un(Ks)
}).raw = Ks;
var Zs = In(function(e) {
var t = Math.acos(e);
return t && t / Math.sin(t)
}, w);
(sa.geo.azimuthalEquidistant = function() {
return un(Zs)
}).raw = Zs, (sa.geo.conicConformal = function() {
return qt(xn)
}).raw = xn, (sa.geo.conicEquidistant = function() {
return qt(Dn)
}).raw = Dn;
var Qs = In(function(e) {
return 1 / e
}, Math.atan);
(sa.geo.gnomonic = function() {
return un(Qs)
}).raw = Qs, Mn.invert = function(e, t) {
return [e, 2 * Math.atan(Math.exp(t)) - Fa]
}, (sa.geo.mercator = function() {
return On(Mn)
}).raw = Mn;
var Xs = In(function() {
return 1
}, Math.asin);
(sa.geo.orthographic = function() {
return un(Xs)
}).raw = Xs;
var Js = In(function(e) {
return 1 / (1 + e)
}, function(e) {
return 2 * Math.atan(e)
});
(sa.geo.stereographic = function() {
return un(Js)
}).raw = Js, Rn.invert = function(e, t) {
return [-t, 2 * Math.atan(Math.exp(e)) - Fa]
}, (sa.geo.transverseMercator = function() {
var e = On(Rn),
t = e.center,
n = e.rotate;
return e.center = function(e) {
return e ? t([-e[1], e[0]]) : (e = t(), [e[1], -e[0]])
}, e.rotate = function(e) {
return e ? n([e[0], e[1], e.length > 2 ? e[2] + 90 : 90]) : (e = n(), [e[0], e[1], e[2] - 90])
}, n([0, 0, 90])
}).raw = Rn, sa.geom = {}, sa.geom.hull = function(e) {
function t(e) {
if (e.length < 3) return [];
var t, o = Oe(n),
i = Oe(r),
a = e.length,
s = [],
l = [];
for (t = 0; t < a; t++) s.push([+o.call(this, e[t], t), +i.call(this, e[t], t), t]);
for (s.sort(Pn), t = 0; t < a; t++) l.push([s[t][0], -s[t][1]]);
var c = kn(s),
u = kn(l),
d = u[0] === c[0],
f = u[u.length - 1] === c[c.length - 1],
m = [];
for (t = c.length - 1; t >= 0; --t) m.push(e[s[c[t]][2]]);
for (t = +d; t < u.length - f; ++t) m.push(e[s[u[t]][2]]);
return m
}
var n = Nn,
r = Ln;
return arguments.length ? t(e) : (t.x = function(e) {
return arguments.length ? (n = e, t) : n
}, t.y = function(e) {
return arguments.length ? (r = e, t) : r
}, t)
}, sa.geom.polygon = function(e) {
return _a(e, el), e
};
var el = sa.geom.polygon.prototype = [];
el.area = function() {
for (var e, t = -1, n = this.length, r = this[n - 1], o = 0; ++t < n;) e = r, r = this[t], o += e[1] * r[0] - e[0] * r[1];
return .5 * o
}, el.centroid = function(e) {
var t, n, r = -1,
o = this.length,
i = 0,
a = 0,
s = this[o - 1];
for (arguments.length || (e = -1 / (6 * this.area())); ++r < o;) t = s, s = this[r], n = t[0] * s[1] - s[0] * t[1], i += (t[0] + s[0]) * n, a += (t[1] + s[1]) * n;
return [i * e, a * e]
}, el.clip = function(e) {
for (var t, n, r, o, i, a, s = Un(e), l = -1, c = this.length - Un(this), u = this[c - 1]; ++l < c;) {
for (t = e.slice(), e.length = 0, o = this[l], i = t[(r = t.length - s) - 1], n = -1; ++n < r;) a = t[n], Gn(a, u, o) ? (Gn(i, u, o) || e.push(Fn(i, a, u, o)), e.push(a)) : Gn(i, u, o) && e.push(Fn(i, a, u, o)), i = a;
s && e.push(e[0]), u = o
}
return e
};
var tl, nl, rl, ol, il, al = [],
sl = [];
Yn.prototype.prepare = function() {
for (var e, t = this.edges, n = t.length; n--;) e = t[n].edge, e.b && e.a || t.splice(n, 1);
return t.sort(Kn), t.length
}, ir.prototype = {
start: function() {
return this.edge.l === this.site ? this.edge.a : this.edge.b
},
end: function() {
return this.edge.l === this.site ? this.edge.b : this.edge.a
}
}, ar.prototype = {
insert: function(e, t) {
var n, r, o;
if (e) {
if (t.P = e, t.N = e.N, e.N && (e.N.P = t), e.N = t, e.R) {
for (e = e.R; e.L;) e = e.L;
e.L = t
} else e.R = t;
n = e
} else this._ ? (e = ur(this._), t.P = null, t.N = e, e.P = e.L = t, n = e) : (t.P = t.N = null, this._ = t, n = null);
for (t.L = t.R = null, t.U = n, t.C = !0, e = t; n && n.C;) r = n.U, n === r.L ? (o = r.R, o && o.C ? (n.C = o.C = !1, r.C = !0, e = r) : (e === n.R && (lr(this, n), e = n, n = e.U), n.C = !1, r.C = !0, cr(this, r))) : (o = r.L, o && o.C ? (n.C = o.C = !1, r.C = !0, e = r) : (e === n.L && (cr(this, n), e = n, n = e.U), n.C = !1, r.C = !0, lr(this, r))), n = e.U;
this._.C = !1
},
remove: function(e) {
e.N && (e.N.P = e.P), e.P && (e.P.N = e.N), e.N = e.P = null;
var t, n, r, o = e.U,
i = e.L,
a = e.R;
if (n = i ? a ? ur(a) : i : a, o ? o.L === e ? o.L = n : o.R = n : this._ = n, i && a ? (r = n.C, n.C = e.C, n.L = i, i.U = n, n !== a ? (o = n.U, n.U = e.U, e = n.R, o.L = e, n.R = a, a.U = n) : (n.U = o, o = n, e = n.R)) : (r = e.C, e = n), e && (e.U = o), !r) {
if (e && e.C) return void(e.C = !1);
do {
if (e === this._) break;
if (e === o.L) {
if (t = o.R, t.C && (t.C = !1, o.C = !0, lr(this, o), t = o.R), t.L && t.L.C || t.R && t.R.C) {
t.R && t.R.C || (t.L.C = !1, t.C = !0, cr(this, t), t = o.R), t.C = o.C, o.C = t.R.C = !1, lr(this, o), e = this._;
break
}
} else if (t = o.L, t.C && (t.C = !1, o.C = !0, cr(this, o), t = o.L), t.L && t.L.C || t.R && t.R.C) {
t.L && t.L.C || (t.R.C = !1, t.C = !0, lr(this, t), t = o.L), t.C = o.C, o.C = t.L.C = !1, cr(this, o), e = this._;
break
}
t.C = !0, e = o, o = o.U
} while (!e.C);
e && (e.C = !1)
}
}
}, sa.geom.voronoi = function(e) {
function t(e) {
var t = new Array(e.length),
r = s[0][0],
o = s[0][1],
i = s[1][0],
a = s[1][1];
return dr(n(e), s).cells.forEach(function(n, s) {
var l = n.edges,
c = n.site,
u = t[s] = l.length ? l.map(function(e) {
var t = e.start();
return [t.x, t.y]
}) : c.x >= r && c.x <= i && c.y >= o && c.y <= a ? [
[r, a],
[i, a],
[i, o],
[r, o]
] : [];
u.point = e[s]
}), t
}
function n(e) {
return e.map(function(e, t) {
return {
x: Math.round(i(e, t) / Na) * Na,
y: Math.round(a(e, t) / Na) * Na,
i: t
}
})
}
var r = Nn,
o = Ln,
i = r,
a = o,
s = ll;
return e ? t(e) : (t.links = function(e) {
return dr(n(e)).edges.filter(function(e) {
return e.l && e.r
}).map(function(t) {
return {
source: e[t.l.i],
target: e[t.r.i]
}
})
}, t.triangles = function(e) {
var t = [];
return dr(n(e)).cells.forEach(function(n, r) {
for (var o, i, a = n.site, s = n.edges.sort(Kn), l = -1, c = s.length, u = s[c - 1].edge, d = u.l === a ? u.r : u.l; ++l < c;) o = u, i = d, u = s[l].edge, d = u.l === a ? u.r : u.l, r < i.i && r < d.i && mr(a, i, d) < 0 && t.push([e[r], e[i.i], e[d.i]])
}), t
}, t.x = function(e) {
return arguments.length ? (i = Oe(r = e), t) : r
}, t.y = function(e) {
return arguments.length ? (a = Oe(o = e), t) : o
}, t.clipExtent = function(e) {
return arguments.length ? (s = null == e ? ll : e, t) : s === ll ? null : s
}, t.size = function(e) {
return arguments.length ? t.clipExtent(e && [
[0, 0], e
]) : s === ll ? null : s && s[1]
}, t)
};
var ll = [
[-1e6, -1e6],
[1e6, 1e6]
];
sa.geom.delaunay = function(e) {
return sa.geom.voronoi().triangles(e)
}, sa.geom.quadtree = function(e, t, n, r, o) {
function i(e) {
function i(e, t, n, r, o, i, a, s) {
if (!isNaN(n) && !isNaN(r))
if (e.leaf) {
var l = e.x,
u = e.y;
if (null != l)
if (ha(l - n) + ha(u - r) < .01) c(e, t, n, r, o, i, a, s);
else {
var d = e.point;
e.x = e.y = e.point = null, c(e, d, l, u, o, i, a, s), c(e, t, n, r, o, i, a, s)
}
else e.x = n, e.y = r, e.point = t
} else c(e, t, n, r, o, i, a, s)
}
function c(e, t, n, r, o, a, s, l) {
var c = .5 * (o + s),
u = .5 * (a + l),
d = n >= c,
f = r >= u,
m = f << 1 | d;
e.leaf = !1, e = e.nodes[m] || (e.nodes[m] = vr()), d ? o = c : s = c, f ? a = u : l = u, i(e, t, n, r, o, a, s, l)
}
var u, d, f, m, p, g, v, h, y, b = Oe(s),
E = Oe(l);
if (null != t) g = t, v = n, h = r, y = o;
else if (h = y = -(g = v = 1 / 0), d = [], f = [], p = e.length, a)
for (m = 0; m < p; ++m) u = e[m], u.x < g && (g = u.x), u.y < v && (v = u.y), u.x > h && (h = u.x), u.y > y && (y = u.y), d.push(u.x), f.push(u.y);
else
for (m = 0; m < p; ++m) {
var S = +b(u = e[m], m),
_ = +E(u, m);
S < g && (g = S), _ < v && (v = _), S > h && (h = S), _ > y && (y = _), d.push(S), f.push(_)
}
var w = h - g,
A = y - v;
w > A ? y = v + w : h = g + A;
var T = vr();
if (T.add = function(e) {
i(T, e, +b(e, ++m), +E(e, m), g, v, h, y)
}, T.visit = function(e) {
hr(e, T, g, v, h, y)
}, T.find = function(e) {
return yr(T, e[0], e[1], g, v, h, y)
}, m = -1, null == t) {
for (; ++m < p;) i(T, e[m], d[m], f[m], g, v, h, y);
--m
} else e.forEach(T.add);
return d = f = e = u = null, T
}
var a, s = Nn,
l = Ln;
return (a = arguments.length) ? (s = pr, l = gr, 3 === a && (o = n, r = t, n = t = 0), i(e)) : (i.x = function(e) {
return arguments.length ? (s = e, i) : s
}, i.y = function(e) {
return arguments.length ? (l = e, i) : l
}, i.extent = function(e) {
return arguments.length ? (null == e ? t = n = r = o = null : (t = +e[0][0], n = +e[0][1], r = +e[1][0], o = +e[1][1]), i) : null == t ? null : [
[t, n],
[r, o]
]
}, i.size = function(e) {
return arguments.length ? (null == e ? t = n = r = o = null : (t = n = 0, r = +e[0], o = +e[1]), i) : null == t ? null : [r - t, o - n]
}, i)
}, sa.interpolateRgb = br, sa.interpolateObject = Er, sa.interpolateNumber = Sr, sa.interpolateString = _r;
var cl = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
ul = new RegExp(cl.source, "g");
sa.interpolate = wr, sa.interpolators = [function(e, t) {
var n = typeof t;
return ("string" === n ? ts.has(t.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(t) ? br : _r : t instanceof de ? br : Array.isArray(t) ? Ar : "object" === n && isNaN(t) ? Er : Sr)(e, t)
}], sa.interpolateArray = Ar;
var dl = function() {
return w
},
fl = sa.map({
linear: dl,
poly: Or,
quad: function() {
return xr
},
cubic: function() {
return Dr
},
sin: function() {
return Rr
},
exp: function() {
return Nr
},
circle: function() {
return Lr
},
elastic: kr,
back: Pr,
bounce: function() {
return Gr
}
}),
ml = sa.map({
in: w,
out: Cr,
"in-out": Ir,
"out-in": function(e) {
return Ir(Cr(e))
}
});
sa.ease = function(e) {
var t = e.indexOf("-"),
n = t >= 0 ? e.slice(0, t) : e,
r = t >= 0 ? e.slice(t + 1) : "in";
return n = fl.get(n) || dl, r = ml.get(r) || w, Tr(r(n.apply(null, la.call(arguments, 1))))
}, sa.interpolateHcl = Fr, sa.interpolateHsl = Ur, sa.interpolateLab = Vr, sa.interpolateRound = zr, sa.transform = function(e) {
var t = ua.createElementNS(sa.ns.prefix.svg, "g");
return (sa.transform = function(e) {
if (null != e) {
t.setAttribute("transform", e);
var n = t.transform.baseVal.consolidate()
}
return new Br(n ? n.matrix : pl)
})(e)
}, Br.prototype.toString = function() {
return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"
};
var pl = {
a: 1,
b: 0,
c: 0,
d: 1,
e: 0,
f: 0
};
sa.interpolateTransform = jr, sa.layout = {}, sa.layout.bundle = function() {
return function(e) {
for (var t = [], n = -1, r = e.length; ++n < r;) t.push(Kr(e[n]));
return t
}
}, sa.layout.chord = function() {
function e() {
var e, c, d, f, m, p = {},
g = [],
v = sa.range(i),
h = [];
for (n = [], r = [], e = 0, f = -1; ++f < i;) {
for (c = 0, m = -1; ++m < i;) c += o[f][m];
g.push(c), h.push(sa.range(i)), e += c
}
for (a && v.sort(function(e, t) {
return a(g[e], g[t])
}), s && h.forEach(function(e, t) {
e.sort(function(e, n) {
return s(o[t][e], o[t][n])
})
}), e = (Pa - u * i) / e, c = 0, f = -1; ++f < i;) {
for (d = c, m = -1; ++m < i;) {
var y = v[f],
b = h[y][m],
E = o[y][b],
S = c,
_ = c += E * e;
p[y + "-" + b] = {
index: y,
subindex: b,
startAngle: S,
endAngle: _,
value: E
}
}
r[y] = {
index: y,
startAngle: d,
endAngle: c,
value: (c - d) / e
}, c += u
}
for (f = -1; ++f < i;)
for (m = f - 1; ++m < i;) {
var w = p[f + "-" + m],
A = p[m + "-" + f];
(w.value || A.value) && n.push(w.value < A.value ? {
source: A,
target: w
} : {
source: w,
target: A
})
}
l && t()
}
function t() {
n.sort(function(e, t) {
return l((e.source.value + e.target.value) / 2, (t.source.value + t.target.value) / 2)
})
}
var n, r, o, i, a, s, l, c = {},
u = 0;
return c.matrix = function(e) {
return arguments.length ? (i = (o = e) && o.length, n = r = null, c) : o
}, c.padding = function(e) {
return arguments.length ? (u = e, n = r = null, c) : u
}, c.sortGroups = function(e) {
return arguments.length ? (a = e, n = r = null, c) : a
}, c.sortSubgroups = function(e) {
return arguments.length ? (s = e, n = null, c) : s
}, c.sortChords = function(e) {
return arguments.length ? (l = e, n && t(), c) : l
}, c.chords = function() {
return n || e(), n
}, c.groups = function() {
return r || e(), r
}, c
}, sa.layout.force = function() {
function e(e) {
return function(t, n, r, o) {
if (t.point !== e) {
var i = t.cx - e.x,
a = t.cy - e.y,
s = o - n,
l = i * i + a * a;
if (s * s / v < l) {
if (l < p) {
var c = t.charge / l;
e.px -= i * c, e.py -= a * c
}
return !0
}
if (t.point && l && l < p) {
var c = t.pointCharge / l;
e.px -= i * c, e.py -= a * c
}
}
return !t.charge
}
}
function t(e) {
e.px = sa.event.x, e.py = sa.event.y, s.resume()
}
var n, r, o, i, a, s = {},
l = sa.dispatch("start", "tick", "end"),
c = [1, 1],
u = .9,
d = gl,
f = vl,
m = -30,
p = hl,
g = .1,
v = .64,
h = [],
y = [];
return s.tick = function() {
if ((r *= .99) < .005) return l.end({
type: "end",
alpha: r = 0
}), !0;
var t, n, s, d, f, p, v, b, E, S = h.length,
_ = y.length;
for (n = 0; n < _; ++n) s = y[n], d = s.source, f = s.target, b = f.x - d.x, E = f.y - d.y, (p = b * b + E * E) && (p = r * i[n] * ((p = Math.sqrt(p)) - o[n]) / p, b *= p, E *= p, f.x -= b * (v = d.weight / (f.weight + d.weight)), f.y -= E * v, d.x += b * (v = 1 - v), d.y += E * v);
if ((v = r * g) && (b = c[0] / 2, E = c[1] / 2, n = -1, v))
for (; ++n < S;) s = h[n], s.x += (b - s.x) * v, s.y += (E - s.y) * v;
if (m)
for (no(t = sa.geom.quadtree(h), r, a), n = -1; ++n < S;)(s = h[n]).fixed || t.visit(e(s));
for (n = -1; ++n < S;) s = h[n], s.fixed ? (s.x = s.px, s.y = s.py) : (s.x -= (s.px - (s.px = s.x)) * u, s.y -= (s.py - (s.py = s.y)) * u);
l.tick({
type: "tick",
alpha: r
})
}, s.nodes = function(e) {
return arguments.length ? (h = e, s) : h
}, s.links = function(e) {
return arguments.length ? (y = e, s) : y
}, s.size = function(e) {
return arguments.length ? (c = e, s) : c
}, s.linkDistance = function(e) {
return arguments.length ? (d = "function" == typeof e ? e : +e, s) : d
}, s.distance = s.linkDistance, s.linkStrength = function(e) {
return arguments.length ? (f = "function" == typeof e ? e : +e, s) : f
}, s.friction = function(e) {
return arguments.length ? (u = +e, s) : u
}, s.charge = function(e) {
return arguments.length ? (m = "function" == typeof e ? e : +e, s) : m
}, s.chargeDistance = function(e) {
return arguments.length ? (p = e * e, s) : Math.sqrt(p)
}, s.gravity = function(e) {
return arguments.length ? (g = +e, s) : g
}, s.theta = function(e) {
return arguments.length ? (v = e * e, s) : Math.sqrt(v)
}, s.alpha = function(e) {
return arguments.length ? (e = +e, r ? r = e > 0 ? e : 0 : e > 0 && (l.start({
type: "start",
alpha: r = e
}), sa.timer(s.tick)), s) : r
}, s.start = function() {
function e(e, r) {
if (!n) {
for (n = new Array(l), s = 0; s < l; ++s) n[s] = [];
for (s = 0; s < u; ++s) {
var o = y[s];
n[o.source.index].push(o.target), n[o.target.index].push(o.source)
}
}
for (var i, a = n[t], s = -1, c = a.length; ++s < c;)
if (!isNaN(i = a[s][e])) return i;
return Math.random() * r
}
var t, n, r, l = h.length,
u = y.length,
p = c[0],
g = c[1];
for (t = 0; t < l; ++t)(r = h[t]).index = t, r.weight = 0;
for (t = 0; t < u; ++t) r = y[t], "number" == typeof r.source && (r.source = h[r.source]), "number" == typeof r.target && (r.target = h[r.target]), ++r.source.weight, ++r.target.weight;
for (t = 0; t < l; ++t) r = h[t], isNaN(r.x) && (r.x = e("x", p)), isNaN(r.y) && (r.y = e("y", g)), isNaN(r.px) && (r.px = r.x), isNaN(r.py) && (r.py = r.y);
if (o = [], "function" == typeof d)
for (t = 0; t < u; ++t) o[t] = +d.call(this, y[t], t);
else
for (t = 0; t < u; ++t) o[t] = d;
if (i = [], "function" == typeof f)
for (t = 0; t < u; ++t) i[t] = +f.call(this, y[t], t);
else
for (t = 0; t < u; ++t) i[t] = f;
if (a = [], "function" == typeof m)
for (t = 0; t < l; ++t) a[t] = +m.call(this, h[t], t);
else
for (t = 0; t < l; ++t) a[t] = m;
return s.resume()
}, s.resume = function() {
return s.alpha(.1)
}, s.stop = function() {
return s.alpha(0)
}, s.drag = function() {
return n || (n = sa.behavior.drag().origin(w).on("dragstart.force", Xr).on("drag.force", t).on("dragend.force", Jr)), arguments.length ? void this.on("mouseover.force", eo).on("mouseout.force", to).call(n) : n
}, sa.rebind(s, l, "on")
};
var gl = 20,
vl = 1,
hl = 1 / 0;
sa.layout.hierarchy = function() {
function e(o) {
var i, a = [o],
s = [];
for (o.depth = 0; null != (i = a.pop());)
if (s.push(i), (c = n.call(e, i, i.depth)) && (l = c.length)) {
for (var l, c, u; --l >= 0;) a.push(u = c[l]), u.parent = i, u.depth = i.depth + 1;
r && (i.value = 0), i.children = c
} else r && (i.value = +r.call(e, i, i.depth) || 0), delete i.children;
return io(o, function(e) {
var n, o;
t && (n = e.children) && n.sort(t), r && (o = e.parent) && (o.value += e.value)
}), s
}
var t = lo,
n = ao,
r = so;
return e.sort = function(n) {
return arguments.length ? (t = n, e) : t
}, e.children = function(t) {
return arguments.length ? (n = t, e) : n
}, e.value = function(t) {
return arguments.length ? (r = t, e) : r
}, e.revalue = function(t) {
return r && (oo(t, function(e) {
e.children && (e.value = 0)
}), io(t, function(t) {
var n;
t.children || (t.value = +r.call(e, t, t.depth) || 0), (n = t.parent) && (n.value += t.value)
})), t
}, e
}, sa.layout.partition = function() {
function e(t, n, r, o) {
var i = t.children;
if (t.x = n, t.y = t.depth * o, t.dx = r, t.dy = o, i && (a = i.length)) {
var a, s, l, c = -1;
for (r = t.value ? r / t.value : 0; ++c < a;) e(s = i[c], n, l = s.value * r, o), n += l
}
}
function t(e) {
var n = e.children,
r = 0;
if (n && (o = n.length))
for (var o, i = -1; ++i < o;) r = Math.max(r, t(n[i]));
return 1 + r
}
function n(n, i) {
var a = r.call(this, n, i);
return e(a[0], 0, o[0], o[1] / t(a[0])), a
}
var r = sa.layout.hierarchy(),
o = [1, 1];
return n.size = function(e) {
return arguments.length ? (o = e, n) : o
}, ro(n, r)
}, sa.layout.pie = function() {
function e(a) {
var s, l = a.length,
c = a.map(function(n, r) {
return +t.call(e, n, r)
}),
u = +("function" == typeof r ? r.apply(this, arguments) : r),
d = ("function" == typeof o ? o.apply(this, arguments) : o) - u,
f = Math.min(Math.abs(d) / l, +("function" == typeof i ? i.apply(this, arguments) : i)),
m = f * (d < 0 ? -1 : 1),
p = (d - l * m) / sa.sum(c),
g = sa.range(l),
v = [];
return null != n && g.sort(n === yl ? function(e, t) {
return c[t] - c[e]
} : function(e, t) {
return n(a[e], a[t])
}), g.forEach(function(e) {
v[e] = {
data: a[e],
value: s = c[e],
startAngle: u,
endAngle: u += s * p + m,
padAngle: f
}
}), v
}
var t = Number,
n = yl,
r = 0,
o = Pa,
i = 0;
return e.value = function(n) {
return arguments.length ? (t = n, e) : t
}, e.sort = function(t) {
return arguments.length ? (n = t, e) : n
}, e.startAngle = function(t) {
return arguments.length ? (r = t, e) : r
}, e.endAngle = function(t) {
return arguments.length ? (o = t, e) : o
}, e.padAngle = function(t) {
return arguments.length ? (i = t, e) : i
}, e
};
var yl = {};
sa.layout.stack = function() {
function e(s, l) {
if (!(f = s.length)) return s;
var c = s.map(function(n, r) {
return t.call(e, n, r)
}),
u = c.map(function(t) {
return t.map(function(t, n) {
return [i.call(e, t, n), a.call(e, t, n)]
})
}),
d = n.call(e, u, l);
c = sa.permute(c, d), u = sa.permute(u, d);
var f, m, p, g, v = r.call(e, u, l),
h = c[0].length;
for (p = 0; p < h; ++p)
for (o.call(e, c[0][p], g = v[p], u[0][p][1]), m = 1; m < f; ++m) o.call(e, c[m][p], g += u[m - 1][p][1], u[m][p][1]);
return s
}
var t = w,
n = po,
r = go,
o = mo,
i = uo,
a = fo;
return e.values = function(n) {
return arguments.length ? (t = n, e) : t
}, e.order = function(t) {
return arguments.length ? (n = "function" == typeof t ? t : bl.get(t) || po, e) : n
}, e.offset = function(t) {
return arguments.length ? (r = "function" == typeof t ? t : El.get(t) || go, e) : r
}, e.x = function(t) {
return arguments.length ? (i = t, e) : i
}, e.y = function(t) {
return arguments.length ? (a = t, e) : a
}, e.out = function(t) {
return arguments.length ? (o = t, e) : o
}, e
};
var bl = sa.map({
"inside-out": function(e) {
var t, n, r = e.length,
o = e.map(vo),
i = e.map(ho),
a = sa.range(r).sort(function(e, t) {
return o[e] - o[t]
}),
s = 0,
l = 0,
c = [],
u = [];
for (t = 0; t < r; ++t) n = a[t], s < l ? (s += i[n], c.push(n)) : (l += i[n], u.push(n));
return u.reverse().concat(c)
},
reverse: function(e) {
return sa.range(e.length).reverse()
},
default: po
}),
El = sa.map({
silhouette: function(e) {
var t, n, r, o = e.length,
i = e[0].length,
a = [],
s = 0,
l = [];
for (n = 0; n < i; ++n) {
for (t = 0, r = 0; t < o; t++) r += e[t][n][1];
r > s && (s = r), a.push(r)
}
for (n = 0; n < i; ++n) l[n] = (s - a[n]) / 2;
return l
},
wiggle: function(e) {
var t, n, r, o, i, a, s, l, c, u = e.length,
d = e[0],
f = d.length,
m = [];
for (m[0] = l = c = 0, n = 1; n < f; ++n) {
for (t = 0, o = 0; t < u; ++t) o += e[t][n][1];
for (t = 0, i = 0, s = d[n][0] - d[n - 1][0]; t < u; ++t) {
for (r = 0, a = (e[t][n][1] - e[t][n - 1][1]) / (2 * s); r < t; ++r) a += (e[r][n][1] - e[r][n - 1][1]) / s;
i += a * e[t][n][1]
}
m[n] = l -= o ? i / o * s : 0, l < c && (c = l)
}
for (n = 0; n < f; ++n) m[n] -= c;
return m
},
expand: function(e) {
var t, n, r, o = e.length,
i = e[0].length,
a = 1 / o,
s = [];
for (n = 0; n < i; ++n) {
for (t = 0, r = 0; t < o; t++) r += e[t][n][1];
if (r)
for (t = 0; t < o; t++) e[t][n][1] /= r;
else
for (t = 0; t < o; t++) e[t][n][1] = a
}
for (n = 0; n < i; ++n) s[n] = 0;
return s
},
zero: go
});
sa.layout.histogram = function() {
function e(e, i) {
for (var a, s, l = [], c = e.map(n, this), u = r.call(this, c, i), d = o.call(this, u, c, i), i = -1, f = c.length, m = d.length - 1, p = t ? 1 : 1 / f; ++i < m;) a = l[i] = [], a.dx = d[i + 1] - (a.x = d[i]), a.y = 0;
if (m > 0)
for (i = -1; ++i < f;) s = c[i], s >= u[0] && s <= u[1] && (a = l[sa.bisect(d, s, 1, m) - 1], a.y += p, a.push(e[i]));
return l
}
var t = !0,
n = Number,
r = So,
o = bo;
return e.value = function(t) {
return arguments.length ? (n = t, e) : n
}, e.range = function(t) {
return arguments.length ? (r = Oe(t), e) : r
}, e.bins = function(t) {
return arguments.length ? (o = "number" == typeof t ? function(e) {
return Eo(e, t)
} : Oe(t), e) : o
}, e.frequency = function(n) {
return arguments.length ? (t = !!n, e) : t
}, e
}, sa.layout.pack = function() {
function e(e, i) {
var a = n.call(this, e, i),
s = a[0],
l = o[0],
c = o[1],
u = null == t ? Math.sqrt : "function" == typeof t ? t : function() {
return t
};
if (s.x = s.y = 0, io(s, function(e) {
e.r = +u(e.value)
}), io(s, Co), r) {
var d = r * (t ? 1 : Math.max(2 * s.r / l, 2 * s.r / c)) / 2;
io(s, function(e) {
e.r += d
}), io(s, Co), io(s, function(e) {
e.r -= d
})
}
return Do(s, l / 2, c / 2, t ? 1 : 1 / Math.max(2 * s.r / l, 2 * s.r / c)), a
}
var t, n = sa.layout.hierarchy().sort(_o),
r = 0,
o = [1, 1];
return e.size = function(t) {
return arguments.length ? (o = t, e) : o
}, e.radius = function(n) {
return arguments.length ? (t = null == n || "function" == typeof n ? n : +n, e) : t
}, e.padding = function(t) {
return arguments.length ? (r = +t, e) : r
}, ro(e, n)
}, sa.layout.tree = function() {
function e(e, o) {
var u = a.call(this, e, o),
d = u[0],
f = t(d);
if (io(f, n), f.parent.m = -f.z, oo(f, r), c) oo(d, i);
else {
var m = d,
p = d,
g = d;
oo(d, function(e) {
e.x < m.x && (m = e), e.x > p.x && (p = e), e.depth > g.depth && (g = e)
});
var v = s(m, p) / 2 - m.x,
h = l[0] / (p.x + s(p, m) / 2 + v),
y = l[1] / (g.depth || 1);
oo(d, function(e) {
e.x = (e.x + v) * h, e.y = e.depth * y
})
}
return u
}
function t(e) {
for (var t, n = {
A: null,
children: [e]
}, r = [n]; null != (t = r.pop());)
for (var o, i = t.children, a = 0, s = i.length; a < s; ++a) r.push((i[a] = o = {
_: i[a],
parent: t,
children: (o = i[a].children) && o.slice() || [],
A: null,
a: null,
z: 0,
m: 0,
c: 0,
s: 0,
t: null,
i: a
}).a = o);
return n.children[0]
}
function n(e) {
var t = e.children,
n = e.parent.children,
r = e.i ? n[e.i - 1] : null;
if (t.length) {
ko(e);
var i = (t[0].z + t[t.length - 1].z) / 2;
r ? (e.z = r.z + s(e._, r._), e.m = e.z - i) : e.z = i
} else r && (e.z = r.z + s(e._, r._));
e.parent.A = o(e, r, e.parent.A || n[0])
}
function r(e) {
e._.x = e.z + e.parent.m, e.m += e.parent.m
}
function o(e, t, n) {
if (t) {
for (var r, o = e, i = e, a = t, l = o.parent.children[0], c = o.m, u = i.m, d = a.m, f = l.m; a = No(a), o = Ro(o), a && o;) l = Ro(l), i = No(i), i.a = e, r = a.z + d - o.z - c + s(a._, o._), r > 0 && (Lo(Po(a, e, n), e, r), c += r, u += r), d += a.m, c += o.m, f += l.m, u += i.m;
a && !No(i) && (i.t = a, i.m += d - u), o && !Ro(l) && (l.t = o, l.m += c - f, n = e)
}
return n
}
function i(e) {
e.x *= l[0], e.y = e.depth * l[1]
}
var a = sa.layout.hierarchy().sort(null).value(null),
s = Oo,
l = [1, 1],
c = null;
return e.separation = function(t) {
return arguments.length ? (s = t, e) : s
}, e.size = function(t) {
return arguments.length ? (c = null == (l = t) ? i : null, e) : c ? null : l
}, e.nodeSize = function(t) {
return arguments.length ? (c = null == (l = t) ? null : i, e) : c ? l : null
}, ro(e, a)
}, sa.layout.cluster = function() {
function e(e, i) {
var a, s = t.call(this, e, i),
l = s[0],
c = 0;
io(l, function(e) {
var t = e.children;
t && t.length ? (e.x = Fo(t), e.y = Go(t)) : (e.x = a ? c += n(e, a) : 0, e.y = 0, a = e)
});
var u = Uo(l),
d = Vo(l),
f = u.x - n(u, d) / 2,
m = d.x + n(d, u) / 2;
return io(l, o ? function(e) {
e.x = (e.x - l.x) * r[0], e.y = (l.y - e.y) * r[1]
} : function(e) {
e.x = (e.x - f) / (m - f) * r[0], e.y = (1 - (l.y ? e.y / l.y : 1)) * r[1]
}), s
}
var t = sa.layout.hierarchy().sort(null).value(null),
n = Oo,
r = [1, 1],
o = !1;
return e.separation = function(t) {
return arguments.length ? (n = t, e) : n
}, e.size = function(t) {
return arguments.length ? (o = null == (r = t), e) : o ? null : r
}, e.nodeSize = function(t) {
return arguments.length ? (o = null != (r = t), e) : o ? r : null
}, ro(e, t)
}, sa.layout.treemap = function() {
function e(e, t) {
for (var n, r, o = -1, i = e.length; ++o < i;) r = (n = e[o]).value * (t < 0 ? 0 : t), n.area = isNaN(r) || r <= 0 ? 0 : r
}
function t(n) {
var i = n.children;
if (i && i.length) {
var a, s, l, c = d(n),
u = [],
f = i.slice(),
p = 1 / 0,
g = "slice" === m ? c.dx : "dice" === m ? c.dy : "slice-dice" === m ? 1 & n.depth ? c.dy : c.dx : Math.min(c.dx, c.dy);
for (e(f, c.dx * c.dy / n.value), u.area = 0;
(l = f.length) > 0;) u.push(a = f[l - 1]), u.area += a.area, "squarify" !== m || (s = r(u, g)) <= p ? (f.pop(), p = s) : (u.area -= u.pop().area, o(u, g, c, !1), g = Math.min(c.dx, c.dy), u.length = u.area = 0, p = 1 / 0);
u.length && (o(u, g, c, !0), u.length = u.area = 0), i.forEach(t)
}
}
function n(t) {
var r = t.children;
if (r && r.length) {
var i, a = d(t),
s = r.slice(),
l = [];
for (e(s, a.dx * a.dy / t.value), l.area = 0; i = s.pop();) l.push(i), l.area += i.area, null != i.z && (o(l, i.z ? a.dx : a.dy, a, !s.length), l.length = l.area = 0);
r.forEach(n)
}
}
function r(e, t) {
for (var n, r = e.area, o = 0, i = 1 / 0, a = -1, s = e.length; ++a < s;)(n = e[a].area) && (n < i && (i = n), n > o && (o = n));
return r *= r, t *= t, r ? Math.max(t * o * p / r, r / (t * i * p)) : 1 / 0
}
function o(e, t, n, r) {
var o, i = -1,
a = e.length,
s = n.x,
c = n.y,
u = t ? l(e.area / t) : 0;
if (t == n.dx) {
for ((r || u > n.dy) && (u = n.dy); ++i < a;) o = e[i], o.x = s, o.y = c, o.dy = u, s += o.dx = Math.min(n.x + n.dx - s, u ? l(o.area / u) : 0);
o.z = !0, o.dx += n.x + n.dx - s, n.y += u, n.dy -= u
} else {
for ((r || u > n.dx) && (u = n.dx); ++i < a;) o = e[i], o.x = s, o.y = c, o.dx = u, c += o.dy = Math.min(n.y + n.dy - c, u ? l(o.area / u) : 0);
o.z = !1, o.dy += n.y + n.dy - c, n.x += u, n.dx -= u
}
}
function i(r) {
var o = a || s(r),
i = o[0];
return i.x = 0, i.y = 0, i.dx = c[0], i.dy = c[1], a && s.revalue(i), e([i], i.dx * i.dy / i.value), (a ? n : t)(i), f && (a = o), o
}
var a, s = sa.layout.hierarchy(),
l = Math.round,
c = [1, 1],
u = null,
d = zo,
f = !1,
m = "squarify",
p = .5 * (1 + Math.sqrt(5));
return i.size = function(e) {
return arguments.length ? (c = e, i) : c
}, i.padding = function(e) {
function t(t) {
var n = e.call(i, t, t.depth);
return null == n ? zo(t) : Bo(t, "number" == typeof n ? [n, n, n, n] : n)
}
function n(t) {
return Bo(t, e)
}
if (!arguments.length) return u;
var r;
return d = null == (u = e) ? zo : "function" == (r = typeof e) ? t : "number" === r ? (e = [e, e, e, e], n) : n, i
}, i.round = function(e) {
return arguments.length ? (l = e ? Math.round : Number, i) : l != Number
}, i.sticky = function(e) {
return arguments.length ? (f = e, a = null, i) : f
}, i.ratio = function(e) {
return arguments.length ? (p = e, i) : p
}, i.mode = function(e) {
return arguments.length ? (m = e + "", i) : m
}, ro(i, s)
}, sa.random = {
normal: function(e, t) {
var n = arguments.length;
return n < 2 && (t = 1), n < 1 && (e = 0),
function() {
var n, r, o;
do n = 2 * Math.random() - 1, r = 2 * Math.random() - 1, o = n * n + r * r; while (!o || o > 1);
return e + t * n * Math.sqrt(-2 * Math.log(o) / o)
}
},
logNormal: function() {
var e = sa.random.normal.apply(sa, arguments);
return function() {
return Math.exp(e())
}
},
bates: function(e) {
var t = sa.random.irwinHall(e);
return function() {
return t() / e
}
},
irwinHall: function(e) {
return function() {
for (var t = 0, n = 0; n < e; n++) t += Math.random();
return t
}
}
}, sa.scale = {};
var Sl = {
floor: w,
ceil: w
};
sa.scale.linear = function() {
return Ko([0, 1], [0, 1], wr, !1)
};
var _l = {
s: 1,
g: 1,
p: 1,
r: 1,
e: 1
};
sa.scale.log = function() {
return ri(sa.scale.linear().domain([0, 1]), 10, !0, [1, 10])
};
var wl = sa.format(".0e"),
Al = {
floor: function(e) {
return -Math.ceil(-e)
},
ceil: function(e) {
return -Math.floor(-e)
}
};
sa.scale.pow = function() {
return oi(sa.scale.linear(), 1, [0, 1])
}, sa.scale.sqrt = function() {
return sa.scale.pow().exponent(.5)
}, sa.scale.ordinal = function() {
return ai([], {
t: "range",
a: [
[]
]
})
}, sa.scale.category10 = function() {
return sa.scale.ordinal().range(Tl)
}, sa.scale.category20 = function() {
return sa.scale.ordinal().range(Cl)
}, sa.scale.category20b = function() {
return sa.scale.ordinal().range(Il)
}, sa.scale.category20c = function() {
return sa.scale.ordinal().range(xl)
};
var Tl = [2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175].map(Ae),
Cl = [2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725].map(Ae),
Il = [3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654].map(Ae),
xl = [3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081].map(Ae);
sa.scale.quantile = function() {
return si([], [])
}, sa.scale.quantize = function() {
return li(0, 1, [0, 1])
}, sa.scale.threshold = function() {
return ci([.5], [0, 1])
}, sa.scale.identity = function() {
return ui([0, 1])
}, sa.svg = {}, sa.svg.arc = function() {
function e() {
var e = Math.max(0, +n.apply(this, arguments)),
c = Math.max(0, +r.apply(this, arguments)),
u = a.apply(this, arguments) - Fa,
d = s.apply(this, arguments) - Fa,
f = Math.abs(d - u),
m = u > d ? 0 : 1;
if (c < e && (p = c, c = e, e = p), f >= Ga) return t(c, m) + (e ? t(e, 1 - m) : "") + "Z";
var p, g, v, h, y, b, E, S, _, w, A, T, C = 0,
I = 0,
x = [];
if ((h = (+l.apply(this, arguments) || 0) / 2) && (v = i === Dl ? Math.sqrt(e * e + c * c) : +i.apply(this, arguments), m || (I *= -1), c && (I = ae(v / c * Math.sin(h))), e && (C = ae(v / e * Math.sin(h)))), c) {
y = c * Math.cos(u + I), b = c * Math.sin(u + I), E = c * Math.cos(d - I), S = c * Math.sin(d - I);
var D = Math.abs(d - u - 2 * I) <= ka ? 0 : 1;
if (I && hi(y, b, E, S) === m ^ D) {
var M = (u + d) / 2;
y = c * Math.cos(M), b = c * Math.sin(M), E = S = null
}
} else y = b = 0;
if (e) {
_ = e * Math.cos(d - C), w = e * Math.sin(d - C), A = e * Math.cos(u + C), T = e * Math.sin(u + C);
var O = Math.abs(u - d + 2 * C) <= ka ? 0 : 1;
if (C && hi(_, w, A, T) === 1 - m ^ O) {
var R = (u + d) / 2;
_ = e * Math.cos(R), w = e * Math.sin(R), A = T = null
}
} else _ = w = 0;
if ((p = Math.min(Math.abs(c - e) / 2, +o.apply(this, arguments))) > .001) {
g = e < c ^ m ? 0 : 1;
var N = null == A ? [_, w] : null == E ? [y, b] : Fn([y, b], [A, T], [E, S], [_, w]),
L = y - N[0],
k = b - N[1],
P = E - N[0],
G = S - N[1],
F = 1 / Math.sin(Math.acos((L * P + k * G) / (Math.sqrt(L * L + k * k) * Math.sqrt(P * P + G * G))) / 2),
U = Math.sqrt(N[0] * N[0] + N[1] * N[1]);
if (null != E) {
var V = Math.min(p, (c - U) / (F + 1)),
z = yi(null == A ? [_, w] : [A, T], [y, b], c, V, m),
B = yi([E, S], [_, w], c, V, m);
p === V ? x.push("M", z[0], "A", V, ",", V, " 0 0,", g, " ", z[1], "A", c, ",", c, " 0 ", 1 - m ^ hi(z[1][0], z[1][1], B[1][0], B[1][1]), ",", m, " ", B[1], "A", V, ",", V, " 0 0,", g, " ", B[0]) : x.push("M", z[0], "A", V, ",", V, " 0 1,", g, " ", B[0])
} else x.push("M", y, ",", b);
if (null != A) {
var $ = Math.min(p, (e - U) / (F - 1)),
W = yi([y, b], [A, T], e, -$, m),
H = yi([_, w], null == E ? [y, b] : [E, S], e, -$, m);
p === $ ? x.push("L", H[0], "A", $, ",", $, " 0 0,", g, " ", H[1], "A", e, ",", e, " 0 ", m ^ hi(H[1][0], H[1][1], W[1][0], W[1][1]), ",", 1 - m, " ", W[1], "A", $, ",", $, " 0 0,", g, " ", W[0]) : x.push("L", H[0], "A", $, ",", $, " 0 0,", g, " ", W[0])
} else x.push("L", _, ",", w)
} else x.push("M", y, ",", b), null != E && x.push("A", c, ",", c, " 0 ", D, ",", m, " ", E, ",", S), x.push("L", _, ",", w), null != A && x.push("A", e, ",", e, " 0 ", O, ",", 1 - m, " ", A, ",", T);
return x.push("Z"), x.join("")
}
function t(e, t) {
return "M0," + e + "A" + e + "," + e + " 0 1," + t + " 0," + -e + "A" + e + "," + e + " 0 1," + t + " 0," + e
}
var n = fi,
r = mi,
o = di,
i = Dl,
a = pi,
s = gi,
l = vi;
return e.innerRadius = function(t) {
return arguments.length ? (n = Oe(t), e) : n
}, e.outerRadius = function(t) {
return arguments.length ? (r = Oe(t), e) : r
}, e.cornerRadius = function(t) {
return arguments.length ? (o = Oe(t), e) : o
}, e.padRadius = function(t) {
return arguments.length ? (i = t == Dl ? Dl : Oe(t), e) : i
}, e.startAngle = function(t) {
return arguments.length ? (a = Oe(t), e) : a
}, e.endAngle = function(t) {
return arguments.length ? (s = Oe(t), e) : s
}, e.padAngle = function(t) {
return arguments.length ? (l = Oe(t), e) : l
}, e.centroid = function() {
var e = (+n.apply(this, arguments) + +r.apply(this, arguments)) / 2,
t = (+a.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Fa;
return [Math.cos(t) * e, Math.sin(t) * e]
}, e
};
var Dl = "auto";
sa.svg.line = function() {
return bi(w)
};
var Ml = sa.map({
linear: Ei,
"linear-closed": Si,
step: _i,
"step-before": wi,
"step-after": Ai,
basis: Mi,
"basis-open": Oi,
"basis-closed": Ri,
bundle: Ni,
cardinal: Ii,
"cardinal-open": Ti,
"cardinal-closed": Ci,
monotone: Ui
});
Ml.forEach(function(e, t) {
t.key = e, t.closed = /-closed$/.test(e)
});
var Ol = [0, 2 / 3, 1 / 3, 0],
Rl = [0, 1 / 3, 2 / 3, 0],
Nl = [0, 1 / 6, 2 / 3, 1 / 6];
sa.svg.line.radial = function() {
var e = bi(Vi);
return e.radius = e.x, delete e.x, e.angle = e.y, delete e.y, e
}, wi.reverse = Ai, Ai.reverse = wi, sa.svg.area = function() {
return zi(w)
}, sa.svg.area.radial = function() {
var e = zi(Vi);
return e.radius = e.x, delete e.x, e.innerRadius = e.x0, delete e.x0, e.outerRadius = e.x1, delete e.x1, e.angle = e.y, delete e.y, e.startAngle = e.y0, delete e.y0, e.endAngle = e.y1, delete e.y1, e
}, sa.svg.chord = function() {
function e(e, s) {
var l = t(this, i, e, s),
c = t(this, a, e, s);
return "M" + l.p0 + r(l.r, l.p1, l.a1 - l.a0) + (n(l, c) ? o(l.r, l.p1, l.r, l.p0) : o(l.r, l.p1, c.r, c.p0) + r(c.r, c.p1, c.a1 - c.a0) + o(c.r, c.p1, l.r, l.p0)) + "Z"
}
function t(e, t, n, r) {
var o = t.call(e, n, r),
i = s.call(e, o, r),
a = l.call(e, o, r) - Fa,
u = c.call(e, o, r) - Fa;
return {
r: i,
a0: a,
a1: u,
p0: [i * Math.cos(a), i * Math.sin(a)],
p1: [i * Math.cos(u), i * Math.sin(u)]
}
}
function n(e, t) {
return e.a0 == t.a0 && e.a1 == t.a1
}
function r(e, t, n) {
return "A" + e + "," + e + " 0 " + +(n > ka) + ",1 " + t
}
function o(e, t, n, r) {
return "Q 0,0 " + r
}
var i = wn,
a = An,
s = Bi,
l = pi,
c = gi;
return e.radius = function(t) {
return arguments.length ? (s = Oe(t), e) : s
}, e.source = function(t) {
return arguments.length ? (i = Oe(t), e) : i
}, e.target = function(t) {
return arguments.length ? (a = Oe(t), e) : a
}, e.startAngle = function(t) {
return arguments.length ? (l = Oe(t), e) : l
}, e.endAngle = function(t) {
return arguments.length ? (c = Oe(t), e) : c
}, e
}, sa.svg.diagonal = function() {
function e(e, o) {
var i = t.call(this, e, o),
a = n.call(this, e, o),
s = (i.y + a.y) / 2,
l = [i, {
x: i.x,
y: s
}, {
x: a.x,
y: s
}, a];
return l = l.map(r), "M" + l[0] + "C" + l[1] + " " + l[2] + " " + l[3]
}
var t = wn,
n = An,
r = $i;
return e.source = function(n) {
return arguments.length ? (t = Oe(n), e) : t
}, e.target = function(t) {
return arguments.length ? (n = Oe(t), e) : n
}, e.projection = function(t) {
return arguments.length ? (r = t, e) : r
}, e
}, sa.svg.diagonal.radial = function() {
var e = sa.svg.diagonal(),
t = $i,
n = e.projection;
return e.projection = function(e) {
return arguments.length ? n(Wi(t = e)) : t
}, e
}, sa.svg.symbol = function() {
function e(e, r) {
return (Ll.get(t.call(this, e, r)) || Yi)(n.call(this, e, r))
}
var t = ji,
n = Hi;
return e.type = function(n) {
return arguments.length ? (t = Oe(n), e) : t
}, e.size = function(t) {
return arguments.length ? (n = Oe(t), e) : n
}, e
};
var Ll = sa.map({
circle: Yi,
cross: function(e) {
var t = Math.sqrt(e / 5) / 2;
return "M" + -3 * t + "," + -t + "H" + -t + "V" + -3 * t + "H" + t + "V" + -t + "H" + 3 * t + "V" + t + "H" + t + "V" + 3 * t + "H" + -t + "V" + t + "H" + -3 * t + "Z"
},
diamond: function(e) {
var t = Math.sqrt(e / (2 * Pl)),
n = t * Pl;
return "M0," + -t + "L" + n + ",0 0," + t + " " + -n + ",0Z";
},
square: function(e) {
var t = Math.sqrt(e) / 2;
return "M" + -t + "," + -t + "L" + t + "," + -t + " " + t + "," + t + " " + -t + "," + t + "Z"
},
"triangle-down": function(e) {
var t = Math.sqrt(e / kl),
n = t * kl / 2;
return "M0," + n + "L" + t + "," + -n + " " + -t + "," + -n + "Z"
},
"triangle-up": function(e) {
var t = Math.sqrt(e / kl),
n = t * kl / 2;
return "M0," + -n + "L" + t + "," + n + " " + -t + "," + n + "Z"
}
});
sa.svg.symbolTypes = Ll.keys();
var kl = Math.sqrt(3),
Pl = Math.tan(30 * Ua);
Ca.transition = function(e) {
for (var t, n, r = Gl || ++zl, o = Xi(e), i = [], a = Fl || {
time: Date.now(),
ease: Mr,
delay: 0,
duration: 250
}, s = -1, l = this.length; ++s < l;) {
i.push(t = []);
for (var c = this[s], u = -1, d = c.length; ++u < d;)(n = c[u]) && Ji(n, u, o, r, a), t.push(n)
}
return Ki(i, o, r)
}, Ca.interrupt = function(e) {
return this.each(null == e ? Ul : qi(Xi(e)))
};
var Gl, Fl, Ul = qi(Xi()),
Vl = [],
zl = 0;
Vl.call = Ca.call, Vl.empty = Ca.empty, Vl.node = Ca.node, Vl.size = Ca.size, sa.transition = function(e, t) {
return e && e.transition ? Gl ? e.transition(t) : e : sa.selection().transition(e)
}, sa.transition.prototype = Vl, Vl.select = function(e) {
var t, n, r, o = this.id,
i = this.namespace,
a = [];
e = N(e);
for (var s = -1, l = this.length; ++s < l;) {
a.push(t = []);
for (var c = this[s], u = -1, d = c.length; ++u < d;)(r = c[u]) && (n = e.call(r, r.__data__, u, s)) ? ("__data__" in r && (n.__data__ = r.__data__), Ji(n, u, i, o, r[i][o]), t.push(n)) : t.push(null)
}
return Ki(a, i, o)
}, Vl.selectAll = function(e) {
var t, n, r, o, i, a = this.id,
s = this.namespace,
l = [];
e = L(e);
for (var c = -1, u = this.length; ++c < u;)
for (var d = this[c], f = -1, m = d.length; ++f < m;)
if (r = d[f]) {
i = r[s][a], n = e.call(r, r.__data__, f, c), l.push(t = []);
for (var p = -1, g = n.length; ++p < g;)(o = n[p]) && Ji(o, p, s, a, i), t.push(o)
} return Ki(l, s, a)
}, Vl.filter = function(e) {
var t, n, r, o = [];
"function" != typeof e && (e = j(e));
for (var i = 0, a = this.length; i < a; i++) {
o.push(t = []);
for (var n = this[i], s = 0, l = n.length; s < l; s++)(r = n[s]) && e.call(r, r.__data__, s, i) && t.push(r)
}
return Ki(o, this.namespace, this.id)
}, Vl.tween = function(e, t) {
var n = this.id,
r = this.namespace;
return arguments.length < 2 ? this.node()[r][n].tween.get(e) : q(this, null == t ? function(t) {
t[r][n].tween.remove(e)
} : function(o) {
o[r][n].tween.set(e, t)
})
}, Vl.attr = function(e, t) {
function n() {
this.removeAttribute(s)
}
function r() {
this.removeAttributeNS(s.space, s.local)
}
function o(e) {
return null == e ? n : (e += "", function() {
var t, n = this.getAttribute(s);
return n !== e && (t = a(n, e), function(e) {
this.setAttribute(s, t(e))
})
})
}
function i(e) {
return null == e ? r : (e += "", function() {
var t, n = this.getAttributeNS(s.space, s.local);
return n !== e && (t = a(n, e), function(e) {
this.setAttributeNS(s.space, s.local, t(e))
})
})
}
if (arguments.length < 2) {
for (t in e) this.attr(t, e[t]);
return this
}
var a = "transform" == e ? jr : wr,
s = sa.ns.qualify(e);
return Zi(this, "attr." + e, t, s.local ? i : o)
}, Vl.attrTween = function(e, t) {
function n(e, n) {
var r = t.call(this, e, n, this.getAttribute(o));
return r && function(e) {
this.setAttribute(o, r(e))
}
}
function r(e, n) {
var r = t.call(this, e, n, this.getAttributeNS(o.space, o.local));
return r && function(e) {
this.setAttributeNS(o.space, o.local, r(e))
}
}
var o = sa.ns.qualify(e);
return this.tween("attr." + e, o.local ? r : n)
}, Vl.style = function(e, t, n) {
function r() {
this.style.removeProperty(e)
}
function o(t) {
return null == t ? r : (t += "", function() {
var r, o = a(this).getComputedStyle(this, null).getPropertyValue(e);
return o !== t && (r = wr(o, t), function(t) {
this.style.setProperty(e, r(t), n)
})
})
}
var i = arguments.length;
if (i < 3) {
if ("string" != typeof e) {
i < 2 && (t = "");
for (n in e) this.style(n, e[n], t);
return this
}
n = ""
}
return Zi(this, "style." + e, t, o)
}, Vl.styleTween = function(e, t, n) {
function r(r, o) {
var i = t.call(this, r, o, a(this).getComputedStyle(this, null).getPropertyValue(e));
return i && function(t) {
this.style.setProperty(e, i(t), n)
}
}
return arguments.length < 3 && (n = ""), this.tween("style." + e, r)
}, Vl.text = function(e) {
return Zi(this, "text", e, Qi)
}, Vl.remove = function() {
var e = this.namespace;
return this.each("end.transition", function() {
var t;
this[e].count < 2 && (t = this.parentNode) && t.removeChild(this)
})
}, Vl.ease = function(e) {
var t = this.id,
n = this.namespace;
return arguments.length < 1 ? this.node()[n][t].ease : ("function" != typeof e && (e = sa.ease.apply(sa, arguments)), q(this, function(r) {
r[n][t].ease = e
}))
}, Vl.delay = function(e) {
var t = this.id,
n = this.namespace;
return arguments.length < 1 ? this.node()[n][t].delay : q(this, "function" == typeof e ? function(r, o, i) {
r[n][t].delay = +e.call(r, r.__data__, o, i)
} : (e = +e, function(r) {
r[n][t].delay = e
}))
}, Vl.duration = function(e) {
var t = this.id,
n = this.namespace;
return arguments.length < 1 ? this.node()[n][t].duration : q(this, "function" == typeof e ? function(r, o, i) {
r[n][t].duration = Math.max(1, e.call(r, r.__data__, o, i))
} : (e = Math.max(1, e), function(r) {
r[n][t].duration = e
}))
}, Vl.each = function(e, t) {
var n = this.id,
r = this.namespace;
if (arguments.length < 2) {
var o = Fl,
i = Gl;
try {
Gl = n, q(this, function(t, o, i) {
Fl = t[r][n], e.call(t, t.__data__, o, i)
})
} finally {
Fl = o, Gl = i
}
} else q(this, function(o) {
var i = o[r][n];
(i.event || (i.event = sa.dispatch("start", "end", "interrupt"))).on(e, t)
});
return this
}, Vl.transition = function() {
for (var e, t, n, r, o = this.id, i = ++zl, a = this.namespace, s = [], l = 0, c = this.length; l < c; l++) {
s.push(e = []);
for (var t = this[l], u = 0, d = t.length; u < d; u++)(n = t[u]) && (r = n[a][o], Ji(n, u, a, i, {
time: r.time,
ease: r.ease,
delay: r.delay + r.duration,
duration: r.duration
})), e.push(n)
}
return Ki(s, a, i)
}, sa.svg.axis = function() {
function e(e) {
e.each(function() {
var e, c = sa.select(this),
u = this.__chart__ || n,
d = this.__chart__ = n.copy(),
f = null == l ? d.ticks ? d.ticks.apply(d, s) : d.domain() : l,
m = null == t ? d.tickFormat ? d.tickFormat.apply(d, s) : w : t,
p = c.selectAll(".tick").data(f, d),
g = p.enter().insert("g", ".domain").attr("class", "tick").style("opacity", Na),
v = sa.transition(p.exit()).style("opacity", Na).remove(),
h = sa.transition(p.order()).style("opacity", 1),
y = Math.max(o, 0) + a,
b = Wo(d),
E = c.selectAll(".domain").data([0]),
S = (E.enter().append("path").attr("class", "domain"), sa.transition(E));
g.append("line"), g.append("text");
var _, A, T, C, I = g.select("line"),
x = h.select("line"),
D = p.select("text").text(m),
M = g.select("text"),
O = h.select("text"),
R = "top" === r || "left" === r ? -1 : 1;
if ("bottom" === r || "top" === r ? (e = ea, _ = "x", T = "y", A = "x2", C = "y2", D.attr("dy", R < 0 ? "0em" : ".71em").style("text-anchor", "middle"), S.attr("d", "M" + b[0] + "," + R * i + "V0H" + b[1] + "V" + R * i)) : (e = ta, _ = "y", T = "x", A = "y2", C = "x2", D.attr("dy", ".32em").style("text-anchor", R < 0 ? "end" : "start"), S.attr("d", "M" + R * i + "," + b[0] + "H0V" + b[1] + "H" + R * i)), I.attr(C, R * o), M.attr(T, R * y), x.attr(A, 0).attr(C, R * o), O.attr(_, 0).attr(T, R * y), d.rangeBand) {
var N = d,
L = N.rangeBand() / 2;
u = d = function(e) {
return N(e) + L
}
} else u.rangeBand ? u = d : v.call(e, d, u);
g.call(e, u, d), h.call(e, d, d)
})
}
var t, n = sa.scale.linear(),
r = Bl,
o = 6,
i = 6,
a = 3,
s = [10],
l = null;
return e.scale = function(t) {
return arguments.length ? (n = t, e) : n
}, e.orient = function(t) {
return arguments.length ? (r = t in $l ? t + "" : Bl, e) : r
}, e.ticks = function() {
return arguments.length ? (s = arguments, e) : s
}, e.tickValues = function(t) {
return arguments.length ? (l = t, e) : l
}, e.tickFormat = function(n) {
return arguments.length ? (t = n, e) : t
}, e.tickSize = function(t) {
var n = arguments.length;
return n ? (o = +t, i = +arguments[n - 1], e) : o
}, e.innerTickSize = function(t) {
return arguments.length ? (o = +t, e) : o
}, e.outerTickSize = function(t) {
return arguments.length ? (i = +t, e) : i
}, e.tickPadding = function(t) {
return arguments.length ? (a = +t, e) : a
}, e.tickSubdivide = function() {
return arguments.length && e
}, e
};
var Bl = "bottom",
$l = {
top: 1,
right: 1,
bottom: 1,
left: 1
};
sa.svg.brush = function() {
function e(i) {
i.each(function() {
var i = sa.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", o).on("touchstart.brush", o),
a = i.selectAll(".background").data([0]);
a.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"), i.selectAll(".extent").data([0]).enter().append("rect").attr("class", "extent").style("cursor", "move");
var s = i.selectAll(".resize").data(g, w);
s.exit().remove(), s.enter().append("g").attr("class", function(e) {
return "resize " + e
}).style("cursor", function(e) {
return Wl[e]
}).append("rect").attr("x", function(e) {
return /[ew]$/.test(e) ? -3 : null
}).attr("y", function(e) {
return /^[ns]/.test(e) ? -3 : null
}).attr("width", 6).attr("height", 6).style("visibility", "hidden"), s.style("display", e.empty() ? "none" : null);
var l, d = sa.transition(i),
f = sa.transition(a);
c && (l = Wo(c), f.attr("x", l[0]).attr("width", l[1] - l[0]), n(d)), u && (l = Wo(u), f.attr("y", l[0]).attr("height", l[1] - l[0]), r(d)), t(d)
})
}
function t(e) {
e.selectAll(".resize").attr("transform", function(e) {
return "translate(" + d[+/e$/.test(e)] + "," + f[+/^s/.test(e)] + ")"
})
}
function n(e) {
e.select(".extent").attr("x", d[0]), e.selectAll(".extent,.n>rect,.s>rect").attr("width", d[1] - d[0])
}
function r(e) {
e.select(".extent").attr("y", f[0]), e.selectAll(".extent,.e>rect,.w>rect").attr("height", f[1] - f[0])
}
function o() {
function o() {
32 == sa.event.keyCode && (x || (b = null, O[0] -= d[1], O[1] -= f[1], x = 2), D())
}
function g() {
32 == sa.event.keyCode && 2 == x && (O[0] += d[1], O[1] += f[1], x = 0, D())
}
function v() {
var e = sa.mouse(S),
o = !1;
E && (e[0] += E[0], e[1] += E[1]), x || (sa.event.altKey ? (b || (b = [(d[0] + d[1]) / 2, (f[0] + f[1]) / 2]), O[0] = d[+(e[0] < b[0])], O[1] = f[+(e[1] < b[1])]) : b = null), C && h(e, c, 0) && (n(A), o = !0), I && h(e, u, 1) && (r(A), o = !0), o && (t(A), w({
type: "brush",
mode: x ? "move" : "resize"
}))
}
function h(e, t, n) {
var r, o, a = Wo(t),
l = a[0],
c = a[1],
u = O[n],
g = n ? f : d,
v = g[1] - g[0];
if (x && (l -= u, c -= v + u), r = (n ? p : m) ? Math.max(l, Math.min(c, e[n])) : e[n], x ? o = (r += u) + v : (b && (u = Math.max(l, Math.min(c, 2 * b[n] - r))), u < r ? (o = r, r = u) : o = u), g[0] != r || g[1] != o) return n ? s = null : i = null, g[0] = r, g[1] = o, !0
}
function y() {
v(), A.style("pointer-events", "all").selectAll(".resize").style("display", e.empty() ? "none" : null), sa.select("body").style("cursor", null), R.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null), M(), w({
type: "brushend"
})
}
var b, E, S = this,
_ = sa.select(sa.event.target),
w = l.of(S, arguments),
A = sa.select(S),
T = _.datum(),
C = !/^(n|s)$/.test(T) && c,
I = !/^(e|w)$/.test(T) && u,
x = _.classed("extent"),
M = ee(S),
O = sa.mouse(S),
R = sa.select(a(S)).on("keydown.brush", o).on("keyup.brush", g);
if (sa.event.changedTouches ? R.on("touchmove.brush", v).on("touchend.brush", y) : R.on("mousemove.brush", v).on("mouseup.brush", y), A.interrupt().selectAll("*").interrupt(), x) O[0] = d[0] - O[0], O[1] = f[0] - O[1];
else if (T) {
var N = +/w$/.test(T),
L = +/^n/.test(T);
E = [d[1 - N] - O[0], f[1 - L] - O[1]], O[0] = d[N], O[1] = f[L]
} else sa.event.altKey && (b = O.slice());
A.style("pointer-events", "none").selectAll(".resize").style("display", null), sa.select("body").style("cursor", _.style("cursor")), w({
type: "brushstart"
}), v()
}
var i, s, l = O(e, "brushstart", "brush", "brushend"),
c = null,
u = null,
d = [0, 0],
f = [0, 0],
m = !0,
p = !0,
g = Hl[0];
return e.event = function(e) {
e.each(function() {
var e = l.of(this, arguments),
t = {
x: d,
y: f,
i: i,
j: s
},
n = this.__chart__ || t;
this.__chart__ = t, Gl ? sa.select(this).transition().each("start.brush", function() {
i = n.i, s = n.j, d = n.x, f = n.y, e({
type: "brushstart"
})
}).tween("brush:brush", function() {
var n = Ar(d, t.x),
r = Ar(f, t.y);
return i = s = null,
function(o) {
d = t.x = n(o), f = t.y = r(o), e({
type: "brush",
mode: "resize"
})
}
}).each("end.brush", function() {
i = t.i, s = t.j, e({
type: "brush",
mode: "resize"
}), e({
type: "brushend"
})
}) : (e({
type: "brushstart"
}), e({
type: "brush",
mode: "resize"
}), e({
type: "brushend"
}))
})
}, e.x = function(t) {
return arguments.length ? (c = t, g = Hl[!c << 1 | !u], e) : c
}, e.y = function(t) {
return arguments.length ? (u = t, g = Hl[!c << 1 | !u], e) : u
}, e.clamp = function(t) {
return arguments.length ? (c && u ? (m = !!t[0], p = !!t[1]) : c ? m = !!t : u && (p = !!t), e) : c && u ? [m, p] : c ? m : u ? p : null
}, e.extent = function(t) {
var n, r, o, a, l;
return arguments.length ? (c && (n = t[0], r = t[1], u && (n = n[0], r = r[0]), i = [n, r], c.invert && (n = c(n), r = c(r)), r < n && (l = n, n = r, r = l), n == d[0] && r == d[1] || (d = [n, r])), u && (o = t[0], a = t[1], c && (o = o[1], a = a[1]), s = [o, a], u.invert && (o = u(o), a = u(a)), a < o && (l = o, o = a, a = l), o == f[0] && a == f[1] || (f = [o, a])), e) : (c && (i ? (n = i[0], r = i[1]) : (n = d[0], r = d[1], c.invert && (n = c.invert(n), r = c.invert(r)), r < n && (l = n, n = r, r = l))), u && (s ? (o = s[0], a = s[1]) : (o = f[0], a = f[1], u.invert && (o = u.invert(o), a = u.invert(a)), a < o && (l = o, o = a, a = l))), c && u ? [
[n, o],
[r, a]
] : c ? [n, r] : u && [o, a])
}, e.clear = function() {
return e.empty() || (d = [0, 0], f = [0, 0], i = s = null), e
}, e.empty = function() {
return !!c && d[0] == d[1] || !!u && f[0] == f[1]
}, sa.rebind(e, l, "on")
};
var Wl = {
n: "ns-resize",
e: "ew-resize",
s: "ns-resize",
w: "ew-resize",
nw: "nwse-resize",
ne: "nesw-resize",
se: "nwse-resize",
sw: "nesw-resize"
},
Hl = [
["n", "e", "s", "w", "nw", "ne", "se", "sw"],
["e", "w"],
["n", "s"],
[]
],
jl = ds.format = hs.timeFormat,
Yl = jl.utc,
ql = Yl("%Y-%m-%dT%H:%M:%S.%LZ");
jl.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? na : ql, na.parse = function(e) {
var t = new Date(e);
return isNaN(t) ? null : t
}, na.toString = ql.toString, ds.second = We(function(e) {
return new fs(1e3 * Math.floor(e / 1e3))
}, function(e, t) {
e.setTime(e.getTime() + 1e3 * Math.floor(t))
}, function(e) {
return e.getSeconds()
}), ds.seconds = ds.second.range, ds.seconds.utc = ds.second.utc.range, ds.minute = We(function(e) {
return new fs(6e4 * Math.floor(e / 6e4))
}, function(e, t) {
e.setTime(e.getTime() + 6e4 * Math.floor(t))
}, function(e) {
return e.getMinutes()
}), ds.minutes = ds.minute.range, ds.minutes.utc = ds.minute.utc.range, ds.hour = We(function(e) {
var t = e.getTimezoneOffset() / 60;
return new fs(36e5 * (Math.floor(e / 36e5 - t) + t))
}, function(e, t) {
e.setTime(e.getTime() + 36e5 * Math.floor(t))
}, function(e) {
return e.getHours()
}), ds.hours = ds.hour.range, ds.hours.utc = ds.hour.utc.range, ds.month = We(function(e) {
return e = ds.day(e), e.setDate(1), e
}, function(e, t) {
e.setMonth(e.getMonth() + t)
}, function(e) {
return e.getMonth()
}), ds.months = ds.month.range, ds.months.utc = ds.month.utc.range;
var Kl = [1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6],
Zl = [
[ds.second, 1],
[ds.second, 5],
[ds.second, 15],
[ds.second, 30],
[ds.minute, 1],
[ds.minute, 5],
[ds.minute, 15],
[ds.minute, 30],
[ds.hour, 1],
[ds.hour, 3],
[ds.hour, 6],
[ds.hour, 12],
[ds.day, 1],
[ds.day, 2],
[ds.week, 1],
[ds.month, 1],
[ds.month, 3],
[ds.year, 1]
],
Ql = jl.multi([
[".%L", function(e) {
return e.getMilliseconds()
}],
[":%S", function(e) {
return e.getSeconds()
}],
["%I:%M", function(e) {
return e.getMinutes()
}],
["%I %p", function(e) {
return e.getHours()
}],
["%a %d", function(e) {
return e.getDay() && 1 != e.getDate()
}],
["%b %d", function(e) {
return 1 != e.getDate()
}],
["%B", function(e) {
return e.getMonth()
}],
["%Y", Nt]
]),
Xl = {
range: function(e, t, n) {
return sa.range(Math.ceil(e / n) * n, +t, n).map(oa)
},
floor: w,
ceil: w
};
Zl.year = ds.year, ds.scale = function() {
return ra(sa.scale.linear(), Zl, Ql)
};
var Jl = Zl.map(function(e) {
return [e[0].utc, e[1]]
}),
ec = Yl.multi([
[".%L", function(e) {
return e.getUTCMilliseconds()
}],
[":%S", function(e) {
return e.getUTCSeconds()
}],
["%I:%M", function(e) {
return e.getUTCMinutes()
}],
["%I %p", function(e) {
return e.getUTCHours()
}],
["%a %d", function(e) {
return e.getUTCDay() && 1 != e.getUTCDate()
}],
["%b %d", function(e) {
return 1 != e.getUTCDate()
}],
["%B", function(e) {
return e.getUTCMonth()
}],
["%Y", Nt]
]);
Jl.year = ds.year.utc, ds.scale.utc = function() {
return ra(sa.scale.linear(), Jl, ec)
}, sa.text = Re(function(e) {
return e.responseText
}), sa.json = function(e, t) {
return Ne(e, "application/json", ia, t)
}, sa.html = function(e, t) {
return Ne(e, "text/html", aa, t)
}, sa.xml = Re(function(e) {
return e.responseXML
}), r = sa, o = "function" == typeof r ? r.call(t, n, t, e) : r, !(void 0 !== o && (e.exports = o)), this.d3 = sa
}()
}, function(e, t, n) {
! function() {
var t = {};
t.dev = !1, t.tooltip = t.tooltip || {}, t.utils = t.utils || {}, t.models = t.models || {}, t.charts = {}, t.logs = {}, t.dom = {}, t.dispatch = d3.dispatch("render_start", "render_end"), Function.prototype.bind || (Function.prototype.bind = function(e) {
if ("function" != typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
var t = Array.prototype.slice.call(arguments, 1),
n = this,
r = function() {},
o = function() {
return n.apply(this instanceof r && e ? this : e, t.concat(Array.prototype.slice.call(arguments)))
};
return r.prototype = this.prototype, o.prototype = new r, o
}), t.dev && (t.dispatch.on("render_start", function(e) {
t.logs.startTime = +new Date
}), t.dispatch.on("render_end", function(e) {
t.logs.endTime = +new Date, t.logs.totalTime = t.logs.endTime - t.logs.startTime, t.log("total", t.logs.totalTime)
})), t.log = function() {
if (t.dev && window.console && console.log && console.log.apply) console.log.apply(console, arguments);
else if (t.dev && window.console && "function" == typeof console.log && Function.prototype.bind) {
var e = Function.prototype.bind.call(console.log, console);
e.apply(console, arguments)
}
return arguments[arguments.length - 1]
}, t.deprecated = function(e, t) {
console && console.warn && console.warn("nvd3 warning: `" + e + "` has been deprecated. ", t || "")
}, t.render = function(e) {
e = e || 1, t.render.active = !0, t.dispatch.render_start();
var n = function() {
for (var r, o, i = 0; i < e && (o = t.render.queue[i]); i++) r = o.generate(), typeof o.callback == typeof Function && o.callback(r);
t.render.queue.splice(0, i), t.render.queue.length ? setTimeout(n) : (t.dispatch.render_end(), t.render.active = !1)
};
setTimeout(n)
}, t.render.active = !1, t.render.queue = [], t.addGraph = function(e) {
typeof arguments[0] == typeof Function && (e = {
generate: arguments[0],
callback: arguments[1]
}), t.render.queue.push(e), t.render.active || t.render()
}, e.exports = t, "undefined" != typeof window && (window.nv = t), t.dom.write = function(e) {
return void 0 !== window.fastdom ? fastdom.write(e) : e()
}, t.dom.read = function(e) {
return void 0 !== window.fastdom ? fastdom.read(e) : e()
}, t.interactiveGuideline = function() {
"use strict";
function e(d) {
d.each(function(d) {
function f() {
var t = d3.mouse(this),
r = t[0],
o = t[1],
l = !0,
c = !1;
if (u && (r = d3.event.offsetX, o = d3.event.offsetY, "svg" !== d3.event.target.tagName && (l = !1), d3.event.target.className.baseVal.match("nv-legend") && (c = !0)), l && (r -= i.left, o -= i.top), r < 0 || o < 0 || r > p || o > g || d3.event.relatedTarget && void 0 === d3.event.relatedTarget.ownerSVGElement || c) {
if (u && d3.event.relatedTarget && void 0 === d3.event.relatedTarget.ownerSVGElement && (void 0 === d3.event.relatedTarget.className || d3.event.relatedTarget.className.match(n.nvPointerEventsClass))) return;
return s.elementMouseout({
mouseX: r,
mouseY: o
}), e.renderGuideLine(null), void n.hidden(!0)
}
n.hidden(!1);
var d = a.invert(r);
s.elementMousemove({
mouseX: r,
mouseY: o,
pointXValue: d
}), "dblclick" === d3.event.type && s.elementDblclick({
mouseX: r,
mouseY: o,
pointXValue: d
}), "click" === d3.event.type && s.elementClick({
mouseX: r,
mouseY: o,
pointXValue: d
})
}
var m = d3.select(this),
p = r || 960,
g = o || 400,
v = m.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([d]),
h = v.enter().append("g").attr("class", " nv-wrap nv-interactiveLineLayer");
h.append("g").attr("class", "nv-interactiveGuideLine"), c && (c.on("touchmove", f).on("mousemove", f, !0).on("mouseout", f, !0).on("dblclick", f).on("click", f), e.guideLine = null, e.renderGuideLine = function(n) {
l && (e.guideLine && e.guideLine.attr("x1") === n || t.dom.write(function() {
var e = v.select(".nv-interactiveGuideLine").selectAll("line").data(null != n ? [t.utils.NaNtoZero(n)] : [], String);
e.enter().append("line").attr("class", "nv-guideline").attr("x1", function(e) {
return e
}).attr("x2", function(e) {
return e
}).attr("y1", g).attr("y2", 0), e.exit().remove()
}))
})
})
}
var n = t.models.tooltip();
n.duration(0).hideDelay(0)._isInteractiveLayer(!0).hidden(!1);
var r = null,
o = null,
i = {
left: 0,
top: 0
},
a = d3.scale.linear(),
s = d3.dispatch("elementMousemove", "elementMouseout", "elementClick", "elementDblclick"),
l = !0,
c = null,
u = "ActiveXObject" in window;
return e.dispatch = s, e.tooltip = n, e.margin = function(t) {
return arguments.length ? (i.top = "undefined" != typeof t.top ? t.top : i.top, i.left = "undefined" != typeof t.left ? t.left : i.left, e) : i
}, e.width = function(t) {
return arguments.length ? (r = t, e) : r
}, e.height = function(t) {
return arguments.length ? (o = t, e) : o
}, e.xScale = function(t) {
return arguments.length ? (a = t, e) : a
}, e.showGuideLine = function(t) {
return arguments.length ? (l = t, e) : l
}, e.svgContainer = function(t) {
return arguments.length ? (c = t, e) : c
}, e
}, t.interactiveBisect = function(e, t, n) {
"use strict";
if (!(e instanceof Array)) return null;
var r;
r = "function" != typeof n ? function(e) {
return e.x
} : n;
var o = function(e, t) {
return r(e) - t
},
i = d3.bisector(o).left,
a = d3.max([0, i(e, t) - 1]),
s = r(e[a]);
if ("undefined" == typeof s && (s = a), s === t) return a;
var l = d3.min([a + 1, e.length - 1]),
c = r(e[l]);
return "undefined" == typeof c && (c = l), Math.abs(c - t) >= Math.abs(s - t) ? a : l
}, t.nearestValueIndex = function(e, t, n) {
"use strict";
var r = 1 / 0,
o = null;
return e.forEach(function(e, i) {
var a = Math.abs(t - e);
null != e && a <= r && a < n && (r = a, o = i)
}), o
},
function() {
"use strict";
t.models.tooltip = function() {
function e() {
if (u) {
var e = d3.select(u);
"svg" !== e.node().tagName && (e = e.select("svg"));
var t = e.node() ? e.attr("viewBox") : null;
if (t) {
t = t.split(" ");
var n = parseInt(e.style("width"), 10) / t[2];
g.left = g.left * n, g.top = g.top * n
}
}
}
function n() {
if (!m) {
var e;
e = u ? u : document.body, m = d3.select(e).append("div").attr("class", "nvtooltip " + (c ? c : "xy-tooltip")).attr("id", S), m.style("top", 0).style("left", 0), m.style("opacity", 0), m.selectAll("div, table, td, tr").classed(_, !0), m.classed(_, !0), p = m.node()
}
}
function r() {
if (h && I(o)) {
e();
var i = g.left,
a = null !== l ? l : g.top;
return t.dom.write(function() {
n();
var e = C(o);
e && (p.innerHTML = e), u && E ? t.dom.read(function() {
var e = u.getElementsByTagName("svg")[0],
t = {
left: 0,
top: 0
};
if (e) {
var n = e.getBoundingClientRect(),
r = u.getBoundingClientRect(),
o = n.top;
if (o < 0) {
var l = u.getBoundingClientRect();
o = Math.abs(o) > l.height ? 0 : o
}
t.top = Math.abs(o - r.top), t.left = Math.abs(n.left - r.left)
}
i += u.offsetLeft + t.left - 2 * u.scrollLeft, a += u.offsetTop + t.top - 2 * u.scrollTop, s && s > 0 && (a = Math.floor(a / s) * s), x([i, a])
}) : x([i, a])
}), r
}
}
var o = null,
i = "w",
a = 25,
s = 0,
l = null,
c = null,
u = null,
d = !0,
f = 400,
m = null,
p = null,
g = {
left: null,
top: null
},
v = {
left: 0,
top: 0
},
h = !0,
y = 100,
b = !0,
E = !1,
S = "nvtooltip-" + Math.floor(1e5 * Math.random()),
_ = "nv-pointer-events-none",
w = function(e, t) {
return e
},
A = function(e) {
return e
},
T = function(e, t) {
return e
},
C = function(e) {
if (null === e) return "";
var t = d3.select(document.createElement("table"));
if (b) {
var n = t.selectAll("thead").data([e]).enter().append("thead");
n.append("tr").append("td").attr("colspan", 3).append("strong").classed("x-value", !0).html(A(e.value))
}
var r = t.selectAll("tbody").data([e]).enter().append("tbody"),
o = r.selectAll("tr").data(function(e) {
return e.series
}).enter().append("tr").classed("highlight", function(e) {
return e.highlight
});
o.append("td").classed("legend-color-guide", !0).append("div").style("background-color", function(e) {
return e.color
}), o.append("td").classed("key", !0).html(function(e, t) {
return T(e.key, t)
}), o.append("td").classed("value", !0).html(function(e, t) {
return w(e.value, t)
}), o.selectAll("td").each(function(e) {
if (e.highlight) {
var t = d3.scale.linear().domain([0, 1]).range(["#fff", e.color]),
n = .6;
d3.select(this).style("border-bottom-color", t(n)).style("border-top-color", t(n))
}
});
var i = t.node().outerHTML;
return void 0 !== e.footer && (i += ""), i
},
I = function(e) {
if (e && e.series) {
if (e.series instanceof Array) return !!e.series.length;
if (e.series instanceof Object) return e.series = [e.series], !0
}
return !1
},
x = function(e) {
p && t.dom.read(function() {
var n, r, o = parseInt(p.offsetHeight, 10),
s = parseInt(p.offsetWidth, 10),
l = t.utils.windowSize().width,
c = t.utils.windowSize().height,
u = window.pageYOffset,
g = window.pageXOffset;
c = window.innerWidth >= document.body.scrollWidth ? c : c - 16, l = window.innerHeight >= document.body.scrollHeight ? l : l - 16;
var h, b, E = function(e) {
var t = r;
do isNaN(e.offsetTop) || (t += e.offsetTop), e = e.offsetParent; while (e);
return t
},
S = function(e) {
var t = n;
do isNaN(e.offsetLeft) || (t += e.offsetLeft), e = e.offsetParent; while (e);
return t
};
switch (i) {
case "e":
n = e[0] - s - a, r = e[1] - o / 2, h = S(p), b = E(p), h < g && (n = e[0] + a > g ? e[0] + a : g - h + n), b < u && (r = u - b + r), b + o > u + c && (r = u + c - b + r - o);
break;
case "w":
n = e[0] + a, r = e[1] - o / 2, h = S(p), b = E(p), h + s > l && (n = e[0] - s - a), b < u && (r = u + 5), b + o > u + c && (r = u + c - b + r - o);
break;
case "n":
n = e[0] - s / 2 - 5, r = e[1] + a, h = S(p), b = E(p), h < g && (n = g + 5), h + s > l && (n = n - s / 2 + 5), b + o > u + c && (r = u + c - b + r - o);
break;
case "s":
n = e[0] - s / 2, r = e[1] - o - a, h = S(p), b = E(p), h < g && (n = g + 5), h + s > l && (n = n - s / 2 + 5), u > b && (r = u);
break;
case "none":
n = e[0], r = e[1] - a, h = S(p), b = E(p)
}
n -= v.left, r -= v.top;
var _ = p.getBoundingClientRect(),
u = window.pageYOffset || document.documentElement.scrollTop,
g = window.pageXOffset || document.documentElement.scrollLeft,
w = "translate(" + (_.left + g) + "px, " + (_.top + u) + "px)",
A = "translate(" + n + "px, " + r + "px)",
T = d3.interpolateString(w, A),
C = m.style("opacity") < .1;
d ? m.transition().delay(f).duration(0).style("opacity", 0) : m.interrupt().transition().duration(C ? 0 : y).styleTween("transform", function(e) {
return T
}, "important").style("-webkit-transform", A).style("opacity", 1)
})
};
return r.nvPointerEventsClass = _, r.options = t.utils.optionsFunc.bind(r), r._options = Object.create({}, {
duration: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
gravity: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
distance: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
snapDistance: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
classes: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
chartContainer: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
fixedTop: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
enabled: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
hideDelay: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
contentGenerator: {
get: function() {
return C
},
set: function(e) {
C = e
}
},
valueFormatter: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
headerFormatter: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
keyFormatter: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
headerEnabled: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
_isInteractiveLayer: {
get: function() {
return E
},
set: function(e) {
E = !!e
}
},
position: {
get: function() {
return g
},
set: function(e) {
g.left = void 0 !== e.left ? e.left : g.left, g.top = void 0 !== e.top ? e.top : g.top
}
},
offset: {
get: function() {
return v
},
set: function(e) {
v.left = void 0 !== e.left ? e.left : v.left, v.top = void 0 !== e.top ? e.top : v.top
}
},
hidden: {
get: function() {
return d
},
set: function(e) {
d != e && (d = !!e, r())
}
},
data: {
get: function() {
return o
},
set: function(e) {
e.point && (e.value = e.point.x, e.series = e.series || {}, e.series.value = e.point.y, e.series.color = e.point.color || e.series.color), o = e
}
},
tooltipElem: {
get: function() {
return p
},
set: function(e) {}
},
id: {
get: function() {
return S
},
set: function(e) {}
}
}), t.utils.initOptions(r), r
}
}(), t.utils.windowSize = function() {
var e = {
width: 640,
height: 480
};
return window.innerWidth && window.innerHeight ? (e.width = window.innerWidth, e.height = window.innerHeight, e) : "CSS1Compat" == document.compatMode && document.documentElement && document.documentElement.offsetWidth ? (e.width = document.documentElement.offsetWidth, e.height = document.documentElement.offsetHeight, e) : document.body && document.body.offsetWidth ? (e.width = document.body.offsetWidth, e.height = document.body.offsetHeight, e) : e
}, t.utils.windowResize = function(e) {
return window.addEventListener ? window.addEventListener("resize", e) : t.log("ERROR: Failed to bind to window.resize with: ", e), {
callback: e,
clear: function() {
window.removeEventListener("resize", e)
}
}
}, t.utils.getColor = function(e) {
if (void 0 === e) return t.utils.defaultColor();
if (Array.isArray(e)) {
var n = d3.scale.ordinal().range(e);
return function(e, t) {
var r = void 0 === t ? e : t;
return e.color || n(r)
}
}
return e
}, t.utils.defaultColor = function() {
return t.utils.getColor(d3.scale.category20().range())
}, t.utils.customTheme = function(e, t, n) {
t = t || function(e) {
return e.key
}, n = n || d3.scale.category20().range();
var r = n.length;
return function(o, i) {
var a = t(o);
return "function" == typeof e[a] ? e[a]() : void 0 !== e[a] ? e[a] : (r || (r = n.length), r -= 1, n[r])
}
}, t.utils.pjax = function(e, n) {
var r = function(r) {
d3.html(r, function(r) {
var o = d3.select(n).node();
o.parentNode.replaceChild(d3.select(r).select(n).node(), o), t.utils.pjax(e, n)
})
};
d3.selectAll(e).on("click", function() {
history.pushState(this.href, this.textContent, this.href), r(this.href), d3.event.preventDefault()
}), d3.select(window).on("popstate", function() {
d3.event.state && r(d3.event.state)
})
}, t.utils.calcApproxTextWidth = function(e) {
if ("function" == typeof e.style && "function" == typeof e.text) {
var t = parseInt(e.style("font-size").replace("px", ""), 10),
n = e.text().length;
return n * t * .5
}
return 0
}, t.utils.NaNtoZero = function(e) {
return "number" != typeof e || isNaN(e) || null === e || e === 1 / 0 || e === -(1 / 0) ? 0 : e
}, d3.selection.prototype.watchTransition = function(e) {
var t = [this].concat([].slice.call(arguments, 1));
return e.transition.apply(e, t)
}, t.utils.renderWatch = function(e, n) {
if (!(this instanceof t.utils.renderWatch)) return new t.utils.renderWatch(e, n);
var r = void 0 !== n ? n : 250,
o = [],
i = this;
this.models = function(e) {
return e = [].slice.call(arguments, 0), e.forEach(function(e) {
e.__rendered = !1,
function(e) {
e.dispatch.on("renderEnd", function(t) {
e.__rendered = !0, i.renderEnd("model")
})
}(e), o.indexOf(e) < 0 && o.push(e)
}), this
}, this.reset = function(e) {
void 0 !== e && (r = e), o = []
}, this.transition = function(e, t, n) {
if (t = arguments.length > 1 ? [].slice.call(arguments, 1) : [], n = t.length > 1 ? t.pop() : void 0 !== r ? r : 250, e.__rendered = !1, o.indexOf(e) < 0 && o.push(e), 0 === n) return e.__rendered = !0, e.delay = function() {
return this
}, e.duration = function() {
return this
}, e;
0 === e.length ? e.__rendered = !0 : e.every(function(e) {
return !e.length
}) ? e.__rendered = !0 : e.__rendered = !1;
var a = 0;
return e.transition().duration(n).each(function() {
++a
}).each("end", function(n, r) {
0 === --a && (e.__rendered = !0, i.renderEnd.apply(this, t))
})
}, this.renderEnd = function() {
o.every(function(e) {
return e.__rendered
}) && (o.forEach(function(e) {
e.__rendered = !1
}), e.renderEnd.apply(this, arguments))
}
}, t.utils.deepExtend = function(e) {
var n = arguments.length > 1 ? [].slice.call(arguments, 1) : [];
n.forEach(function(n) {
for (var r in n) {
var o = e[r] instanceof Array,
i = "object" == typeof e[r],
a = "object" == typeof n[r];
i && !o && a ? t.utils.deepExtend(e[r], n[r]) : e[r] = n[r]
}
})
}, t.utils.state = function() {
if (!(this instanceof t.utils.state)) return new t.utils.state;
var e = {},
n = function() {},
r = function() {
return {}
},
o = null,
i = null;
this.dispatch = d3.dispatch("change", "set"), this.dispatch.on("set", function(e) {
n(e, !0)
}), this.getter = function(e) {
return r = e, this
}, this.setter = function(e, t) {
return t || (t = function() {}), n = function(n, r) {
e(n), r && t()
}, this
}, this.init = function(e) {
o = o || {}, t.utils.deepExtend(o, e)
};
var a = function() {
var t = r();
if (JSON.stringify(t) === JSON.stringify(e)) return !1;
for (var n in t) void 0 === e[n] && (e[n] = {}), e[n] = t[n], i = !0;
return !0
};
this.update = function() {
o && (n(o, !1), o = null), a.call(this) && this.dispatch.change(e)
}
}, t.utils.optionsFunc = function(e) {
return e && d3.map(e).forEach(function(e, t) {
"function" == typeof this[e] && this[e](t)
}.bind(this)), this
}, t.utils.calcTicksX = function(e, n) {
var r = 1,
o = 0;
for (o; o < n.length; o += 1) {
var i = n[o] && n[o].values ? n[o].values.length : 0;
r = i > r ? i : r
}
return t.log("Requested number of ticks: ", e), t.log("Calculated max values to be: ", r), e = e > r ? e = r - 1 : e, e = e < 1 ? 1 : e, e = Math.floor(e), t.log("Calculating tick count as: ", e), e
}, t.utils.calcTicksY = function(e, n) {
return t.utils.calcTicksX(e, n)
}, t.utils.initOption = function(e, t) {
e._calls && e._calls[t] ? e[t] = e._calls[t] : (e[t] = function(n) {
return arguments.length ? (e._overrides[t] = !0, e._options[t] = n, e) : e._options[t]
}, e["_" + t] = function(n) {
return arguments.length ? (e._overrides[t] || (e._options[t] = n), e) : e._options[t]
})
}, t.utils.initOptions = function(e) {
e._overrides = e._overrides || {};
var n = Object.getOwnPropertyNames(e._options || {}),
r = Object.getOwnPropertyNames(e._calls || {});
n = n.concat(r);
for (var o in n) t.utils.initOption(e, n[o])
}, t.utils.inheritOptionsD3 = function(e, t, n) {
e._d3options = n.concat(e._d3options || []), n.unshift(t), n.unshift(e), d3.rebind.apply(this, n)
}, t.utils.arrayUnique = function(e) {
return e.sort().filter(function(t, n) {
return !n || t != e[n - 1]
})
}, t.utils.symbolMap = d3.map(), t.utils.symbol = function() {
function e(e, o) {
var i = n.call(this, e, o),
a = r.call(this, e, o);
return d3.svg.symbolTypes.indexOf(i) !== -1 ? d3.svg.symbol().type(i).size(a)() : t.utils.symbolMap.get(i)(a)
}
var n, r = 64;
return e.type = function(t) {
return arguments.length ? (n = d3.functor(t), e) : n
}, e.size = function(t) {
return arguments.length ? (r = d3.functor(t), e) : r
}, e
}, t.utils.inheritOptions = function(e, n) {
var r = Object.getOwnPropertyNames(n._options || {}),
o = Object.getOwnPropertyNames(n._calls || {}),
i = n._inherited || [],
a = n._d3options || [],
s = r.concat(o).concat(i).concat(a);
s.unshift(n), s.unshift(e), d3.rebind.apply(this, s), e._inherited = t.utils.arrayUnique(r.concat(o).concat(i).concat(r).concat(e._inherited || [])), e._d3options = t.utils.arrayUnique(a.concat(e._d3options || []))
}, t.utils.initSVG = function(e) {
e.classed({
"nvd3-svg": !0
})
}, t.utils.sanitizeHeight = function(e, t) {
return e || parseInt(t.style("height"), 10) || 400
}, t.utils.sanitizeWidth = function(e, t) {
return e || parseInt(t.style("width"), 10) || 960
}, t.utils.availableHeight = function(e, n, r) {
return t.utils.sanitizeHeight(e, n) - r.top - r.bottom
}, t.utils.availableWidth = function(e, n, r) {
return t.utils.sanitizeWidth(e, n) - r.left - r.right
}, t.utils.noData = function(e, n) {
var r = e.options(),
o = r.margin(),
i = r.noData(),
a = null == i ? ["No Data Available."] : [i],
s = t.utils.availableHeight(r.height(), n, o),
l = t.utils.availableWidth(r.width(), n, o),
c = o.left + l / 2,
u = o.top + s / 2;
n.selectAll("g").remove();
var d = n.selectAll(".nv-noData").data(a);
d.enter().append("text").attr("class", "nvd3 nv-noData").attr("dy", "-.7em").style("text-anchor", "middle"),
d.attr("x", c).attr("y", u).text(function(e) {
return e
})
}, t.models.axis = function() {
"use strict";
function e(a) {
return y.reset(), a.each(function(e) {
var a = d3.select(this);
t.utils.initSVG(a);
var g = a.selectAll("g.nv-wrap.nv-axis").data([e]),
v = g.enter().append("g").attr("class", "nvd3 nv-wrap nv-axis"),
b = (v.append("g"), g.select("g"));
null !== m ? n.ticks(m) : "top" != n.orient() && "bottom" != n.orient() || n.ticks(Math.abs(r.range()[1] - r.range()[0]) / 100), b.watchTransition(y, "axis").call(n), h = h || n.scale();
var E = n.tickFormat();
null == E && (E = h.tickFormat());
var S = b.selectAll("text.nv-axislabel").data([s || null]);
S.exit().remove();
var _, w, A;
switch (n.orient()) {
case "top":
S.enter().append("text").attr("class", "nv-axislabel"), A = r.range().length < 2 ? 0 : 2 === r.range().length ? r.range()[1] : r.range()[r.range().length - 1] + (r.range()[1] - r.range()[0]), S.attr("text-anchor", "middle").attr("y", 0).attr("x", A / 2), l && (w = g.selectAll("g.nv-axisMaxMin").data(r.domain()), w.enter().append("g").attr("class", function(e, t) {
return ["nv-axisMaxMin", "nv-axisMaxMin-x", 0 == t ? "nv-axisMin-x" : "nv-axisMax-x"].join(" ")
}).append("text"), w.exit().remove(), w.attr("transform", function(e, n) {
return "translate(" + t.utils.NaNtoZero(r(e)) + ",0)"
}).select("text").attr("dy", "-0.5em").attr("y", -n.tickPadding()).attr("text-anchor", "middle").text(function(e, t) {
var n = E(e);
return ("" + n).match("NaN") ? "" : n
}), w.watchTransition(y, "min-max top").attr("transform", function(e, n) {
return "translate(" + t.utils.NaNtoZero(r.range()[n]) + ",0)"
}));
break;
case "bottom":
_ = p + 36;
var T = 30,
C = 0,
I = b.selectAll("g").select("text"),
x = "";
if (c % 360) {
I.each(function(e, t) {
var n = this.getBoundingClientRect(),
r = n.width;
C = n.height, r > T && (T = r)
}), x = "rotate(" + c + " 0," + (C / 2 + n.tickPadding()) + ")";
var D = Math.abs(Math.sin(c * Math.PI / 180));
_ = (D ? D * T : T) + 30, I.attr("transform", x).style("text-anchor", c % 360 > 0 ? "start" : "end")
}
S.enter().append("text").attr("class", "nv-axislabel"), A = r.range().length < 2 ? 0 : 2 === r.range().length ? r.range()[1] : r.range()[r.range().length - 1] + (r.range()[1] - r.range()[0]), S.attr("text-anchor", "middle").attr("y", _).attr("x", A / 2), l && (w = g.selectAll("g.nv-axisMaxMin").data([r.domain()[0], r.domain()[r.domain().length - 1]]), w.enter().append("g").attr("class", function(e, t) {
return ["nv-axisMaxMin", "nv-axisMaxMin-x", 0 == t ? "nv-axisMin-x" : "nv-axisMax-x"].join(" ")
}).append("text"), w.exit().remove(), w.attr("transform", function(e, n) {
return "translate(" + t.utils.NaNtoZero(r(e) + (f ? r.rangeBand() / 2 : 0)) + ",0)"
}).select("text").attr("dy", ".71em").attr("y", n.tickPadding()).attr("transform", x).style("text-anchor", c ? c % 360 > 0 ? "start" : "end" : "middle").text(function(e, t) {
var n = E(e);
return ("" + n).match("NaN") ? "" : n
}), w.watchTransition(y, "min-max bottom").attr("transform", function(e, n) {
return "translate(" + t.utils.NaNtoZero(r(e) + (f ? r.rangeBand() / 2 : 0)) + ",0)"
})), d && I.attr("transform", function(e, t) {
return "translate(0," + (t % 2 == 0 ? "0" : "12") + ")"
});
break;
case "right":
S.enter().append("text").attr("class", "nv-axislabel"), S.style("text-anchor", u ? "middle" : "begin").attr("transform", u ? "rotate(90)" : "").attr("y", u ? -Math.max(o.right, i) + 12 : -10).attr("x", u ? d3.max(r.range()) / 2 : n.tickPadding()), l && (w = g.selectAll("g.nv-axisMaxMin").data(r.domain()), w.enter().append("g").attr("class", function(e, t) {
return ["nv-axisMaxMin", "nv-axisMaxMin-y", 0 == t ? "nv-axisMin-y" : "nv-axisMax-y"].join(" ")
}).append("text").style("opacity", 0), w.exit().remove(), w.attr("transform", function(e, n) {
return "translate(0," + t.utils.NaNtoZero(r(e)) + ")"
}).select("text").attr("dy", ".32em").attr("y", 0).attr("x", n.tickPadding()).style("text-anchor", "start").text(function(e, t) {
var n = E(e);
return ("" + n).match("NaN") ? "" : n
}), w.watchTransition(y, "min-max right").attr("transform", function(e, n) {
return "translate(0," + t.utils.NaNtoZero(r.range()[n]) + ")"
}).select("text").style("opacity", 1));
break;
case "left":
S.enter().append("text").attr("class", "nv-axislabel"), S.style("text-anchor", u ? "middle" : "end").attr("transform", u ? "rotate(-90)" : "").attr("y", u ? -Math.max(o.left, i) + 25 - (p || 0) : -10).attr("x", u ? -d3.max(r.range()) / 2 : -n.tickPadding()), l && (w = g.selectAll("g.nv-axisMaxMin").data(r.domain()), w.enter().append("g").attr("class", function(e, t) {
return ["nv-axisMaxMin", "nv-axisMaxMin-y", 0 == t ? "nv-axisMin-y" : "nv-axisMax-y"].join(" ")
}).append("text").style("opacity", 0), w.exit().remove(), w.attr("transform", function(e, n) {
return "translate(0," + t.utils.NaNtoZero(h(e)) + ")"
}).select("text").attr("dy", ".32em").attr("y", 0).attr("x", -n.tickPadding()).attr("text-anchor", "end").text(function(e, t) {
var n = E(e);
return ("" + n).match("NaN") ? "" : n
}), w.watchTransition(y, "min-max right").attr("transform", function(e, n) {
return "translate(0," + t.utils.NaNtoZero(r.range()[n]) + ")"
}).select("text").style("opacity", 1))
}
if (S.text(function(e) {
return e
}), !l || "left" !== n.orient() && "right" !== n.orient() || (b.selectAll("g").each(function(e, t) {
d3.select(this).select("text").attr("opacity", 1), (r(e) < r.range()[1] + 10 || r(e) > r.range()[0] - 10) && ((e > 1e-10 || e < -1e-10) && d3.select(this).attr("opacity", 0), d3.select(this).select("text").attr("opacity", 0))
}), r.domain()[0] == r.domain()[1] && 0 == r.domain()[0] && g.selectAll("g.nv-axisMaxMin").style("opacity", function(e, t) {
return t ? 0 : 1
})), l && ("top" === n.orient() || "bottom" === n.orient())) {
var M = [];
g.selectAll("g.nv-axisMaxMin").each(function(e, t) {
try {
t ? M.push(r(e) - this.getBoundingClientRect().width - 4) : M.push(r(e) + this.getBoundingClientRect().width + 4)
} catch (n) {
t ? M.push(r(e) - 4) : M.push(r(e) + 4)
}
}), b.selectAll("g").each(function(e, t) {
(r(e) < M[0] || r(e) > M[1]) && (e > 1e-10 || e < -1e-10 ? d3.select(this).remove() : d3.select(this).select("text").remove())
})
}
b.selectAll(".tick").filter(function(e) {
return !parseFloat(Math.round(1e5 * e) / 1e6) && void 0 !== e
}).classed("zero", !0), h = r.copy()
}), y.renderEnd("axis immediate"), e
}
var n = d3.svg.axis(),
r = d3.scale.linear(),
o = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
i = 75,
a = 60,
s = null,
l = !0,
c = 0,
u = !0,
d = !1,
f = !1,
m = null,
p = 0,
g = 250,
v = d3.dispatch("renderEnd");
n.scale(r).orient("bottom").tickFormat(function(e) {
return e
});
var h, y = t.utils.renderWatch(v, g);
return e.axis = n, e.dispatch = v, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
axisLabelDistance: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
staggerLabels: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
rotateLabels: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
rotateYLabel: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
showMaxMin: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
axisLabel: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
height: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
ticks: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
width: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
margin: {
get: function() {
return o
},
set: function(e) {
o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left
}
},
duration: {
get: function() {
return g
},
set: function(e) {
g = e, y.reset(g)
}
},
scale: {
get: function() {
return r
},
set: function(o) {
r = o, n.scale(r), f = "function" == typeof r.rangeBands, t.utils.inheritOptionsD3(e, r, ["domain", "range", "rangeBand", "rangeBands"])
}
}
}), t.utils.initOptions(e), t.utils.inheritOptionsD3(e, n, ["orient", "tickValues", "tickSubdivide", "tickSize", "tickPadding", "tickFormat"]), t.utils.inheritOptionsD3(e, r, ["domain", "range", "rangeBand", "rangeBands"]), e
}, t.models.boxPlot = function() {
"use strict";
function e(d) {
return S.reset(), d.each(function(e) {
var d = c - l.left - l.right,
g = u - l.top - l.bottom;
h = d3.select(this), t.utils.initSVG(h), f.domain(n || e.map(function(e, t) {
return p(e, t)
})).rangeBands(o || [0, d], .1);
var _ = [];
if (!r) {
var w = d3.min(e.map(function(e) {
var t = [];
return t.push(e.values.Q1), e.values.hasOwnProperty("whisker_low") && null !== e.values.whisker_low && t.push(e.values.whisker_low), e.values.hasOwnProperty("outliers") && null !== e.values.outliers && (t = t.concat(e.values.outliers)), d3.min(t)
})),
A = d3.max(e.map(function(e) {
var t = [];
return t.push(e.values.Q3), e.values.hasOwnProperty("whisker_high") && null !== e.values.whisker_high && t.push(e.values.whisker_high), e.values.hasOwnProperty("outliers") && null !== e.values.outliers && (t = t.concat(e.values.outliers)), d3.max(t)
}));
_ = [w, A]
}
m.domain(r || _), m.range(i || [g, 0]), a = a || f, s = s || m.copy().range([m(0), m(0)]);
var T = h.selectAll("g.nv-wrap").data([e]);
T.enter().append("g").attr("class", "nvd3 nv-wrap");
T.attr("transform", "translate(" + l.left + "," + l.top + ")");
var C = T.selectAll(".nv-boxplot").data(function(e) {
return e
}),
I = C.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6);
C.attr("class", "nv-boxplot").attr("transform", function(e, t, n) {
return "translate(" + (f(p(e, t)) + .05 * f.rangeBand()) + ", 0)"
}).classed("hover", function(e) {
return e.hover
}), C.watchTransition(S, "nv-boxplot: boxplots").style("stroke-opacity", 1).style("fill-opacity", .75).delay(function(t, n) {
return n * b / e.length
}).attr("transform", function(e, t) {
return "translate(" + (f(p(e, t)) + .05 * f.rangeBand()) + ", 0)"
}), C.exit().remove(), I.each(function(e, t) {
var n = d3.select(this);
["low", "high"].forEach(function(r) {
e.values.hasOwnProperty("whisker_" + r) && null !== e.values["whisker_" + r] && (n.append("line").style("stroke", e.color ? e.color : v(e, t)).attr("class", "nv-boxplot-whisker nv-boxplot-" + r), n.append("line").style("stroke", e.color ? e.color : v(e, t)).attr("class", "nv-boxplot-tick nv-boxplot-" + r))
})
});
var x = C.selectAll(".nv-boxplot-outlier").data(function(e) {
return e.values.hasOwnProperty("outliers") && null !== e.values.outliers ? e.values.outliers : []
});
x.enter().append("circle").style("fill", function(e, t, n) {
return v(e, n)
}).style("stroke", function(e, t, n) {
return v(e, n)
}).on("mouseover", function(e, t, n) {
d3.select(this).classed("hover", !0), y.elementMouseover({
series: {
key: e,
color: v(e, n)
},
e: d3.event
})
}).on("mouseout", function(e, t, n) {
d3.select(this).classed("hover", !1), y.elementMouseout({
series: {
key: e,
color: v(e, n)
},
e: d3.event
})
}).on("mousemove", function(e, t) {
y.elementMousemove({
e: d3.event
})
}), x.attr("class", "nv-boxplot-outlier"), x.watchTransition(S, "nv-boxplot: nv-boxplot-outlier").attr("cx", .45 * f.rangeBand()).attr("cy", function(e, t, n) {
return m(e)
}).attr("r", "3"), x.exit().remove();
var D = function() {
return null === E ? .9 * f.rangeBand() : Math.min(75, .9 * f.rangeBand())
},
M = function() {
return .45 * f.rangeBand() - D() / 2
},
O = function() {
return .45 * f.rangeBand() + D() / 2
};
["low", "high"].forEach(function(e) {
var t = "low" === e ? "Q1" : "Q3";
C.select("line.nv-boxplot-whisker.nv-boxplot-" + e).watchTransition(S, "nv-boxplot: boxplots").attr("x1", .45 * f.rangeBand()).attr("y1", function(t, n) {
return m(t.values["whisker_" + e])
}).attr("x2", .45 * f.rangeBand()).attr("y2", function(e, n) {
return m(e.values[t])
}), C.select("line.nv-boxplot-tick.nv-boxplot-" + e).watchTransition(S, "nv-boxplot: boxplots").attr("x1", M).attr("y1", function(t, n) {
return m(t.values["whisker_" + e])
}).attr("x2", O).attr("y2", function(t, n) {
return m(t.values["whisker_" + e])
})
}), ["low", "high"].forEach(function(e) {
I.selectAll(".nv-boxplot-" + e).on("mouseover", function(t, n, r) {
d3.select(this).classed("hover", !0), y.elementMouseover({
series: {
key: t.values["whisker_" + e],
color: v(t, r)
},
e: d3.event
})
}).on("mouseout", function(t, n, r) {
d3.select(this).classed("hover", !1), y.elementMouseout({
series: {
key: t.values["whisker_" + e],
color: v(t, r)
},
e: d3.event
})
}).on("mousemove", function(e, t) {
y.elementMousemove({
e: d3.event
})
})
}), I.append("rect").attr("class", "nv-boxplot-box").on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0), y.elementMouseover({
key: e.label,
value: e.label,
series: [{
key: "Q3",
value: e.values.Q3,
color: e.color || v(e, t)
}, {
key: "Q2",
value: e.values.Q2,
color: e.color || v(e, t)
}, {
key: "Q1",
value: e.values.Q1,
color: e.color || v(e, t)
}],
data: e,
index: t,
e: d3.event
})
}).on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1), y.elementMouseout({
key: e.label,
value: e.label,
series: [{
key: "Q3",
value: e.values.Q3,
color: e.color || v(e, t)
}, {
key: "Q2",
value: e.values.Q2,
color: e.color || v(e, t)
}, {
key: "Q1",
value: e.values.Q1,
color: e.color || v(e, t)
}],
data: e,
index: t,
e: d3.event
})
}).on("mousemove", function(e, t) {
y.elementMousemove({
e: d3.event
})
}), C.select("rect.nv-boxplot-box").watchTransition(S, "nv-boxplot: boxes").attr("y", function(e, t) {
return m(e.values.Q3)
}).attr("width", D).attr("x", M).attr("height", function(e, t) {
return Math.abs(m(e.values.Q3) - m(e.values.Q1)) || 1
}).style("fill", function(e, t) {
return e.color || v(e, t)
}).style("stroke", function(e, t) {
return e.color || v(e, t)
}), I.append("line").attr("class", "nv-boxplot-median"), C.select("line.nv-boxplot-median").watchTransition(S, "nv-boxplot: boxplots line").attr("x1", M).attr("y1", function(e, t) {
return m(e.values.Q2)
}).attr("x2", O).attr("y2", function(e, t) {
return m(e.values.Q2)
}), a = f.copy(), s = m.copy()
}), S.renderEnd("nv-boxplot immediate"), e
}
var n, r, o, i, a, s, l = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
c = 960,
u = 500,
d = Math.floor(1e4 * Math.random()),
f = d3.scale.ordinal(),
m = d3.scale.linear(),
p = function(e) {
return e.x
},
g = function(e) {
return e.y
},
v = t.utils.defaultColor(),
h = null,
y = d3.dispatch("elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"),
b = 250,
E = null,
S = t.utils.renderWatch(y, b);
return e.dispatch = y, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
height: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
maxBoxWidth: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
x: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
y: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
xScale: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
yScale: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
xDomain: {
get: function() {
return n
},
set: function(e) {
n = e
}
},
yDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
xRange: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
yRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
id: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
margin: {
get: function() {
return l
},
set: function(e) {
l.top = void 0 !== e.top ? e.top : l.top, l.right = void 0 !== e.right ? e.right : l.right, l.bottom = void 0 !== e.bottom ? e.bottom : l.bottom, l.left = void 0 !== e.left ? e.left : l.left
}
},
color: {
get: function() {
return v
},
set: function(e) {
v = t.utils.getColor(e)
}
},
duration: {
get: function() {
return b
},
set: function(e) {
b = e, S.reset(b)
}
}
}), t.utils.initOptions(e), e
}, t.models.boxPlotChart = function() {
"use strict";
function e(u) {
return b.reset(), b.models(o), d && b.models(i), f && b.models(a), u.each(function(u) {
var g = d3.select(this);
t.utils.initSVG(g);
var b = (l || parseInt(g.style("width")) || 960) - s.left - s.right,
E = (c || parseInt(g.style("height")) || 400) - s.top - s.bottom;
if (e.update = function() {
h.beforeUpdate(), g.transition().duration(y).call(e)
}, e.container = this, !(u && u.length && u.filter(function(e) {
return e.values.hasOwnProperty("Q1") && e.values.hasOwnProperty("Q2") && e.values.hasOwnProperty("Q3")
}).length)) {
var S = g.selectAll(".nv-noData").data([v]);
return S.enter().append("text").attr("class", "nvd3 nv-noData").attr("dy", "-.7em").style("text-anchor", "middle"), S.attr("x", s.left + b / 2).attr("y", s.top + E / 2).text(function(e) {
return e
}), e
}
g.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale().clamp(!0);
var _ = g.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),
w = _.enter().append("g").attr("class", "nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),
A = w.append("defs"),
T = _.select("g");
w.append("g").attr("class", "nv-x nv-axis"), w.append("g").attr("class", "nv-y nv-axis").append("g").attr("class", "nv-zeroLine").append("line"), w.append("g").attr("class", "nv-barsWrap"), T.attr("transform", "translate(" + s.left + "," + s.top + ")"), m && T.select(".nv-y.nv-axis").attr("transform", "translate(" + b + ",0)"), o.width(b).height(E);
var C = T.select(".nv-barsWrap").datum(u.filter(function(e) {
return !e.disabled
}));
if (C.transition().call(o), A.append("clipPath").attr("id", "nv-x-label-clip-" + o.id()).append("rect"), T.select("#nv-x-label-clip-" + o.id() + " rect").attr("width", n.rangeBand() * (p ? 2 : 1)).attr("height", 16).attr("x", -n.rangeBand() / (p ? 1 : 2)), d) {
i.scale(n).ticks(t.utils.calcTicksX(b / 100, u)).tickSize(-E, 0), T.select(".nv-x.nv-axis").attr("transform", "translate(0," + r.range()[0] + ")"), T.select(".nv-x.nv-axis").call(i);
var I = T.select(".nv-x.nv-axis").selectAll("g");
p && I.selectAll("text").attr("transform", function(e, t, n) {
return "translate(0," + (n % 2 == 0 ? "5" : "17") + ")"
})
}
f && (a.scale(r).ticks(Math.floor(E / 36)).tickSize(-b, 0), T.select(".nv-y.nv-axis").call(a)), T.select(".nv-zeroLine line").attr("x1", 0).attr("x2", b).attr("y1", r(0)).attr("y2", r(0))
}), b.renderEnd("nv-boxplot chart immediate"), e
}
var n, r, o = t.models.boxPlot(),
i = t.models.axis(),
a = t.models.axis(),
s = {
top: 15,
right: 10,
bottom: 50,
left: 60
},
l = null,
c = null,
u = t.utils.getColor(),
d = !0,
f = !0,
m = !1,
p = !1,
g = t.models.tooltip(),
v = "No Data Available.",
h = d3.dispatch("tooltipShow", "tooltipHide", "beforeUpdate", "renderEnd"),
y = 250;
i.orient("bottom").showMaxMin(!1).tickFormat(function(e) {
return e
}), a.orient(m ? "right" : "left").tickFormat(d3.format(",.1f")), g.duration(0);
var b = t.utils.renderWatch(h, y);
return o.dispatch.on("elementMouseover.tooltip", function(e) {
g.data(e).hidden(!1)
}), o.dispatch.on("elementMouseout.tooltip", function(e) {
g.data(e).hidden(!0)
}), o.dispatch.on("elementMousemove.tooltip", function(e) {
g.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.dispatch = h, e.boxplot = o, e.xAxis = i, e.yAxis = a, e.tooltip = g, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
height: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
staggerLabels: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
showXAxis: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
showYAxis: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
tooltips: {
get: function() {
return tooltips
},
set: function(e) {
tooltips = e
}
},
tooltipContent: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
noData: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
margin: {
get: function() {
return s
},
set: function(e) {
s.top = void 0 !== e.top ? e.top : s.top, s.right = void 0 !== e.right ? e.right : s.right, s.bottom = void 0 !== e.bottom ? e.bottom : s.bottom, s.left = void 0 !== e.left ? e.left : s.left
}
},
duration: {
get: function() {
return y
},
set: function(e) {
y = e, b.reset(y), o.duration(y), i.duration(y), a.duration(y)
}
},
color: {
get: function() {
return u
},
set: function(e) {
u = t.utils.getColor(e), o.color(u)
}
},
rightAlignYAxis: {
get: function() {
return m
},
set: function(e) {
m = e, a.orient(e ? "right" : "left")
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.bullet = function() {
"use strict";
function e(r) {
return r.each(function(e, r) {
var g = f - n.left - n.right,
y = m - n.top - n.bottom;
p = d3.select(this), t.utils.initSVG(p);
var b = i.call(this, e, r).slice().sort(d3.descending),
E = a.call(this, e, r).slice().sort(d3.descending),
S = s.call(this, e, r).slice().sort(d3.descending),
_ = l.call(this, e, r).slice(),
w = c.call(this, e, r).slice(),
A = u.call(this, e, r).slice(),
T = d3.scale.linear().domain(d3.extent(d3.merge([d, b]))).range(o ? [g, 0] : [0, g]);
this.__chart__ || d3.scale.linear().domain([0, 1 / 0]).range(T.range());
this.__chart__ = T;
var C = d3.min(b),
I = d3.max(b),
x = b[1],
D = p.selectAll("g.nv-wrap.nv-bullet").data([e]),
M = D.enter().append("g").attr("class", "nvd3 nv-wrap nv-bullet"),
O = M.append("g"),
R = D.select("g");
O.append("rect").attr("class", "nv-range nv-rangeMax"), O.append("rect").attr("class", "nv-range nv-rangeAvg"), O.append("rect").attr("class", "nv-range nv-rangeMin"), O.append("rect").attr("class", "nv-measure"), D.attr("transform", "translate(" + n.left + "," + n.top + ")");
var N = function(e) {
return Math.abs(T(e) - T(0))
},
L = function(e) {
return T(e < 0 ? e : 0)
};
R.select("rect.nv-rangeMax").attr("height", y).attr("width", N(I > 0 ? I : C)).attr("x", L(I > 0 ? I : C)).datum(I > 0 ? I : C), R.select("rect.nv-rangeAvg").attr("height", y).attr("width", N(x)).attr("x", L(x)).datum(x), R.select("rect.nv-rangeMin").attr("height", y).attr("width", N(I)).attr("x", L(I)).attr("width", N(I > 0 ? C : I)).attr("x", L(I > 0 ? C : I)).datum(I > 0 ? C : I), R.select("rect.nv-measure").style("fill", v).attr("height", y / 3).attr("y", y / 3).attr("width", S < 0 ? T(0) - T(S[0]) : T(S[0]) - T(0)).attr("x", L(S)).on("mouseover", function() {
h.elementMouseover({
value: S[0],
label: A[0] || "Current",
color: d3.select(this).style("fill")
})
}).on("mousemove", function() {
h.elementMousemove({
value: S[0],
label: A[0] || "Current",
color: d3.select(this).style("fill")
})
}).on("mouseout", function() {
h.elementMouseout({
value: S[0],
label: A[0] || "Current",
color: d3.select(this).style("fill")
})
});
var k = y / 6,
P = E.map(function(e, t) {
return {
value: e,
label: w[t]
}
});
O.selectAll("path.nv-markerTriangle").data(P).enter().append("path").attr("class", "nv-markerTriangle").attr("transform", function(e) {
return "translate(" + T(e.value) + "," + y / 2 + ")"
}).attr("d", "M0," + k + "L" + k + "," + -k + " " + -k + "," + -k + "Z").on("mouseover", function(e) {
h.elementMouseover({
value: e.value,
label: e.label || "Previous",
color: d3.select(this).style("fill"),
pos: [T(e.value), y / 2]
})
}).on("mousemove", function(e) {
h.elementMousemove({
value: e.value,
label: e.label || "Previous",
color: d3.select(this).style("fill")
})
}).on("mouseout", function(e, t) {
h.elementMouseout({
value: e.value,
label: e.label || "Previous",
color: d3.select(this).style("fill")
})
}), D.selectAll(".nv-range").on("mouseover", function(e, t) {
var n = _[t] || (t ? 1 == t ? "Mean" : "Minimum" : "Maximum");
h.elementMouseover({
value: e,
label: n,
color: d3.select(this).style("fill")
})
}).on("mousemove", function() {
h.elementMousemove({
value: S[0],
label: A[0] || "Previous",
color: d3.select(this).style("fill")
})
}).on("mouseout", function(e, t) {
var n = _[t] || (t ? 1 == t ? "Mean" : "Minimum" : "Maximum");
h.elementMouseout({
value: e,
label: n,
color: d3.select(this).style("fill")
})
})
}), e
}
var n = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
r = "left",
o = !1,
i = function(e) {
return e.ranges
},
a = function(e) {
return e.markers ? e.markers : [0]
},
s = function(e) {
return e.measures
},
l = function(e) {
return e.rangeLabels ? e.rangeLabels : []
},
c = function(e) {
return e.markerLabels ? e.markerLabels : []
},
u = function(e) {
return e.measureLabels ? e.measureLabels : []
},
d = [0],
f = 380,
m = 30,
p = null,
g = null,
v = t.utils.getColor(["#1f77b4"]),
h = d3.dispatch("elementMouseover", "elementMouseout", "elementMousemove");
return e.dispatch = h, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
ranges: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
markers: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
measures: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
forceX: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
width: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
height: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
tickFormat: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
margin: {
get: function() {
return n
},
set: function(e) {
n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left
}
},
orient: {
get: function() {
return r
},
set: function(e) {
r = e, o = "right" == r || "bottom" == r
}
},
color: {
get: function() {
return v
},
set: function(e) {
v = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.bulletChart = function() {
"use strict";
function e(r) {
return r.each(function(o, p) {
var g = d3.select(this);
t.utils.initSVG(g);
var v = t.utils.availableWidth(u, g, a),
h = d - a.top - a.bottom;
if (e.update = function() {
e(r)
}, e.container = this, !o || !s.call(this, o, p)) return t.utils.noData(e, g), e;
g.selectAll(".nv-noData").remove();
var y = s.call(this, o, p).slice().sort(d3.descending),
b = l.call(this, o, p).slice().sort(d3.descending),
E = c.call(this, o, p).slice().sort(d3.descending),
S = g.selectAll("g.nv-wrap.nv-bulletChart").data([o]),
_ = S.enter().append("g").attr("class", "nvd3 nv-wrap nv-bulletChart"),
w = _.append("g"),
A = S.select("g");
w.append("g").attr("class", "nv-bulletWrap"), w.append("g").attr("class", "nv-titles"), S.attr("transform", "translate(" + a.left + "," + a.top + ")");
var T = d3.scale.linear().domain([0, Math.max(y[0], b[0], E[0])]).range(i ? [v, 0] : [0, v]),
C = this.__chart__ || d3.scale.linear().domain([0, 1 / 0]).range(T.range());
this.__chart__ = T;
var I = w.select(".nv-titles").append("g").attr("text-anchor", "end").attr("transform", "translate(-6," + (d - a.top - a.bottom) / 2 + ")");
I.append("text").attr("class", "nv-title").text(function(e) {
return e.title
}), I.append("text").attr("class", "nv-subtitle").attr("dy", "1em").text(function(e) {
return e.subtitle
}), n.width(v).height(h);
var x = A.select(".nv-bulletWrap");
d3.transition(x).call(n);
var D = f || T.tickFormat(v / 100),
M = A.selectAll("g.nv-tick").data(T.ticks(m ? m : v / 50), function(e) {
return this.textContent || D(e)
}),
O = M.enter().append("g").attr("class", "nv-tick").attr("transform", function(e) {
return "translate(" + C(e) + ",0)"
}).style("opacity", 1e-6);
O.append("line").attr("y1", h).attr("y2", 7 * h / 6), O.append("text").attr("text-anchor", "middle").attr("dy", "1em").attr("y", 7 * h / 6).text(D);
var R = d3.transition(M).attr("transform", function(e) {
return "translate(" + T(e) + ",0)"
}).style("opacity", 1);
R.select("line").attr("y1", h).attr("y2", 7 * h / 6), R.select("text").attr("y", 7 * h / 6), d3.transition(M.exit()).attr("transform", function(e) {
return "translate(" + T(e) + ",0)"
}).style("opacity", 1e-6).remove()
}), d3.timer.flush(), e
}
var n = t.models.bullet(),
r = t.models.tooltip(),
o = "left",
i = !1,
a = {
top: 5,
right: 40,
bottom: 20,
left: 120
},
s = function(e) {
return e.ranges
},
l = function(e) {
return e.markers ? e.markers : [0]
},
c = function(e) {
return e.measures
},
u = null,
d = 55,
f = null,
m = null,
p = null,
g = d3.dispatch("tooltipShow", "tooltipHide");
return r.duration(0).headerEnabled(!1), n.dispatch.on("elementMouseover.tooltip", function(e) {
e.series = {
key: e.label,
value: e.value,
color: e.color
}, r.data(e).hidden(!1)
}), n.dispatch.on("elementMouseout.tooltip", function(e) {
r.hidden(!0)
}), n.dispatch.on("elementMousemove.tooltip", function(e) {
r.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.bullet = n, e.dispatch = g, e.tooltip = r, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
ranges: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
markers: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
measures: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
width: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
height: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
tickFormat: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
ticks: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
noData: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
tooltips: {
get: function() {
return r.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), r.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return r.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), r.contentGenerator(e)
}
},
margin: {
get: function() {
return a
},
set: function(e) {
a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left
}
},
orient: {
get: function() {
return o
},
set: function(e) {
o = e, i = "right" == o || "bottom" == o
}
}
}), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e
}, t.models.candlestickBar = function() {
"use strict";
function e(w) {
return w.each(function(e) {
n = d3.select(this);
var w = t.utils.availableWidth(l, n, s),
A = t.utils.availableHeight(c, n, s);
t.utils.initSVG(n);
var C = w / e[0].values.length * .45;
d.domain(r || d3.extent(e[0].values.map(m).concat(b))), S ? d.range(i || [.5 * w / e[0].values.length, w * (e[0].values.length - .5) / e[0].values.length]) : d.range(i || [5 + C / 2, w - C / 2 - 5]), f.domain(o || [d3.min(e[0].values.map(y).concat(E)), d3.max(e[0].values.map(h).concat(E))]).range(a || [A, 0]), d.domain()[0] === d.domain()[1] && (d.domain()[0] ? d.domain([d.domain()[0] - .01 * d.domain()[0], d.domain()[1] + .01 * d.domain()[1]]) : d.domain([-1, 1])), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] + .01 * f.domain()[0], f.domain()[1] - .01 * f.domain()[1]]) : f.domain([-1, 1]));
var I = d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([e[0].values]),
x = I.enter().append("g").attr("class", "nvd3 nv-wrap nv-candlestickBar"),
D = x.append("defs"),
M = x.append("g"),
O = I.select("g");
M.append("g").attr("class", "nv-ticks"), I.attr("transform", "translate(" + s.left + "," + s.top + ")"), n.on("click", function(e, t) {
T.chartClick({
data: e,
index: t,
pos: d3.event,
id: u
})
}), D.append("clipPath").attr("id", "nv-chart-clip-path-" + u).append("rect"), I.select("#nv-chart-clip-path-" + u + " rect").attr("width", w).attr("height", A), O.attr("clip-path", _ ? "url(#nv-chart-clip-path-" + u + ")" : "");
var R = I.select(".nv-ticks").selectAll(".nv-tick").data(function(e) {
return e
});
R.exit().remove();
var N = R.enter().append("g").attr("class", function(e, t, n) {
return (g(e, t) > v(e, t) ? "nv-tick negative" : "nv-tick positive") + " nv-tick-" + n + "-" + t
});
N.append("line").attr("class", "nv-candlestick-lines").attr("transform", function(e, t) {
return "translate(" + d(m(e, t)) + ",0)"
}).attr("x1", 0).attr("y1", function(e, t) {
return f(h(e, t))
}).attr("x2", 0).attr("y2", function(e, t) {
return f(y(e, t))
}), N.append("rect").attr("class", "nv-candlestick-rects nv-bars").attr("transform", function(e, t) {
return "translate(" + (d(m(e, t)) - C / 2) + "," + (f(p(e, t)) - (g(e, t) > v(e, t) ? f(v(e, t)) - f(g(e, t)) : 0)) + ")"
}).attr("x", 0).attr("y", 0).attr("width", C).attr("height", function(e, t) {
var n = g(e, t),
r = v(e, t);
return n > r ? f(r) - f(n) : f(n) - f(r)
});
n.selectAll(".nv-candlestick-lines").transition().attr("transform", function(e, t) {
return "translate(" + d(m(e, t)) + ",0)"
}).attr("x1", 0).attr("y1", function(e, t) {
return f(h(e, t))
}).attr("x2", 0).attr("y2", function(e, t) {
return f(y(e, t))
}), n.selectAll(".nv-candlestick-rects").transition().attr("transform", function(e, t) {
return "translate(" + (d(m(e, t)) - C / 2) + "," + (f(p(e, t)) - (g(e, t) > v(e, t) ? f(v(e, t)) - f(g(e, t)) : 0)) + ")"
}).attr("x", 0).attr("y", 0).attr("width", C).attr("height", function(e, t) {
var n = g(e, t),
r = v(e, t);
return n > r ? f(r) - f(n) : f(n) - f(r)
})
}), e
}
var n, r, o, i, a, s = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
l = null,
c = null,
u = Math.floor(1e4 * Math.random()),
d = d3.scale.linear(),
f = d3.scale.linear(),
m = function(e) {
return e.x
},
p = function(e) {
return e.y
},
g = function(e) {
return e.open
},
v = function(e) {
return e.close
},
h = function(e) {
return e.high
},
y = function(e) {
return e.low
},
b = [],
E = [],
S = !1,
_ = !0,
w = t.utils.defaultColor(),
A = !1,
T = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd", "chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove");
return e.highlightPoint = function(t, r) {
e.clearHighlights(), n.select(".nv-candlestickBar .nv-tick-0-" + t).classed("hover", r)
}, e.clearHighlights = function() {
n.select(".nv-candlestickBar .nv-tick.hover").classed("hover", !1)
}, e.dispatch = T, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
height: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
xScale: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
yScale: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
xDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
yDomain: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
xRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
yRange: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
forceX: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
forceY: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
padData: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
clipEdge: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
id: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
interactive: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
x: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
y: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
open: {
get: function() {
return g()
},
set: function(e) {
g = e
}
},
close: {
get: function() {
return v()
},
set: function(e) {
v = e
}
},
high: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
low: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
margin: {
get: function() {
return s
},
set: function(e) {
s.top = void 0 != e.top ? e.top : s.top, s.right = void 0 != e.right ? e.right : s.right, s.bottom = void 0 != e.bottom ? e.bottom : s.bottom, s.left = void 0 != e.left ? e.left : s.left
}
},
color: {
get: function() {
return w
},
set: function(e) {
w = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.cumulativeLineChart = function() {
"use strict";
function e(d) {
return N.reset(), N.models(i), h && N.models(a), y && N.models(s), d.each(function(d) {
function C(t, n) {
d3.select(e.container).style("cursor", "ew-resize")
}
function M(e, t) {
R.x = d3.event.x, R.i = Math.round(O.invert(R.x)), P()
}
function N(t, n) {
d3.select(e.container).style("cursor", "auto"), A.index = R.i, x.stateChange(A)
}
function P() {
te.data([R]);
var t = e.duration();
e.duration(0), e.update(), e.duration(t)
}
var G = d3.select(this);
t.utils.initSVG(G), G.classed("nv-chart-" + w, !0);
var F = this,
U = t.utils.availableWidth(p, G, f),
V = t.utils.availableHeight(g, G, f);
if (e.update = function() {
0 === D ? G.call(e) : G.transition().duration(D).call(e)
}, e.container = this, A.setter(k(d), e.update).getter(L(d)).update(), A.disabled = d.map(function(e) {
return !!e.disabled
}), !T) {
var z;
T = {};
for (z in A) A[z] instanceof Array ? T[z] = A[z].slice(0) : T[z] = A[z]
}
var B = d3.behavior.drag().on("dragstart", C).on("drag", M).on("dragend", N);
if (!(d && d.length && d.filter(function(e) {
return e.values.length;
}).length)) return t.utils.noData(e, G), e;
if (G.selectAll(".nv-noData").remove(), r = i.xScale(), o = i.yScale(), _) i.yDomain(null);
else {
var $ = d.filter(function(e) {
return !e.disabled
}).map(function(e, t) {
var n = d3.extent(e.values, i.y());
return n[0] < -.95 && (n[0] = -.95), [(n[0] - n[1]) / (1 + n[1]), (n[1] - n[0]) / (1 + n[0])]
}),
W = [d3.min($, function(e) {
return e[0]
}), d3.max($, function(e) {
return e[1]
})];
i.yDomain(W)
}
O.domain([0, d[0].values.length - 1]).range([0, U]).clamp(!0);
var d = n(R.i, d),
H = S ? "none" : "all",
j = G.selectAll("g.nv-wrap.nv-cumulativeLine").data([d]),
Y = j.enter().append("g").attr("class", "nvd3 nv-wrap nv-cumulativeLine").append("g"),
q = j.select("g");
if (Y.append("g").attr("class", "nv-interactive"), Y.append("g").attr("class", "nv-x nv-axis").style("pointer-events", "none"), Y.append("g").attr("class", "nv-y nv-axis"), Y.append("g").attr("class", "nv-background"), Y.append("g").attr("class", "nv-linesWrap").style("pointer-events", H), Y.append("g").attr("class", "nv-avgLinesWrap").style("pointer-events", "none"), Y.append("g").attr("class", "nv-legendWrap"), Y.append("g").attr("class", "nv-controlsWrap"), v && (l.width(U), q.select(".nv-legendWrap").datum(d).call(l), f.top != l.height() && (f.top = l.height(), V = t.utils.availableHeight(g, G, f)), q.select(".nv-legendWrap").attr("transform", "translate(0," + -f.top + ")")), E) {
var K = [{
key: "Re-scale y-axis",
disabled: !_
}];
c.width(140).color(["#444", "#444", "#444"]).rightAlign(!1).margin({
top: 5,
right: 0,
bottom: 5,
left: 20
}), q.select(".nv-controlsWrap").datum(K).attr("transform", "translate(0," + -f.top + ")").call(c)
}
j.attr("transform", "translate(" + f.left + "," + f.top + ")"), b && q.select(".nv-y.nv-axis").attr("transform", "translate(" + U + ",0)");
var Z = d.filter(function(e) {
return e.tempDisabled
});
j.select(".tempDisabled").remove(), Z.length && j.append("text").attr("class", "tempDisabled").attr("x", U / 2).attr("y", "-.71em").style("text-anchor", "end").text(Z.map(function(e) {
return e.key
}).join(", ") + " values cannot be calculated for this time period."), S && (u.width(U).height(V).margin({
left: f.left,
top: f.top
}).svgContainer(G).xScale(r), j.select(".nv-interactive").call(u)), Y.select(".nv-background").append("rect"), q.select(".nv-background rect").attr("width", U).attr("height", V), i.y(function(e) {
return e.display.y
}).width(U).height(V).color(d.map(function(e, t) {
return e.color || m(e, t)
}).filter(function(e, t) {
return !d[t].disabled && !d[t].tempDisabled
}));
var Q = q.select(".nv-linesWrap").datum(d.filter(function(e) {
return !e.disabled && !e.tempDisabled
}));
Q.call(i), d.forEach(function(e, t) {
e.seriesIndex = t
});
var X = d.filter(function(e) {
return !e.disabled && !!I(e)
}),
J = q.select(".nv-avgLinesWrap").selectAll("line").data(X, function(e) {
return e.key
}),
ee = function(e) {
var t = o(I(e));
return t < 0 ? 0 : t > V ? V : t
};
J.enter().append("line").style("stroke-width", 2).style("stroke-dasharray", "10,10").style("stroke", function(e, t) {
return i.color()(e, e.seriesIndex)
}).attr("x1", 0).attr("x2", U).attr("y1", ee).attr("y2", ee), J.style("stroke-opacity", function(e) {
var t = o(I(e));
return t < 0 || t > V ? 0 : 1
}).attr("x1", 0).attr("x2", U).attr("y1", ee).attr("y2", ee), J.exit().remove();
var te = Q.selectAll(".nv-indexLine").data([R]);
te.enter().append("rect").attr("class", "nv-indexLine").attr("width", 3).attr("x", -2).attr("fill", "red").attr("fill-opacity", .5).style("pointer-events", "all").call(B), te.attr("transform", function(e) {
return "translate(" + O(e.i) + ",0)"
}).attr("height", V), h && (a.scale(r)._ticks(t.utils.calcTicksX(U / 70, d)).tickSize(-V, 0), q.select(".nv-x.nv-axis").attr("transform", "translate(0," + o.range()[0] + ")"), q.select(".nv-x.nv-axis").call(a)), y && (s.scale(o)._ticks(t.utils.calcTicksY(V / 36, d)).tickSize(-U, 0), q.select(".nv-y.nv-axis").call(s)), q.select(".nv-background rect").on("click", function() {
R.x = d3.mouse(this)[0], R.i = Math.round(O.invert(R.x)), A.index = R.i, x.stateChange(A), P()
}), i.dispatch.on("elementClick", function(e) {
R.i = e.pointIndex, R.x = O(R.i), A.index = R.i, x.stateChange(A), P()
}), c.dispatch.on("legendClick", function(t, n) {
t.disabled = !t.disabled, _ = !t.disabled, A.rescaleY = _, x.stateChange(A), e.update()
}), l.dispatch.on("stateChange", function(t) {
for (var n in t) A[n] = t[n];
x.stateChange(A), e.update()
}), u.dispatch.on("elementMousemove", function(n) {
i.clearHighlights();
var r, o, l, c = [];
if (d.filter(function(e, t) {
return e.seriesIndex = t, !e.disabled
}).forEach(function(a, s) {
o = t.interactiveBisect(a.values, n.pointXValue, e.x()), i.highlightPoint(s, o, !0);
var u = a.values[o];
"undefined" != typeof u && ("undefined" == typeof r && (r = u), "undefined" == typeof l && (l = e.xScale()(e.x()(u, o))), c.push({
key: a.key,
value: e.y()(u, o),
color: m(a, a.seriesIndex)
}))
}), c.length > 2) {
var p = e.yScale().invert(n.mouseY),
g = Math.abs(e.yScale().domain()[0] - e.yScale().domain()[1]),
v = .03 * g,
h = t.nearestValueIndex(c.map(function(e) {
return e.value
}), p, v);
null !== h && (c[h].highlight = !0)
}
var y = a.tickFormat()(e.x()(r, o), o);
u.tooltip.position({
left: l + f.left,
top: n.mouseY + f.top
}).chartContainer(F.parentNode).valueFormatter(function(e, t) {
return s.tickFormat()(e)
}).data({
value: y,
series: c
})(), u.renderGuideLine(l)
}), u.dispatch.on("elementMouseout", function(e) {
i.clearHighlights()
}), x.on("changeState", function(t) {
"undefined" != typeof t.disabled && (d.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), A.disabled = t.disabled), "undefined" != typeof t.index && (R.i = t.index, R.x = O(R.i), A.index = t.index, te.data([R])), "undefined" != typeof t.rescaleY && (_ = t.rescaleY), e.update()
})
}), N.renderEnd("cumulativeLineChart immediate"), e
}
function n(e, t) {
return P || (P = i.y()), t.map(function(t, n) {
if (!t.values) return t;
var r = t.values[e];
if (null == r) return t;
var o = P(r, e);
return o < -.95 && !M ? (t.tempDisabled = !0, t) : (t.tempDisabled = !1, t.values = t.values.map(function(e, t) {
return e.display = {
y: (P(e, t) - o) / (1 + o)
}, e
}), t)
})
}
var r, o, i = t.models.line(),
a = t.models.axis(),
s = t.models.axis(),
l = t.models.legend(),
c = t.models.legend(),
u = t.interactiveGuideline(),
d = t.models.tooltip(),
f = {
top: 30,
right: 30,
bottom: 50,
left: 60
},
m = t.utils.defaultColor(),
p = null,
g = null,
v = !0,
h = !0,
y = !0,
b = !1,
E = !0,
S = !1,
_ = !0,
w = i.id(),
A = t.utils.state(),
T = null,
C = null,
I = function(e) {
return e.average
},
x = d3.dispatch("stateChange", "changeState", "renderEnd"),
D = 250,
M = !1;
A.index = 0, A.rescaleY = _, a.orient("bottom").tickPadding(7), s.orient(b ? "right" : "left"), d.valueFormatter(function(e, t) {
return s.tickFormat()(e, t)
}).headerFormatter(function(e, t) {
return a.tickFormat()(e, t)
}), c.updateState(!1);
var O = d3.scale.linear(),
R = {
i: 0,
x: 0
},
N = t.utils.renderWatch(x, D),
L = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
}),
index: R.i,
rescaleY: _
}
}
},
k = function(e) {
return function(t) {
void 0 !== t.index && (R.i = t.index), void 0 !== t.rescaleY && (_ = t.rescaleY), void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
};
i.dispatch.on("elementMouseover.tooltip", function(t) {
var n = {
x: e.x()(t.point),
y: e.y()(t.point),
color: t.point.color
};
t.point = n, d.data(t).position(t.pos).hidden(!1)
}), i.dispatch.on("elementMouseout.tooltip", function(e) {
d.hidden(!0)
});
var P = null;
return e.dispatch = x, e.lines = i, e.legend = l, e.controls = c, e.xAxis = a, e.yAxis = s, e.interactiveLayer = u, e.state = A, e.tooltip = d, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
height: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
rescaleY: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
showControls: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
showLegend: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
average: {
get: function() {
return I
},
set: function(e) {
I = e
}
},
defaultState: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
noData: {
get: function() {
return C
},
set: function(e) {
C = e
}
},
showXAxis: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
showYAxis: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
noErrorCheck: {
get: function() {
return M
},
set: function(e) {
M = e
}
},
tooltips: {
get: function() {
return d.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), d.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return d.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), d.contentGenerator(e)
}
},
margin: {
get: function() {
return f
},
set: function(e) {
f.top = void 0 !== e.top ? e.top : f.top, f.right = void 0 !== e.right ? e.right : f.right, f.bottom = void 0 !== e.bottom ? e.bottom : f.bottom, f.left = void 0 !== e.left ? e.left : f.left
}
},
color: {
get: function() {
return m
},
set: function(e) {
m = t.utils.getColor(e), l.color(m)
}
},
useInteractiveGuideline: {
get: function() {
return S
},
set: function(t) {
S = t, t === !0 && (e.interactive(!1), e.useVoronoi(!1))
}
},
rightAlignYAxis: {
get: function() {
return b
},
set: function(e) {
b = e, s.orient(e ? "right" : "left")
}
},
duration: {
get: function() {
return D
},
set: function(e) {
D = e, i.duration(D), a.duration(D), s.duration(D), N.reset(D)
}
}
}), t.utils.inheritOptions(e, i), t.utils.initOptions(e), e
}, t.models.discreteBar = function() {
"use strict";
function e(f) {
return A.reset(), f.each(function(e) {
var f = u - c.left - c.right,
w = d - c.top - c.bottom;
n = d3.select(this), t.utils.initSVG(n), e.forEach(function(e, t) {
e.values.forEach(function(e) {
e.series = t
})
});
var T = r && o ? [] : e.map(function(e) {
return e.values.map(function(e, t) {
return {
x: g(e, t),
y: v(e, t),
y0: e.y0
}
})
});
m.domain(r || d3.merge(T).map(function(e) {
return e.x
})).rangeBands(i || [0, f], .1), p.domain(o || d3.extent(d3.merge(T).map(function(e) {
return e.y
}).concat(h))), b ? p.range(a || [w - (p.domain()[0] < 0 ? 12 : 0), p.domain()[1] > 0 ? 12 : 0]) : p.range(a || [w, 0]), s = s || m, l = l || p.copy().range([p(0), p(0)]);
var C = n.selectAll("g.nv-wrap.nv-discretebar").data([e]),
I = C.enter().append("g").attr("class", "nvd3 nv-wrap nv-discretebar"),
x = I.append("g");
C.select("g");
x.append("g").attr("class", "nv-groups"), C.attr("transform", "translate(" + c.left + "," + c.top + ")");
var D = C.select(".nv-groups").selectAll(".nv-group").data(function(e) {
return e
}, function(e) {
return e.key
});
D.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6), D.exit().watchTransition(A, "discreteBar: exit groups").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6).remove(), D.attr("class", function(e, t) {
return "nv-group nv-series-" + t
}).classed("hover", function(e) {
return e.hover
}), D.watchTransition(A, "discreteBar: groups").style("stroke-opacity", 1).style("fill-opacity", .75);
var M = D.selectAll("g.nv-bar").data(function(e) {
return e.values
});
M.exit().remove();
var O = M.enter().append("g").attr("transform", function(e, t, n) {
return "translate(" + (m(g(e, t)) + .05 * m.rangeBand()) + ", " + p(0) + ")"
}).on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0), S.elementMouseover({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1), S.elementMouseout({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("mousemove", function(e, t) {
S.elementMousemove({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("click", function(e, t) {
S.elementClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation()
}).on("dblclick", function(e, t) {
S.elementDblClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation()
});
O.append("rect").attr("height", 0).attr("width", .9 * m.rangeBand() / e.length), b ? (O.append("text").attr("text-anchor", "middle"), M.select("text").text(function(e, t) {
return E(v(e, t))
}).watchTransition(A, "discreteBar: bars text").attr("x", .9 * m.rangeBand() / 2).attr("y", function(e, t) {
return v(e, t) < 0 ? p(v(e, t)) - p(0) + 12 : -4
})) : M.selectAll("text").remove(), M.attr("class", function(e, t) {
return v(e, t) < 0 ? "nv-bar negative" : "nv-bar positive"
}).style("fill", function(e, t) {
return e.color || y(e, t)
}).style("stroke", function(e, t) {
return e.color || y(e, t)
}).select("rect").attr("class", _).watchTransition(A, "discreteBar: bars rect").attr("width", .9 * m.rangeBand() / e.length), M.watchTransition(A, "discreteBar: bars").attr("transform", function(e, t) {
var n = m(g(e, t)) + .05 * m.rangeBand(),
r = v(e, t) < 0 ? p(0) : p(0) - p(v(e, t)) < 1 ? p(0) - 1 : p(v(e, t));
return "translate(" + n + ", " + r + ")"
}).select("rect").attr("height", function(e, t) {
return Math.max(Math.abs(p(v(e, t)) - p(o && o[0] || 0)) || 1)
}), s = m.copy(), l = p.copy()
}), A.renderEnd("discreteBar immediate"), e
}
var n, r, o, i, a, s, l, c = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
u = 960,
d = 500,
f = Math.floor(1e4 * Math.random()),
m = d3.scale.ordinal(),
p = d3.scale.linear(),
g = function(e) {
return e.x
},
v = function(e) {
return e.y
},
h = [0],
y = t.utils.defaultColor(),
b = !1,
E = d3.format(",.2f"),
S = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"),
_ = "discreteBar",
w = 250,
A = t.utils.renderWatch(S, w);
return e.dispatch = S, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
height: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
forceY: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
showValues: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
x: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
y: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
xScale: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
yScale: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
xDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
yDomain: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
xRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
yRange: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
valueFormat: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
id: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
rectClass: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
margin: {
get: function() {
return c
},
set: function(e) {
c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left
}
},
color: {
get: function() {
return y
},
set: function(e) {
y = t.utils.getColor(e)
}
},
duration: {
get: function() {
return w
},
set: function(e) {
w = e, A.reset(w)
}
}
}), t.utils.initOptions(e), e
}, t.models.discreteBarChart = function() {
"use strict";
function e(s) {
return b.reset(), b.models(o), f && b.models(i), m && b.models(a), s.each(function(s) {
var d = d3.select(this);
t.utils.initSVG(d);
var v = t.utils.availableWidth(c, d, l),
b = t.utils.availableHeight(u, d, l);
if (e.update = function() {
h.beforeUpdate(), d.transition().duration(y).call(e)
}, e.container = this, !(s && s.length && s.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, d), e;
d.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale().clamp(!0);
var E = d.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]),
S = E.enter().append("g").attr("class", "nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),
_ = S.append("defs"),
w = E.select("g");
S.append("g").attr("class", "nv-x nv-axis"), S.append("g").attr("class", "nv-y nv-axis").append("g").attr("class", "nv-zeroLine").append("line"), S.append("g").attr("class", "nv-barsWrap"), w.attr("transform", "translate(" + l.left + "," + l.top + ")"), p && w.select(".nv-y.nv-axis").attr("transform", "translate(" + v + ",0)"), o.width(v).height(b);
var A = w.select(".nv-barsWrap").datum(s.filter(function(e) {
return !e.disabled
}));
if (A.transition().call(o), _.append("clipPath").attr("id", "nv-x-label-clip-" + o.id()).append("rect"), w.select("#nv-x-label-clip-" + o.id() + " rect").attr("width", n.rangeBand() * (g ? 2 : 1)).attr("height", 16).attr("x", -n.rangeBand() / (g ? 1 : 2)), f) {
i.scale(n)._ticks(t.utils.calcTicksX(v / 100, s)).tickSize(-b, 0), w.select(".nv-x.nv-axis").attr("transform", "translate(0," + (r.range()[0] + (o.showValues() && r.domain()[0] < 0 ? 16 : 0)) + ")"), w.select(".nv-x.nv-axis").call(i);
var T = w.select(".nv-x.nv-axis").selectAll("g");
g && T.selectAll("text").attr("transform", function(e, t, n) {
return "translate(0," + (n % 2 == 0 ? "5" : "17") + ")"
})
}
m && (a.scale(r)._ticks(t.utils.calcTicksY(b / 36, s)).tickSize(-v, 0), w.select(".nv-y.nv-axis").call(a)), w.select(".nv-zeroLine line").attr("x1", 0).attr("x2", v).attr("y1", r(0)).attr("y2", r(0))
}), b.renderEnd("discreteBar chart immediate"), e
}
var n, r, o = t.models.discreteBar(),
i = t.models.axis(),
a = t.models.axis(),
s = t.models.tooltip(),
l = {
top: 15,
right: 10,
bottom: 50,
left: 60
},
c = null,
u = null,
d = t.utils.getColor(),
f = !0,
m = !0,
p = !1,
g = !1,
v = null,
h = d3.dispatch("beforeUpdate", "renderEnd"),
y = 250;
i.orient("bottom").showMaxMin(!1).tickFormat(function(e) {
return e
}), a.orient(p ? "right" : "left").tickFormat(d3.format(",.1f")), s.duration(0).headerEnabled(!1).valueFormatter(function(e, t) {
return a.tickFormat()(e, t)
}).keyFormatter(function(e, t) {
return i.tickFormat()(e, t)
});
var b = t.utils.renderWatch(h, y);
return o.dispatch.on("elementMouseover.tooltip", function(t) {
t.series = {
key: e.x()(t.data),
value: e.y()(t.data),
color: t.color
}, s.data(t).hidden(!1)
}), o.dispatch.on("elementMouseout.tooltip", function(e) {
s.hidden(!0)
}), o.dispatch.on("elementMousemove.tooltip", function(e) {
s.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.dispatch = h, e.discretebar = o, e.xAxis = i, e.yAxis = a, e.tooltip = s, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
height: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
staggerLabels: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
showXAxis: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
showYAxis: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
noData: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
tooltips: {
get: function() {
return s.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), s.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return s.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), s.contentGenerator(e)
}
},
margin: {
get: function() {
return l
},
set: function(e) {
l.top = void 0 !== e.top ? e.top : l.top, l.right = void 0 !== e.right ? e.right : l.right, l.bottom = void 0 !== e.bottom ? e.bottom : l.bottom, l.left = void 0 !== e.left ? e.left : l.left
}
},
duration: {
get: function() {
return y
},
set: function(e) {
y = e, b.reset(y), o.duration(y), i.duration(y), a.duration(y)
}
},
color: {
get: function() {
return d
},
set: function(e) {
d = t.utils.getColor(e), o.color(d)
}
},
rightAlignYAxis: {
get: function() {
return p
},
set: function(e) {
p = e, a.orient(e ? "right" : "left")
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.distribution = function() {
"use strict";
function e(u) {
return f.reset(), u.each(function(e) {
var u = (o - ("x" === a ? r.left + r.right : r.top + r.bottom), "x" == a ? "y" : "x"),
d = d3.select(this);
t.utils.initSVG(d), n = n || c;
var m = d.selectAll("g.nv-distribution").data([e]),
p = m.enter().append("g").attr("class", "nvd3 nv-distribution"),
g = (p.append("g"), m.select("g"));
m.attr("transform", "translate(" + r.left + "," + r.top + ")");
var v = g.selectAll("g.nv-dist").data(function(e) {
return e
}, function(e) {
return e.key
});
v.enter().append("g"), v.attr("class", function(e, t) {
return "nv-dist nv-series-" + t
}).style("stroke", function(e, t) {
return l(e, t)
});
var h = v.selectAll("line.nv-dist" + a).data(function(e) {
return e.values
});
h.enter().append("line").attr(a + "1", function(e, t) {
return n(s(e, t))
}).attr(a + "2", function(e, t) {
return n(s(e, t))
}), f.transition(v.exit().selectAll("line.nv-dist" + a), "dist exit").attr(a + "1", function(e, t) {
return c(s(e, t))
}).attr(a + "2", function(e, t) {
return c(s(e, t))
}).style("stroke-opacity", 0).remove(), h.attr("class", function(e, t) {
return "nv-dist" + a + " nv-dist" + a + "-" + t
}).attr(u + "1", 0).attr(u + "2", i), f.transition(h, "dist").attr(a + "1", function(e, t) {
return c(s(e, t))
}).attr(a + "2", function(e, t) {
return c(s(e, t))
}), n = c.copy()
}), f.renderEnd("distribution immediate"), e
}
var n, r = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
o = 400,
i = 8,
a = "x",
s = function(e) {
return e[a]
},
l = t.utils.defaultColor(),
c = d3.scale.linear(),
u = 250,
d = d3.dispatch("renderEnd"),
f = t.utils.renderWatch(d, u);
return e.options = t.utils.optionsFunc.bind(e), e.dispatch = d, e.margin = function(t) {
return arguments.length ? (r.top = "undefined" != typeof t.top ? t.top : r.top, r.right = "undefined" != typeof t.right ? t.right : r.right, r.bottom = "undefined" != typeof t.bottom ? t.bottom : r.bottom, r.left = "undefined" != typeof t.left ? t.left : r.left, e) : r
}, e.width = function(t) {
return arguments.length ? (o = t, e) : o
}, e.axis = function(t) {
return arguments.length ? (a = t, e) : a
}, e.size = function(t) {
return arguments.length ? (i = t, e) : i
}, e.getData = function(t) {
return arguments.length ? (s = d3.functor(t), e) : s
}, e.scale = function(t) {
return arguments.length ? (c = t, e) : c
}, e.color = function(n) {
return arguments.length ? (l = t.utils.getColor(n), e) : l
}, e.duration = function(t) {
return arguments.length ? (u = t, f.reset(u), e) : u
}, e
}, t.models.furiousLegend = function() {
"use strict";
function e(g) {
function v(e, t) {
return "furious" != p ? "#000" : f ? e.disengaged ? a(e, t) : "#fff" : f ? void 0 : e.disabled ? a(e, t) : "#fff"
}
function h(e, t) {
return f && "furious" == p ? e.disengaged ? "#fff" : a(e, t) : e.disabled ? "#fff" : a(e, t)
}
return g.each(function(e) {
var g = r - n.left - n.right,
y = d3.select(this);
t.utils.initSVG(y);
var b = y.selectAll("g.nv-legend").data([e]),
E = (b.enter().append("g").attr("class", "nvd3 nv-legend").append("g"), b.select("g"));
b.attr("transform", "translate(" + n.left + "," + n.top + ")");
var S, _ = E.selectAll(".nv-series").data(function(e) {
return "furious" != p ? e : e.filter(function(e) {
return !!f || !e.disengaged
})
}),
w = _.enter().append("g").attr("class", "nv-series");
if ("classic" == p) w.append("circle").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("r", 5), S = _.select("circle");
else if ("furious" == p) {
w.append("rect").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("rx", 3).attr("ry", 3), S = _.select("rect"), w.append("g").attr("class", "nv-check-box").property("innerHTML", '
').attr("transform", "translate(-10,-8)scale(0.5)");
var A = _.select(".nv-check-box");
A.each(function(e, t) {
d3.select(this).selectAll("path").attr("stroke", v(e, t))
})
}
w.append("text").attr("text-anchor", "start").attr("class", "nv-legend-text").attr("dy", ".32em").attr("dx", "8");
var T = _.select("text.nv-legend-text");
_.on("mouseover", function(e, t) {
m.legendMouseover(e, t)
}).on("mouseout", function(e, t) {
m.legendMouseout(e, t)
}).on("click", function(e, t) {
m.legendClick(e, t);
var n = _.data();
if (u) {
if ("classic" == p) d ? (n.forEach(function(e) {
e.disabled = !0
}), e.disabled = !1) : (e.disabled = !e.disabled, n.every(function(e) {
return e.disabled
}) && n.forEach(function(e) {
e.disabled = !1
}));
else if ("furious" == p)
if (f) e.disengaged = !e.disengaged, e.userDisabled = void 0 == e.userDisabled ? !!e.disabled : e.userDisabled, e.disabled = e.disengaged || e.userDisabled;
else if (!f) {
e.disabled = !e.disabled, e.userDisabled = e.disabled;
var r = n.filter(function(e) {
return !e.disengaged
});
r.every(function(e) {
return e.userDisabled
}) && n.forEach(function(e) {
e.disabled = e.userDisabled = !1
})
}
m.stateChange({
disabled: n.map(function(e) {
return !!e.disabled
}),
disengaged: n.map(function(e) {
return !!e.disengaged
})
})
}
}).on("dblclick", function(e, t) {
if (("furious" != p || !f) && (m.legendDblclick(e, t), u)) {
var n = _.data();
n.forEach(function(e) {
e.disabled = !0, "furious" == p && (e.userDisabled = e.disabled)
}), e.disabled = !1, "furious" == p && (e.userDisabled = e.disabled), m.stateChange({
disabled: n.map(function(e) {
return !!e.disabled
})
})
}
}), _.classed("nv-disabled", function(e) {
return e.userDisabled
}), _.exit().remove(), T.attr("fill", v).text(i);
var C;
switch (p) {
case "furious":
C = 23;
break;
case "classic":
C = 20
}
if (s) {
var I = [];
_.each(function(e, n) {
var r, o = d3.select(this).select("text");
try {
if (r = o.node().getComputedTextLength(), r <= 0) throw Error()
} catch (e) {
r = t.utils.calcApproxTextWidth(o)
}
I.push(r + l)
});
for (var x = 0, D = 0, M = []; D < g && x < I.length;) M[x] = I[x], D += I[x++];
for (0 === x && (x = 1); D > g && x > 1;) {
M = [], x--;
for (var O = 0; O < I.length; O++) I[O] > (M[O % x] || 0) && (M[O % x] = I[O]);
D = M.reduce(function(e, t, n, r) {
return e + t
})
}
for (var R = [], N = 0, L = 0; N < x; N++) R[N] = L, L += M[N];
_.attr("transform", function(e, t) {
return "translate(" + R[t % x] + "," + (5 + Math.floor(t / x) * C) + ")"
}), c ? E.attr("transform", "translate(" + (r - n.right - D) + "," + n.top + ")") : E.attr("transform", "translate(0," + n.top + ")"), o = n.top + n.bottom + Math.ceil(I.length / x) * C
} else {
var k, P = 5,
G = 5,
F = 0;
_.attr("transform", function(e, t) {
var o = d3.select(this).select("text").node().getComputedTextLength() + l;
return k = G, r < n.left + n.right + k + o && (G = k = 5, P += C), G += o, G > F && (F = G), "translate(" + k + "," + P + ")"
}), E.attr("transform", "translate(" + (r - n.right - F) + "," + n.top + ")"), o = n.top + n.bottom + P + 15
}
"furious" == p && S.attr("width", function(e, t) {
return T[0][t].getComputedTextLength() + 27
}).attr("height", 18).attr("y", -9).attr("x", -15), S.style("fill", h).style("stroke", function(e, t) {
return e.color || a(e, t)
})
}), e
}
var n = {
top: 5,
right: 0,
bottom: 5,
left: 0
},
r = 400,
o = 20,
i = function(e) {
return e.key
},
a = t.utils.getColor(),
s = !0,
l = 28,
c = !0,
u = !0,
d = !1,
f = !1,
m = d3.dispatch("legendClick", "legendDblclick", "legendMouseover", "legendMouseout", "stateChange"),
p = "classic";
return e.dispatch = m, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
height: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
key: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
align: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
rightAlign: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
padding: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
updateState: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
radioButtonMode: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
expanded: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
vers: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
margin: {
get: function() {
return n
},
set: function(e) {
n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left
}
},
color: {
get: function() {
return a
},
set: function(e) {
a = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.historicalBar = function() {
"use strict";
function e(w) {
return w.each(function(e) {
_.reset(), u = d3.select(this);
var w = t.utils.availableWidth(s, u, a),
A = t.utils.availableHeight(l, u, a);
t.utils.initSVG(u), d.domain(n || d3.extent(e[0].values.map(m).concat(g))), h ? d.range(o || [.5 * w / e[0].values.length, w * (e[0].values.length - .5) / e[0].values.length]) : d.range(o || [0, w]), f.domain(r || d3.extent(e[0].values.map(p).concat(v))).range(i || [A, 0]), d.domain()[0] === d.domain()[1] && (d.domain()[0] ? d.domain([d.domain()[0] - .01 * d.domain()[0], d.domain()[1] + .01 * d.domain()[1]]) : d.domain([-1, 1])), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] + .01 * f.domain()[0], f.domain()[1] - .01 * f.domain()[1]]) : f.domain([-1, 1]));
var T = u.selectAll("g.nv-wrap.nv-historicalBar-" + c).data([e[0].values]),
C = T.enter().append("g").attr("class", "nvd3 nv-wrap nv-historicalBar-" + c),
I = C.append("defs"),
x = C.append("g"),
D = T.select("g");
x.append("g").attr("class", "nv-bars"), T.attr("transform", "translate(" + a.left + "," + a.top + ")"), u.on("click", function(e, t) {
E.chartClick({
data: e,
index: t,
pos: d3.event,
id: c
})
}), I.append("clipPath").attr("id", "nv-chart-clip-path-" + c).append("rect"), T.select("#nv-chart-clip-path-" + c + " rect").attr("width", w).attr("height", A), D.attr("clip-path", y ? "url(#nv-chart-clip-path-" + c + ")" : "");
var M = T.select(".nv-bars").selectAll(".nv-bar").data(function(e) {
return e
}, function(e, t) {
return m(e, t)
});
M.exit().remove(), M.enter().append("rect").attr("x", 0).attr("y", function(e, n) {
return t.utils.NaNtoZero(f(Math.max(0, p(e, n))))
}).attr("height", function(e, n) {
return t.utils.NaNtoZero(Math.abs(f(p(e, n)) - f(0)))
}).attr("transform", function(t, n) {
return "translate(" + (d(m(t, n)) - w / e[0].values.length * .45) + ",0)"
}).on("mouseover", function(e, t) {
S && (d3.select(this).classed("hover", !0), E.elementMouseover({
data: e,
index: t,
color: d3.select(this).style("fill")
}))
}).on("mouseout", function(e, t) {
S && (d3.select(this).classed("hover", !1), E.elementMouseout({
data: e,
index: t,
color: d3.select(this).style("fill")
}))
}).on("mousemove", function(e, t) {
S && E.elementMousemove({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("click", function(e, t) {
S && (E.elementClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation())
}).on("dblclick", function(e, t) {
S && (E.elementDblClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation())
}), M.attr("fill", function(e, t) {
return b(e, t)
}).attr("class", function(e, t, n) {
return (p(e, t) < 0 ? "nv-bar negative" : "nv-bar positive") + " nv-bar-" + n + "-" + t
}).watchTransition(_, "bars").attr("transform", function(t, n) {
return "translate(" + (d(m(t, n)) - w / e[0].values.length * .45) + ",0)"
}).attr("width", w / e[0].values.length * .9), M.watchTransition(_, "bars").attr("y", function(e, n) {
var r = p(e, n) < 0 ? f(0) : f(0) - f(p(e, n)) < 1 ? f(0) - 1 : f(p(e, n));
return t.utils.NaNtoZero(r)
}).attr("height", function(e, n) {
return t.utils.NaNtoZero(Math.max(Math.abs(f(p(e, n)) - f(0)), 1))
})
}), _.renderEnd("historicalBar immediate"), e
}
var n, r, o, i, a = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
s = null,
l = null,
c = Math.floor(1e4 * Math.random()),
u = null,
d = d3.scale.linear(),
f = d3.scale.linear(),
m = function(e) {
return e.x
},
p = function(e) {
return e.y
},
g = [],
v = [0],
h = !1,
y = !0,
b = t.utils.defaultColor(),
E = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"),
S = !0,
_ = t.utils.renderWatch(E, 0);
return e.highlightPoint = function(e, t) {
u.select(".nv-bars .nv-bar-0-" + e).classed("hover", t)
}, e.clearHighlights = function() {
u.select(".nv-bars .nv-bar.hover").classed("hover", !1)
}, e.dispatch = E, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
height: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
forceX: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
forceY: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
padData: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
x: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
y: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
xScale: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
yScale: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
xDomain: {
get: function() {
return n
},
set: function(e) {
n = e
}
},
yDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
xRange: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
yRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
clipEdge: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
id: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
interactive: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
margin: {
get: function() {
return a
},
set: function(e) {
a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left
}
},
color: {
get: function() {
return b
},
set: function(e) {
b = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.historicalBarChart = function(e) {
"use strict";
function n(e) {
return e.each(function(u) {
T.reset(), T.models(i), v && T.models(a), h && T.models(s);
var _ = d3.select(this),
C = this;
t.utils.initSVG(_);
var I = t.utils.availableWidth(m, _, d),
x = t.utils.availableHeight(p, _, d);
if (n.update = function() {
_.transition().duration(A).call(n)
}, n.container = this, E.disabled = u.map(function(e) {
return !!e.disabled
}), !S) {
var D;
S = {};
for (D in E) E[D] instanceof Array ? S[D] = E[D].slice(0) : S[D] = E[D]
}
if (!(u && u.length && u.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(n, _), n;
_.selectAll(".nv-noData").remove(), r = i.xScale(), o = i.yScale();
var M = _.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),
O = M.enter().append("g").attr("class", "nvd3 nv-wrap nv-historicalBarChart").append("g"),
R = M.select("g");
O.append("g").attr("class", "nv-x nv-axis"), O.append("g").attr("class", "nv-y nv-axis"), O.append("g").attr("class", "nv-barsWrap"), O.append("g").attr("class", "nv-legendWrap"), O.append("g").attr("class", "nv-interactive"), g && (l.width(I), R.select(".nv-legendWrap").datum(u).call(l), d.top != l.height() && (d.top = l.height(), x = t.utils.availableHeight(p, _, d)), M.select(".nv-legendWrap").attr("transform", "translate(0," + -d.top + ")")), M.attr("transform", "translate(" + d.left + "," + d.top + ")"), y && R.select(".nv-y.nv-axis").attr("transform", "translate(" + I + ",0)"), b && (c.width(I).height(x).margin({
left: d.left,
top: d.top
}).svgContainer(_).xScale(r), M.select(".nv-interactive").call(c)), i.width(I).height(x).color(u.map(function(e, t) {
return e.color || f(e, t)
}).filter(function(e, t) {
return !u[t].disabled
}));
var N = R.select(".nv-barsWrap").datum(u.filter(function(e) {
return !e.disabled
}));
N.transition().call(i), v && (a.scale(r)._ticks(t.utils.calcTicksX(I / 100, u)).tickSize(-x, 0), R.select(".nv-x.nv-axis").attr("transform", "translate(0," + o.range()[0] + ")"), R.select(".nv-x.nv-axis").transition().call(a)), h && (s.scale(o)._ticks(t.utils.calcTicksY(x / 36, u)).tickSize(-I, 0), R.select(".nv-y.nv-axis").transition().call(s)), c.dispatch.on("elementMousemove", function(e) {
i.clearHighlights();
var r, o, l, m = [];
u.filter(function(e, t) {
return e.seriesIndex = t, !e.disabled
}).forEach(function(a, s) {
o = t.interactiveBisect(a.values, e.pointXValue, n.x()), i.highlightPoint(o, !0);
var c = a.values[o];
void 0 !== c && (void 0 === r && (r = c),
void 0 === l && (l = n.xScale()(n.x()(c, o))), m.push({
key: a.key,
value: n.y()(c, o),
color: f(a, a.seriesIndex),
data: a.values[o]
}))
});
var p = a.tickFormat()(n.x()(r, o));
c.tooltip.position({
left: l + d.left,
top: e.mouseY + d.top
}).chartContainer(C.parentNode).valueFormatter(function(e, t) {
return s.tickFormat()(e)
}).data({
value: p,
index: o,
series: m
})(), c.renderGuideLine(l)
}), c.dispatch.on("elementMouseout", function(e) {
w.tooltipHide(), i.clearHighlights()
}), l.dispatch.on("legendClick", function(t, r) {
t.disabled = !t.disabled, u.filter(function(e) {
return !e.disabled
}).length || u.map(function(e) {
return e.disabled = !1, M.selectAll(".nv-series").classed("disabled", !1), e
}), E.disabled = u.map(function(e) {
return !!e.disabled
}), w.stateChange(E), e.transition().call(n)
}), l.dispatch.on("legendDblclick", function(e) {
u.forEach(function(e) {
e.disabled = !0
}), e.disabled = !1, E.disabled = u.map(function(e) {
return !!e.disabled
}), w.stateChange(E), n.update()
}), w.on("changeState", function(e) {
"undefined" != typeof e.disabled && (u.forEach(function(t, n) {
t.disabled = e.disabled[n]
}), E.disabled = e.disabled), n.update()
})
}), T.renderEnd("historicalBarChart immediate"), n
}
var r, o, i = e || t.models.historicalBar(),
a = t.models.axis(),
s = t.models.axis(),
l = t.models.legend(),
c = t.interactiveGuideline(),
u = t.models.tooltip(),
d = {
top: 30,
right: 90,
bottom: 50,
left: 90
},
f = t.utils.defaultColor(),
m = null,
p = null,
g = !1,
v = !0,
h = !0,
y = !1,
b = !1,
E = {},
S = null,
_ = null,
w = d3.dispatch("tooltipHide", "stateChange", "changeState", "renderEnd"),
A = 250;
a.orient("bottom").tickPadding(7), s.orient(y ? "right" : "left"), u.duration(0).headerEnabled(!1).valueFormatter(function(e, t) {
return s.tickFormat()(e, t)
}).headerFormatter(function(e, t) {
return a.tickFormat()(e, t)
});
var T = t.utils.renderWatch(w, 0);
return i.dispatch.on("elementMouseover.tooltip", function(e) {
e.series = {
key: n.x()(e.data),
value: n.y()(e.data),
color: e.color
}, u.data(e).hidden(!1)
}), i.dispatch.on("elementMouseout.tooltip", function(e) {
u.hidden(!0)
}), i.dispatch.on("elementMousemove.tooltip", function(e) {
u.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), n.dispatch = w, n.bars = i, n.legend = l, n.xAxis = a, n.yAxis = s, n.interactiveLayer = c, n.tooltip = u, n.options = t.utils.optionsFunc.bind(n), n._options = Object.create({}, {
width: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
height: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
showLegend: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
showXAxis: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
showYAxis: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
defaultState: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
noData: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
tooltips: {
get: function() {
return u.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), u.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return u.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), u.contentGenerator(e)
}
},
margin: {
get: function() {
return d
},
set: function(e) {
d.top = void 0 !== e.top ? e.top : d.top, d.right = void 0 !== e.right ? e.right : d.right, d.bottom = void 0 !== e.bottom ? e.bottom : d.bottom, d.left = void 0 !== e.left ? e.left : d.left
}
},
color: {
get: function() {
return f
},
set: function(e) {
f = t.utils.getColor(e), l.color(f), i.color(f)
}
},
duration: {
get: function() {
return A
},
set: function(e) {
A = e, T.reset(A), s.duration(A), a.duration(A)
}
},
rightAlignYAxis: {
get: function() {
return y
},
set: function(e) {
y = e, s.orient(e ? "right" : "left")
}
},
useInteractiveGuideline: {
get: function() {
return b
},
set: function(e) {
b = e, e === !0 && n.interactive(!1)
}
}
}), t.utils.inheritOptions(n, i), t.utils.initOptions(n), n
}, t.models.ohlcBarChart = function() {
var e = t.models.historicalBarChart(t.models.ohlcBar());
return e.useInteractiveGuideline(!0), e.interactiveLayer.tooltip.contentGenerator(function(t) {
var n = t.series[0].data,
r = n.open < n.close ? "2ca02c" : "d62728";
return '
' + t.value + "
| open: | " + e.yAxis.tickFormat()(n.open) + " |
| close: | " + e.yAxis.tickFormat()(n.close) + " |
| high | " + e.yAxis.tickFormat()(n.high) + " |
| low: | " + e.yAxis.tickFormat()(n.low) + " |
"
}), e
}, t.models.candlestickBarChart = function() {
var e = t.models.historicalBarChart(t.models.candlestickBar());
return e.useInteractiveGuideline(!0), e.interactiveLayer.tooltip.contentGenerator(function(t) {
var n = t.series[0].data,
r = n.open < n.close ? "2ca02c" : "d62728";
return '
' + t.value + "
| open: | " + e.yAxis.tickFormat()(n.open) + " |
| close: | " + e.yAxis.tickFormat()(n.close) + " |
| high | " + e.yAxis.tickFormat()(n.high) + " |
| low: | " + e.yAxis.tickFormat()(n.low) + " |
"
}), e
}, t.models.legend = function() {
"use strict";
function e(g) {
function v(e, t) {
return "furious" != p ? "#000" : f ? e.disengaged ? "#000" : "#fff" : f ? void 0 : (e.color || (e.color = a(e, t)), e.disabled ? e.color : "#fff")
}
function h(e, t) {
return f && "furious" == p && e.disengaged ? "#eee" : e.color || a(e, t)
}
function y(e, t) {
return f && "furious" == p ? 1 : e.disabled ? 0 : 1
}
return g.each(function(e) {
var a = r - n.left - n.right,
g = d3.select(this);
t.utils.initSVG(g);
var b = g.selectAll("g.nv-legend").data([e]),
E = b.enter().append("g").attr("class", "nvd3 nv-legend").append("g"),
S = b.select("g");
b.attr("transform", "translate(" + n.left + "," + n.top + ")");
var _, w, A = S.selectAll(".nv-series").data(function(e) {
return "furious" != p ? e : e.filter(function(e) {
return !!f || !e.disengaged
})
}),
T = A.enter().append("g").attr("class", "nv-series");
switch (p) {
case "furious":
w = 23;
break;
case "classic":
w = 20
}
if ("classic" == p) T.append("circle").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("r", 5), _ = A.select("circle");
else if ("furious" == p) {
T.append("rect").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("rx", 3).attr("ry", 3), _ = A.select(".nv-legend-symbol"), T.append("g").attr("class", "nv-check-box").property("innerHTML", '
').attr("transform", "translate(-10,-8)scale(0.5)");
var C = A.select(".nv-check-box");
C.each(function(e, t) {
d3.select(this).selectAll("path").attr("stroke", v(e, t))
})
}
T.append("text").attr("text-anchor", "start").attr("class", "nv-legend-text").attr("dy", ".32em").attr("dx", "8");
var I = A.select("text.nv-legend-text");
A.on("mouseover", function(e, t) {
m.legendMouseover(e, t)
}).on("mouseout", function(e, t) {
m.legendMouseout(e, t)
}).on("click", function(e, t) {
m.legendClick(e, t);
var n = A.data();
if (u) {
if ("classic" == p) d ? (n.forEach(function(e) {
e.disabled = !0
}), e.disabled = !1) : (e.disabled = !e.disabled, n.every(function(e) {
return e.disabled
}) && n.forEach(function(e) {
e.disabled = !1
}));
else if ("furious" == p)
if (f) e.disengaged = !e.disengaged, e.userDisabled = void 0 == e.userDisabled ? !!e.disabled : e.userDisabled, e.disabled = e.disengaged || e.userDisabled;
else if (!f) {
e.disabled = !e.disabled, e.userDisabled = e.disabled;
var r = n.filter(function(e) {
return !e.disengaged
});
r.every(function(e) {
return e.userDisabled
}) && n.forEach(function(e) {
e.disabled = e.userDisabled = !1
})
}
m.stateChange({
disabled: n.map(function(e) {
return !!e.disabled
}),
disengaged: n.map(function(e) {
return !!e.disengaged
})
})
}
}).on("dblclick", function(e, t) {
if (("furious" != p || !f) && (m.legendDblclick(e, t), u)) {
var n = A.data();
n.forEach(function(e) {
e.disabled = !0, "furious" == p && (e.userDisabled = e.disabled)
}), e.disabled = !1, "furious" == p && (e.userDisabled = e.disabled), m.stateChange({
disabled: n.map(function(e) {
return !!e.disabled
})
})
}
}), A.classed("nv-disabled", function(e) {
return e.userDisabled
}), A.exit().remove(), I.attr("fill", v).text(i);
var x = 0;
if (s) {
var D = [];
A.each(function(e, n) {
var r, o = d3.select(this).select("text");
try {
if (r = o.node().getComputedTextLength(), r <= 0) throw Error()
} catch (e) {
r = t.utils.calcApproxTextWidth(o)
}
D.push(r + l)
});
var M = 0,
O = [];
for (x = 0; x < a && M < D.length;) O[M] = D[M], x += D[M++];
for (0 === M && (M = 1); x > a && M > 1;) {
O = [], M--;
for (var R = 0; R < D.length; R++) D[R] > (O[R % M] || 0) && (O[R % M] = D[R]);
x = O.reduce(function(e, t, n, r) {
return e + t
})
}
for (var N = [], L = 0, k = 0; L < M; L++) N[L] = k, k += O[L];
A.attr("transform", function(e, t) {
return "translate(" + N[t % M] + "," + (5 + Math.floor(t / M) * w) + ")"
}), c ? S.attr("transform", "translate(" + (r - n.right - x) + "," + n.top + ")") : S.attr("transform", "translate(0," + n.top + ")"), o = n.top + n.bottom + Math.ceil(D.length / M) * w
} else {
var P, G = 5,
F = 5,
U = 0;
A.attr("transform", function(e, t) {
var o = d3.select(this).select("text").node().getComputedTextLength() + l;
return P = F, r < n.left + n.right + P + o && (F = P = 5, G += w), F += o, F > U && (U = F), x < P + U && (x = P + U), "translate(" + P + "," + G + ")"
}), S.attr("transform", "translate(" + (r - n.right - U) + "," + n.top + ")"), o = n.top + n.bottom + G + 15
}
if ("furious" == p) {
_.attr("width", function(e, t) {
return I[0][t].getComputedTextLength() + 27
}).attr("height", 18).attr("y", -9).attr("x", -15), E.insert("rect", ":first-child").attr("class", "nv-legend-bg").attr("fill", "#eee").attr("opacity", 0);
var V = S.select(".nv-legend-bg");
V.transition().duration(300).attr("x", -w).attr("width", x + w - 12).attr("height", o + 10).attr("y", -n.top - 10).attr("opacity", f ? 1 : 0)
}
_.style("fill", h).style("fill-opacity", y).style("stroke", h)
}), e
}
var n = {
top: 5,
right: 0,
bottom: 5,
left: 0
},
r = 400,
o = 20,
i = function(e) {
return e.key
},
a = t.utils.getColor(),
s = !0,
l = 32,
c = !0,
u = !0,
d = !1,
f = !1,
m = d3.dispatch("legendClick", "legendDblclick", "legendMouseover", "legendMouseout", "stateChange"),
p = "classic";
return e.dispatch = m, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
height: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
key: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
align: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
rightAlign: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
padding: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
updateState: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
radioButtonMode: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
expanded: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
vers: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
margin: {
get: function() {
return n
},
set: function(e) {
n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left
}
},
color: {
get: function() {
return a
},
set: function(e) {
a = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.line = function() {
"use strict";
function e(h) {
return S.reset(), S.models(o), h.each(function(e) {
l = d3.select(this);
var h = t.utils.availableWidth(a, l, i),
y = t.utils.availableHeight(s, l, i);
t.utils.initSVG(l), n = o.xScale(), r = o.yScale(), b = b || n, E = E || r;
var _ = l.selectAll("g.nv-wrap.nv-line").data([e]),
w = _.enter().append("g").attr("class", "nvd3 nv-wrap nv-line"),
A = w.append("defs"),
T = w.append("g"),
C = _.select("g");
T.append("g").attr("class", "nv-groups"), T.append("g").attr("class", "nv-scatterWrap"), _.attr("transform", "translate(" + i.left + "," + i.top + ")"), o.width(h).height(y);
var I = _.select(".nv-scatterWrap");
I.call(o), A.append("clipPath").attr("id", "nv-edge-clip-" + o.id()).append("rect"), _.select("#nv-edge-clip-" + o.id() + " rect").attr("width", h).attr("height", y > 0 ? y : 0), C.attr("clip-path", g ? "url(#nv-edge-clip-" + o.id() + ")" : ""), I.attr("clip-path", g ? "url(#nv-edge-clip-" + o.id() + ")" : "");
var x = _.select(".nv-groups").selectAll(".nv-group").data(function(e) {
return e
}, function(e) {
return e.key
});
x.enter().append("g").style("stroke-opacity", 1e-6).style("stroke-width", function(e) {
return e.strokeWidth || c
}).style("fill-opacity", 1e-6), x.exit().remove(), x.attr("class", function(e, t) {
return (e.classed || "") + " nv-group nv-series-" + t
}).classed("hover", function(e) {
return e.hover
}).style("fill", function(e, t) {
return u(e, t)
}).style("stroke", function(e, t) {
return u(e, t)
}), x.watchTransition(S, "line: groups").style("stroke-opacity", 1).style("fill-opacity", function(e) {
return e.fillOpacity || .5
});
var D = x.selectAll("path.nv-area").data(function(e) {
return p(e) ? [e] : []
});
D.enter().append("path").attr("class", "nv-area").attr("d", function(e) {
return d3.svg.area().interpolate(v).defined(m).x(function(e, n) {
return t.utils.NaNtoZero(b(d(e, n)))
}).y0(function(e, n) {
return t.utils.NaNtoZero(E(f(e, n)))
}).y1(function(e, t) {
return E(r.domain()[0] <= 0 ? r.domain()[1] >= 0 ? 0 : r.domain()[1] : r.domain()[0])
}).apply(this, [e.values])
}), x.exit().selectAll("path.nv-area").remove(), D.watchTransition(S, "line: areaPaths").attr("d", function(e) {
return d3.svg.area().interpolate(v).defined(m).x(function(e, r) {
return t.utils.NaNtoZero(n(d(e, r)))
}).y0(function(e, n) {
return t.utils.NaNtoZero(r(f(e, n)))
}).y1(function(e, t) {
return r(r.domain()[0] <= 0 ? r.domain()[1] >= 0 ? 0 : r.domain()[1] : r.domain()[0])
}).apply(this, [e.values])
});
var M = x.selectAll("path.nv-line").data(function(e) {
return [e.values]
});
M.enter().append("path").attr("class", "nv-line").attr("d", d3.svg.line().interpolate(v).defined(m).x(function(e, n) {
return t.utils.NaNtoZero(b(d(e, n)))
}).y(function(e, n) {
return t.utils.NaNtoZero(E(f(e, n)))
})), M.watchTransition(S, "line: linePaths").attr("d", d3.svg.line().interpolate(v).defined(m).x(function(e, r) {
return t.utils.NaNtoZero(n(d(e, r)))
}).y(function(e, n) {
return t.utils.NaNtoZero(r(f(e, n)))
})), b = n.copy(), E = r.copy()
}), S.renderEnd("line immediate"), e
}
var n, r, o = t.models.scatter(),
i = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
a = 960,
s = 500,
l = null,
c = 1.5,
u = t.utils.defaultColor(),
d = function(e) {
return e.x
},
f = function(e) {
return e.y
},
m = function(e, t) {
return !isNaN(f(e, t)) && null !== f(e, t)
},
p = function(e) {
return e.area
},
g = !1,
v = "linear",
h = 250,
y = d3.dispatch("elementClick", "elementMouseover", "elementMouseout", "renderEnd");
o.pointSize(16).pointDomain([16, 256]);
var b, E, S = t.utils.renderWatch(y, h);
return e.dispatch = y, e.scatter = o, o.dispatch.on("elementClick", function() {
y.elementClick.apply(this, arguments)
}), o.dispatch.on("elementMouseover", function() {
y.elementMouseover.apply(this, arguments)
}), o.dispatch.on("elementMouseout", function() {
y.elementMouseout.apply(this, arguments)
}), e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
height: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
defined: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
interpolate: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
clipEdge: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
margin: {
get: function() {
return i
},
set: function(e) {
i.top = void 0 !== e.top ? e.top : i.top, i.right = void 0 !== e.right ? e.right : i.right, i.bottom = void 0 !== e.bottom ? e.bottom : i.bottom, i.left = void 0 !== e.left ? e.left : i.left
}
},
duration: {
get: function() {
return h
},
set: function(e) {
h = e, S.reset(h), o.duration(h)
}
},
isArea: {
get: function() {
return p
},
set: function(e) {
p = d3.functor(e)
}
},
x: {
get: function() {
return d
},
set: function(e) {
d = e, o.x(e)
}
},
y: {
get: function() {
return f
},
set: function(e) {
f = e, o.y(e)
}
},
color: {
get: function() {
return u
},
set: function(e) {
u = t.utils.getColor(e), o.color(u)
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.lineChart = function() {
"use strict";
function e(c) {
return A.reset(), A.models(o), g && A.models(i), v && A.models(a), c.each(function(c) {
var S = d3.select(this),
A = this;
t.utils.initSVG(S);
var I = t.utils.availableWidth(f, S, u),
x = t.utils.availableHeight(m, S, u);
if (e.update = function() {
0 === w ? S.call(e) : S.transition().duration(w).call(e)
}, e.container = this, b.setter(C(c), e.update).getter(T(c)).update(), b.disabled = c.map(function(e) {
return !!e.disabled
}), !E) {
var D;
E = {};
for (D in b) b[D] instanceof Array ? E[D] = b[D].slice(0) : E[D] = b[D]
}
if (!(c && c.length && c.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, S), e;
S.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale();
var M = S.selectAll("g.nv-wrap.nv-lineChart").data([c]),
O = M.enter().append("g").attr("class", "nvd3 nv-wrap nv-lineChart").append("g"),
R = M.select("g");
O.append("rect").style("opacity", 0), O.append("g").attr("class", "nv-x nv-axis"), O.append("g").attr("class", "nv-y nv-axis"), O.append("g").attr("class", "nv-linesWrap"), O.append("g").attr("class", "nv-legendWrap"), O.append("g").attr("class", "nv-interactive"), R.select("rect").attr("width", I).attr("height", x > 0 ? x : 0), p && (s.width(I), R.select(".nv-legendWrap").datum(c).call(s), u.top != s.height() && (u.top = s.height(), x = t.utils.availableHeight(m, S, u)), M.select(".nv-legendWrap").attr("transform", "translate(0," + -u.top + ")")), M.attr("transform", "translate(" + u.left + "," + u.top + ")"), h && R.select(".nv-y.nv-axis").attr("transform", "translate(" + I + ",0)"), y && (l.width(I).height(x).margin({
left: u.left,
top: u.top
}).svgContainer(S).xScale(n), M.select(".nv-interactive").call(l)), o.width(I).height(x).color(c.map(function(e, t) {
return e.color || d(e, t)
}).filter(function(e, t) {
return !c[t].disabled
}));
var N = R.select(".nv-linesWrap").datum(c.filter(function(e) {
return !e.disabled
}));
N.call(o), g && (i.scale(n)._ticks(t.utils.calcTicksX(I / 100, c)).tickSize(-x, 0), R.select(".nv-x.nv-axis").attr("transform", "translate(0," + r.range()[0] + ")"), R.select(".nv-x.nv-axis").call(i)), v && (a.scale(r)._ticks(t.utils.calcTicksY(x / 36, c)).tickSize(-I, 0), R.select(".nv-y.nv-axis").call(a)), s.dispatch.on("stateChange", function(t) {
for (var n in t) b[n] = t[n];
_.stateChange(b), e.update()
}), l.dispatch.on("elementMousemove", function(n) {
o.clearHighlights();
var r, s, f, m = [];
if (c.filter(function(e, t) {
return e.seriesIndex = t, !e.disabled
}).forEach(function(i, a) {
s = t.interactiveBisect(i.values, n.pointXValue, e.x());
var l = i.values[s],
c = e.y()(l, s);
null != c && o.highlightPoint(a, s, !0), void 0 !== l && (void 0 === r && (r = l), void 0 === f && (f = e.xScale()(e.x()(l, s))), m.push({
key: i.key,
value: c,
color: d(i, i.seriesIndex)
}))
}), m.length > 2) {
var p = e.yScale().invert(n.mouseY),
g = Math.abs(e.yScale().domain()[0] - e.yScale().domain()[1]),
v = .03 * g,
h = t.nearestValueIndex(m.map(function(e) {
return e.value
}), p, v);
null !== h && (m[h].highlight = !0)
}
var y = i.tickFormat()(e.x()(r, s));
l.tooltip.position({
left: n.mouseX + u.left,
top: n.mouseY + u.top
}).chartContainer(A.parentNode).valueFormatter(function(e, t) {
return null == e ? "N/A" : a.tickFormat()(e)
}).data({
value: y,
index: s,
series: m
})(), l.renderGuideLine(f)
}), l.dispatch.on("elementClick", function(n) {
var r, i = [];
c.filter(function(e, t) {
return e.seriesIndex = t, !e.disabled
}).forEach(function(o) {
var a = t.interactiveBisect(o.values, n.pointXValue, e.x()),
s = o.values[a];
if ("undefined" != typeof s) {
"undefined" == typeof r && (r = e.xScale()(e.x()(s, a)));
var l = e.yScale()(e.y()(s, a));
i.push({
point: s,
pointIndex: a,
pos: [r, l],
seriesIndex: o.seriesIndex,
series: o
})
}
}), o.dispatch.elementClick(i)
}), l.dispatch.on("elementMouseout", function(e) {
o.clearHighlights()
}), _.on("changeState", function(t) {
"undefined" != typeof t.disabled && c.length === t.disabled.length && (c.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), b.disabled = t.disabled), e.update()
})
}), A.renderEnd("lineChart immediate"), e
}
var n, r, o = t.models.line(),
i = t.models.axis(),
a = t.models.axis(),
s = t.models.legend(),
l = t.interactiveGuideline(),
c = t.models.tooltip(),
u = {
top: 30,
right: 20,
bottom: 50,
left: 60
},
d = t.utils.defaultColor(),
f = null,
m = null,
p = !0,
g = !0,
v = !0,
h = !1,
y = !1,
b = t.utils.state(),
E = null,
S = null,
_ = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd"),
w = 250;
i.orient("bottom").tickPadding(7), a.orient(h ? "right" : "left"), c.valueFormatter(function(e, t) {
return a.tickFormat()(e, t)
}).headerFormatter(function(e, t) {
return i.tickFormat()(e, t)
});
var A = t.utils.renderWatch(_, w),
T = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
})
}
}
},
C = function(e) {
return function(t) {
void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
};
return o.dispatch.on("elementMouseover.tooltip", function(e) {
c.data(e).position(e.pos).hidden(!1)
}), o.dispatch.on("elementMouseout.tooltip", function(e) {
c.hidden(!0)
}), e.dispatch = _, e.lines = o, e.legend = s, e.xAxis = i, e.yAxis = a, e.interactiveLayer = l, e.tooltip = c, e.dispatch = _, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
height: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
showLegend: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
showXAxis: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
showYAxis: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
defaultState: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
noData: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
tooltips: {
get: function() {
return c.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), c.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return c.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), c.contentGenerator(e)
}
},
margin: {
get: function() {
return u
},
set: function(e) {
u.top = void 0 !== e.top ? e.top : u.top, u.right = void 0 !== e.right ? e.right : u.right, u.bottom = void 0 !== e.bottom ? e.bottom : u.bottom, u.left = void 0 !== e.left ? e.left : u.left
}
},
duration: {
get: function() {
return w
},
set: function(e) {
w = e, A.reset(w), o.duration(w), i.duration(w), a.duration(w)
}
},
color: {
get: function() {
return d
},
set: function(e) {
d = t.utils.getColor(e), s.color(d), o.color(d)
}
},
rightAlignYAxis: {
get: function() {
return h
},
set: function(e) {
h = e, a.orient(h ? "right" : "left")
}
},
useInteractiveGuideline: {
get: function() {
return y
},
set: function(e) {
y = e, y && (o.interactive(!1), o.useVoronoi(!1))
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.linePlusBarChart = function() {
"use strict";
function e(S) {
return S.each(function(S) {
function k(e) {
var t = +("e" == e),
n = t ? 1 : -1,
r = K / 3;
return "M" + .5 * n + "," + r + "A6,6 0 0 " + t + " " + 6.5 * n + "," + (r + 6) + "V" + (2 * r - 6) + "A6,6 0 0 " + t + " " + .5 * n + "," + 2 * r + "ZM" + 2.5 * n + "," + (r + 8) + "V" + (2 * r - 8) + "M" + 4.5 * n + "," + (r + 8) + "V" + (2 * r - 8)
}
function W() {
E.empty() || E.extent(L), ue.data([E.empty() ? o.domain() : L]).each(function(e, t) {
var n = o(e[0]) - o.range()[0],
r = o.range()[1] - o(e[1]);
d3.select(this).select(".left").attr("width", n < 0 ? 0 : n), d3.select(this).select(".right").attr("x", o(e[1])).attr("width", r < 0 ? 0 : r)
})
}
function H() {
L = E.empty() ? null : E.extent(), n = E.empty() ? o.domain() : E.extent(), P.brush({
extent: n,
brush: E
}), W(), d.width(Y).height(q).color(S.map(function(e, t) {
return e.color || x(e, t)
}).filter(function(e, t) {
return !S[t].disabled && S[t].bar
})), c.width(Y).height(q).color(S.map(function(e, t) {
return e.color || x(e, t)
}).filter(function(e, t) {
return !S[t].disabled && !S[t].bar
}));
var e = re.select(".nv-focus .nv-barsWrap").datum(Q.length ? Q.map(function(e, t) {
return {
key: e.key,
values: e.values.filter(function(e, t) {
return d.x()(e, t) >= n[0] && d.x()(e, t) <= n[1]
})
}
}) : [{
values: []
}]),
s = re.select(".nv-focus .nv-linesWrap").datum(X[0].disabled ? [{
values: []
}] : X.map(function(e, t) {
return {
area: e.area,
fillOpacity: e.fillOpacity,
key: e.key,
values: e.values.filter(function(e, t) {
return c.x()(e, t) >= n[0] && c.x()(e, t) <= n[1]
})
}
}));
r = Q.length ? d.xScale() : c.xScale(), m.scale(r)._ticks(t.utils.calcTicksX(Y / 100, S)).tickSize(-q, 0), m.domain([Math.ceil(n[0]), Math.floor(n[1])]), re.select(".nv-x.nv-axis").transition().duration(G).call(m), e.transition().duration(G).call(d), s.transition().duration(G).call(c), re.select(".nv-focus .nv-x.nv-axis").attr("transform", "translate(0," + i.range()[0] + ")"), g.scale(i)._ticks(t.utils.calcTicksY(q / 36, S)).tickSize(-Y, 0), v.scale(a)._ticks(t.utils.calcTicksY(q / 36, S)).tickSize(Q.length ? 0 : -Y, 0), re.select(".nv-focus .nv-y1.nv-axis").style("opacity", Q.length ? 1 : 0), re.select(".nv-focus .nv-y2.nv-axis").style("opacity", X.length && !X[0].disabled ? 1 : 0).attr("transform", "translate(" + r.range()[1] + ",0)"), re.select(".nv-focus .nv-y1.nv-axis").transition().duration(G).call(g), re.select(".nv-focus .nv-y2.nv-axis").transition().duration(G).call(v)
}
var j = d3.select(this);
t.utils.initSVG(j);
var Y = t.utils.availableWidth(A, j, _),
q = t.utils.availableHeight(T, j, _) - (M ? N : 0),
K = N - w.top - w.bottom;
if (e.update = function() {
j.transition().duration(G).call(e)
}, e.container = this, F.setter($(S), e.update).getter(B(S)).update(), F.disabled = S.map(function(e) {
return !!e.disabled
}), !U) {
var Z;
U = {};
for (Z in F) F[Z] instanceof Array ? U[Z] = F[Z].slice(0) : U[Z] = F[Z]
}
if (!(S && S.length && S.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, j), e;
j.selectAll(".nv-noData").remove();
var Q = S.filter(function(e) {
return !e.disabled && e.bar
}),
X = S.filter(function(e) {
return !e.bar
});
r = d.xScale(), o = p.scale(), i = d.yScale(), a = c.yScale(), s = f.yScale(), l = u.yScale();
var J = S.filter(function(e) {
return !e.disabled && e.bar
}).map(function(e) {
return e.values.map(function(e, t) {
return {
x: C(e, t),
y: I(e, t)
}
})
}),
ee = S.filter(function(e) {
return !e.disabled && !e.bar
}).map(function(e) {
return e.values.map(function(e, t) {
return {
x: C(e, t),
y: I(e, t)
}
})
});
r.range([0, Y]), o.domain(d3.extent(d3.merge(J.concat(ee)), function(e) {
return e.x
})).range([0, Y]);
var te = j.selectAll("g.nv-wrap.nv-linePlusBar").data([S]),
ne = te.enter().append("g").attr("class", "nvd3 nv-wrap nv-linePlusBar").append("g"),
re = te.select("g");
ne.append("g").attr("class", "nv-legendWrap");
var oe = ne.append("g").attr("class", "nv-focus");
oe.append("g").attr("class", "nv-x nv-axis"), oe.append("g").attr("class", "nv-y1 nv-axis"), oe.append("g").attr("class", "nv-y2 nv-axis"), oe.append("g").attr("class", "nv-barsWrap"), oe.append("g").attr("class", "nv-linesWrap");
var ie = ne.append("g").attr("class", "nv-context");
if (ie.append("g").attr("class", "nv-x nv-axis"), ie.append("g").attr("class", "nv-y1 nv-axis"), ie.append("g").attr("class", "nv-y2 nv-axis"), ie.append("g").attr("class", "nv-barsWrap"), ie.append("g").attr("class", "nv-linesWrap"), ie.append("g").attr("class", "nv-brushBackground"), ie.append("g").attr("class", "nv-x nv-brush"), D) {
var ae = b.align() ? Y / 2 : Y,
se = b.align() ? ae : 0;
b.width(ae), re.select(".nv-legendWrap").datum(S.map(function(e) {
return e.originalKey = void 0 === e.originalKey ? e.key : e.originalKey, e.key = e.originalKey + (e.bar ? V : z), e
})).call(b), _.top != b.height() && (_.top = b.height(), q = t.utils.availableHeight(T, j, _) - N), re.select(".nv-legendWrap").attr("transform", "translate(" + se + "," + -_.top + ")")
}
te.attr("transform", "translate(" + _.left + "," + _.top + ")"), re.select(".nv-context").style("display", M ? "initial" : "none"), f.width(Y).height(K).color(S.map(function(e, t) {
return e.color || x(e, t)
}).filter(function(e, t) {
return !S[t].disabled && S[t].bar
})), u.width(Y).height(K).color(S.map(function(e, t) {
return e.color || x(e, t)
}).filter(function(e, t) {
return !S[t].disabled && !S[t].bar
}));
var le = re.select(".nv-context .nv-barsWrap").datum(Q.length ? Q : [{
values: []
}]),
ce = re.select(".nv-context .nv-linesWrap").datum(X[0].disabled ? [{
values: []
}] : X);
re.select(".nv-context").attr("transform", "translate(0," + (q + _.bottom + w.top) + ")"), le.transition().call(f), ce.transition().call(u), R && (p._ticks(t.utils.calcTicksX(Y / 100, S)).tickSize(-K, 0), re.select(".nv-context .nv-x.nv-axis").attr("transform", "translate(0," + s.range()[0] + ")"), re.select(".nv-context .nv-x.nv-axis").transition().call(p)), O && (h.scale(s)._ticks(K / 36).tickSize(-Y, 0), y.scale(l)._ticks(K / 36).tickSize(Q.length ? 0 : -Y, 0), re.select(".nv-context .nv-y3.nv-axis").style("opacity", Q.length ? 1 : 0).attr("transform", "translate(0," + o.range()[0] + ")"), re.select(".nv-context .nv-y2.nv-axis").style("opacity", X.length ? 1 : 0).attr("transform", "translate(" + o.range()[1] + ",0)"), re.select(".nv-context .nv-y1.nv-axis").transition().call(h), re.select(".nv-context .nv-y2.nv-axis").transition().call(y)), E.x(o).on("brush", H), L && E.extent(L);
var ue = re.select(".nv-brushBackground").selectAll("g").data([L || E.extent()]),
de = ue.enter().append("g");
de.append("rect").attr("class", "left").attr("x", 0).attr("y", 0).attr("height", K), de.append("rect").attr("class", "right").attr("x", 0).attr("y", 0).attr("height", K);
var fe = re.select(".nv-x.nv-brush").call(E);
fe.selectAll("rect").attr("height", K), fe.selectAll(".resize").append("path").attr("d", k), b.dispatch.on("stateChange", function(t) {
for (var n in t) F[n] = t[n];
P.stateChange(F), e.update()
}), P.on("changeState", function(t) {
"undefined" != typeof t.disabled && (S.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), F.disabled = t.disabled), e.update()
}), H()
}), e
}
var n, r, o, i, a, s, l, c = t.models.line(),
u = t.models.line(),
d = t.models.historicalBar(),
f = t.models.historicalBar(),
m = t.models.axis(),
p = t.models.axis(),
g = t.models.axis(),
v = t.models.axis(),
h = t.models.axis(),
y = t.models.axis(),
b = t.models.legend(),
E = d3.svg.brush(),
S = t.models.tooltip(),
_ = {
top: 30,
right: 30,
bottom: 30,
left: 60
},
w = {
top: 0,
right: 30,
bottom: 20,
left: 60
},
A = null,
T = null,
C = function(e) {
return e.x
},
I = function(e) {
return e.y
},
x = t.utils.defaultColor(),
D = !0,
M = !0,
O = !1,
R = !0,
N = 50,
L = null,
k = null,
P = d3.dispatch("brush", "stateChange", "changeState"),
G = 0,
F = t.utils.state(),
U = null,
V = " (left axis)",
z = " (right axis)";
c.clipEdge(!0), u.interactive(!1), m.orient("bottom").tickPadding(5), g.orient("left"), v.orient("right"), p.orient("bottom").tickPadding(5), h.orient("left"), y.orient("right"), S.headerEnabled(!0).headerFormatter(function(e, t) {
return m.tickFormat()(e, t)
});
var B = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
})
}
}
},
$ = function(e) {
return function(t) {
void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
};
return c.dispatch.on("elementMouseover.tooltip", function(e) {
S.duration(100).valueFormatter(function(e, t) {
return v.tickFormat()(e, t)
}).data(e).position(e.pos).hidden(!1)
}), c.dispatch.on("elementMouseout.tooltip", function(e) {
S.hidden(!0)
}), d.dispatch.on("elementMouseover.tooltip", function(t) {
t.value = e.x()(t.data), t.series = {
value: e.y()(t.data),
color: t.color
}, S.duration(0).valueFormatter(function(e, t) {
return g.tickFormat()(e, t)
}).data(t).hidden(!1)
}), d.dispatch.on("elementMouseout.tooltip", function(e) {
S.hidden(!0)
}), d.dispatch.on("elementMousemove.tooltip", function(e) {
S.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.dispatch = P, e.legend = b, e.lines = c, e.lines2 = u, e.bars = d, e.bars2 = f, e.xAxis = m, e.x2Axis = p, e.y1Axis = g, e.y2Axis = v, e.y3Axis = h, e.y4Axis = y, e.tooltip = S, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
height: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
showLegend: {
get: function() {
return D
},
set: function(e) {
D = e
}
},
brushExtent: {
get: function() {
return L
},
set: function(e) {
L = e
}
},
noData: {
get: function() {
return k
},
set: function(e) {
k = e
}
},
focusEnable: {
get: function() {
return M
},
set: function(e) {
M = e
}
},
focusHeight: {
get: function() {
return N
},
set: function(e) {
N = e
}
},
focusShowAxisX: {
get: function() {
return R
},
set: function(e) {
R = e
}
},
focusShowAxisY: {
get: function() {
return O
},
set: function(e) {
O = e
}
},
legendLeftAxisHint: {
get: function() {
return V
},
set: function(e) {
V = e
}
},
legendRightAxisHint: {
get: function() {
return z
},
set: function(e) {
z = e
}
},
tooltips: {
get: function() {
return S.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), S.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return S.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), S.contentGenerator(e)
}
},
margin: {
get: function() {
return _
},
set: function(e) {
_.top = void 0 !== e.top ? e.top : _.top, _.right = void 0 !== e.right ? e.right : _.right, _.bottom = void 0 !== e.bottom ? e.bottom : _.bottom, _.left = void 0 !== e.left ? e.left : _.left
}
},
duration: {
get: function() {
return G
},
set: function(e) {
G = e
}
},
color: {
get: function() {
return x
},
set: function(e) {
x = t.utils.getColor(e), b.color(x)
}
},
x: {
get: function() {
return C
},
set: function(e) {
C = e, c.x(e), u.x(e), d.x(e), f.x(e)
}
},
y: {
get: function() {
return I
},
set: function(e) {
I = e, c.y(e), u.y(e), d.y(e), f.y(e)
}
}
}), t.utils.inheritOptions(e, c), t.utils.initOptions(e), e
}, t.models.lineWithFocusChart = function() {
"use strict";
function e(p) {
return p.each(function(p) {
function T(e) {
var t = +("e" == e),
n = t ? 1 : -1,
r = F / 3;
return "M" + .5 * n + "," + r + "A6,6 0 0 " + t + " " + 6.5 * n + "," + (r + 6) + "V" + (2 * r - 6) + "A6,6 0 0 " + t + " " + .5 * n + "," + 2 * r + "ZM" + 2.5 * n + "," + (r + 8) + "V" + (2 * r - 8) + "M" + 4.5 * n + "," + (r + 8) + "V" + (2 * r - 8)
}
function R() {
m.empty() || m.extent(A), j.data([m.empty() ? o.domain() : A]).each(function(e, t) {
var r = o(e[0]) - n.range()[0],
i = P - o(e[1]);
d3.select(this).select(".left").attr("width", r < 0 ? 0 : r), d3.select(this).select(".right").attr("x", o(e[1])).attr("width", i < 0 ? 0 : i)
})
}
function N() {
A = m.empty() ? null : m.extent();
var e = m.empty() ? o.domain() : m.extent();
if (!(Math.abs(e[0] - e[1]) <= 1)) {
C.brush({
extent: e,
brush: m
}), R();
var t = B.select(".nv-focus .nv-linesWrap").datum(p.filter(function(e) {
return !e.disabled
}).map(function(t, n) {
return {
key: t.key,
area: t.area,
values: t.values.filter(function(t, n) {
return a.x()(t, n) >= e[0] && a.x()(t, n) <= e[1]
})
}
}));
t.transition().duration(I).call(a), B.select(".nv-focus .nv-x.nv-axis").transition().duration(I).call(l), B.select(".nv-focus .nv-y.nv-axis").transition().duration(I).call(c)
}
}
var L = d3.select(this),
k = this;
t.utils.initSVG(L);
var P = t.utils.availableWidth(b, L, v),
G = t.utils.availableHeight(E, L, v) - S,
F = S - h.top - h.bottom;
if (e.update = function() {
L.transition().duration(I).call(e)
}, e.container = this,
x.setter(O(p), e.update).getter(M(p)).update(), x.disabled = p.map(function(e) {
return !!e.disabled
}), !D) {
var U;
D = {};
for (U in x) x[U] instanceof Array ? D[U] = x[U].slice(0) : D[U] = x[U]
}
if (!(p && p.length && p.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, L), e;
L.selectAll(".nv-noData").remove(), n = a.xScale(), r = a.yScale(), o = s.xScale(), i = s.yScale();
var V = L.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([p]),
z = V.enter().append("g").attr("class", "nvd3 nv-wrap nv-lineWithFocusChart").append("g"),
B = V.select("g");
z.append("g").attr("class", "nv-legendWrap");
var $ = z.append("g").attr("class", "nv-focus");
$.append("g").attr("class", "nv-x nv-axis"), $.append("g").attr("class", "nv-y nv-axis"), $.append("g").attr("class", "nv-linesWrap"), $.append("g").attr("class", "nv-interactive");
var W = z.append("g").attr("class", "nv-context");
W.append("g").attr("class", "nv-x nv-axis"), W.append("g").attr("class", "nv-y nv-axis"), W.append("g").attr("class", "nv-linesWrap"), W.append("g").attr("class", "nv-brushBackground"), W.append("g").attr("class", "nv-x nv-brush"), w && (f.width(P), B.select(".nv-legendWrap").datum(p).call(f), v.top != f.height() && (v.top = f.height(), G = t.utils.availableHeight(E, L, v) - S), B.select(".nv-legendWrap").attr("transform", "translate(0," + -v.top + ")")), V.attr("transform", "translate(" + v.left + "," + v.top + ")"), _ && (g.width(P).height(G).margin({
left: v.left,
top: v.top
}).svgContainer(L).xScale(n), V.select(".nv-interactive").call(g)), a.width(P).height(G).color(p.map(function(e, t) {
return e.color || y(e, t)
}).filter(function(e, t) {
return !p[t].disabled
})), s.defined(a.defined()).width(P).height(F).color(p.map(function(e, t) {
return e.color || y(e, t)
}).filter(function(e, t) {
return !p[t].disabled
})), B.select(".nv-context").attr("transform", "translate(0," + (G + v.bottom + h.top) + ")");
var H = B.select(".nv-context .nv-linesWrap").datum(p.filter(function(e) {
return !e.disabled
}));
d3.transition(H).call(s), l.scale(n)._ticks(t.utils.calcTicksX(P / 100, p)).tickSize(-G, 0), c.scale(r)._ticks(t.utils.calcTicksY(G / 36, p)).tickSize(-P, 0), B.select(".nv-focus .nv-x.nv-axis").attr("transform", "translate(0," + G + ")"), m.x(o).on("brush", function() {
N()
}), A && m.extent(A);
var j = B.select(".nv-brushBackground").selectAll("g").data([A || m.extent()]),
Y = j.enter().append("g");
Y.append("rect").attr("class", "left").attr("x", 0).attr("y", 0).attr("height", F), Y.append("rect").attr("class", "right").attr("x", 0).attr("y", 0).attr("height", F);
var q = B.select(".nv-x.nv-brush").call(m);
q.selectAll("rect").attr("height", F), q.selectAll(".resize").append("path").attr("d", T), N(), u.scale(o)._ticks(t.utils.calcTicksX(P / 100, p)).tickSize(-F, 0), B.select(".nv-context .nv-x.nv-axis").attr("transform", "translate(0," + i.range()[0] + ")"), d3.transition(B.select(".nv-context .nv-x.nv-axis")).call(u), d.scale(i)._ticks(t.utils.calcTicksY(F / 36, p)).tickSize(-P, 0), d3.transition(B.select(".nv-context .nv-y.nv-axis")).call(d), B.select(".nv-context .nv-x.nv-axis").attr("transform", "translate(0," + i.range()[0] + ")"), f.dispatch.on("stateChange", function(t) {
for (var n in t) x[n] = t[n];
C.stateChange(x), e.update()
}), g.dispatch.on("elementMousemove", function(n) {
a.clearHighlights();
var r, i, s, u = [];
if (p.filter(function(e, t) {
return e.seriesIndex = t, !e.disabled
}).forEach(function(l, c) {
var d = m.empty() ? o.domain() : m.extent(),
f = l.values.filter(function(e, t) {
return a.x()(e, t) >= d[0] && a.x()(e, t) <= d[1]
});
i = t.interactiveBisect(f, n.pointXValue, a.x());
var p = f[i],
g = e.y()(p, i);
null != g && a.highlightPoint(c, i, !0), void 0 !== p && (void 0 === r && (r = p), void 0 === s && (s = e.xScale()(e.x()(p, i))), u.push({
key: l.key,
value: e.y()(p, i),
color: y(l, l.seriesIndex)
}))
}), u.length > 2) {
var d = e.yScale().invert(n.mouseY),
f = Math.abs(e.yScale().domain()[0] - e.yScale().domain()[1]),
h = .03 * f,
b = t.nearestValueIndex(u.map(function(e) {
return e.value
}), d, h);
null !== b && (u[b].highlight = !0)
}
var E = l.tickFormat()(e.x()(r, i));
g.tooltip.position({
left: n.mouseX + v.left,
top: n.mouseY + v.top
}).chartContainer(k.parentNode).valueFormatter(function(e, t) {
return null == e ? "N/A" : c.tickFormat()(e)
}).data({
value: E,
index: i,
series: u
})(), g.renderGuideLine(s)
}), g.dispatch.on("elementMouseout", function(e) {
a.clearHighlights()
}), C.on("changeState", function(t) {
"undefined" != typeof t.disabled && p.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), e.update()
})
}), e
}
var n, r, o, i, a = t.models.line(),
s = t.models.line(),
l = t.models.axis(),
c = t.models.axis(),
u = t.models.axis(),
d = t.models.axis(),
f = t.models.legend(),
m = d3.svg.brush(),
p = t.models.tooltip(),
g = t.interactiveGuideline(),
v = {
top: 30,
right: 30,
bottom: 30,
left: 60
},
h = {
top: 0,
right: 30,
bottom: 20,
left: 60
},
y = t.utils.defaultColor(),
b = null,
E = null,
S = 50,
_ = !1,
w = !0,
A = null,
T = null,
C = d3.dispatch("brush", "stateChange", "changeState"),
I = 250,
x = t.utils.state(),
D = null;
a.clipEdge(!0).duration(0), s.interactive(!1), l.orient("bottom").tickPadding(5), c.orient("left"), u.orient("bottom").tickPadding(5), d.orient("left"), p.valueFormatter(function(e, t) {
return c.tickFormat()(e, t)
}).headerFormatter(function(e, t) {
return l.tickFormat()(e, t)
});
var M = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
})
}
}
},
O = function(e) {
return function(t) {
void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
};
return a.dispatch.on("elementMouseover.tooltip", function(e) {
p.data(e).position(e.pos).hidden(!1)
}), a.dispatch.on("elementMouseout.tooltip", function(e) {
p.hidden(!0)
}), e.dispatch = C, e.legend = f, e.lines = a, e.lines2 = s, e.xAxis = l, e.yAxis = c, e.x2Axis = u, e.y2Axis = d, e.interactiveLayer = g, e.tooltip = p, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
height: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
focusHeight: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
showLegend: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
brushExtent: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
defaultState: {
get: function() {
return D
},
set: function(e) {
D = e
}
},
noData: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
tooltips: {
get: function() {
return p.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), p.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return p.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), p.contentGenerator(e)
}
},
margin: {
get: function() {
return v
},
set: function(e) {
v.top = void 0 !== e.top ? e.top : v.top, v.right = void 0 !== e.right ? e.right : v.right, v.bottom = void 0 !== e.bottom ? e.bottom : v.bottom, v.left = void 0 !== e.left ? e.left : v.left
}
},
color: {
get: function() {
return y
},
set: function(e) {
y = t.utils.getColor(e), f.color(y)
}
},
interpolate: {
get: function() {
return a.interpolate()
},
set: function(e) {
a.interpolate(e), s.interpolate(e)
}
},
xTickFormat: {
get: function() {
return l.tickFormat()
},
set: function(e) {
l.tickFormat(e), u.tickFormat(e)
}
},
yTickFormat: {
get: function() {
return c.tickFormat()
},
set: function(e) {
c.tickFormat(e), d.tickFormat(e)
}
},
duration: {
get: function() {
return I
},
set: function(e) {
I = e, c.duration(I), d.duration(I), l.duration(I), u.duration(I)
}
},
x: {
get: function() {
return a.x()
},
set: function(e) {
a.x(e), s.x(e)
}
},
y: {
get: function() {
return a.y()
},
set: function(e) {
a.y(e), s.y(e)
}
},
useInteractiveGuideline: {
get: function() {
return _
},
set: function(e) {
_ = e, _ && (a.interactive(!1), a.useVoronoi(!1))
}
}
}), t.utils.inheritOptions(e, a), t.utils.initOptions(e), e
}, t.models.multiBar = function() {
"use strict";
function e(M) {
return x.reset(), M.each(function(e) {
var M = u - c.left - c.right,
O = d - c.top - c.bottom;
g = d3.select(this), t.utils.initSVG(g);
var R = 0;
if (w && e.length && (w = [{
values: e[0].values.map(function(e) {
return {
x: e.x,
y: 0,
series: e.series,
size: .01
}
})
}]), E) {
var N = d3.layout.stack().offset(S).values(function(e) {
return e.values
}).y(h)(!e.length && w ? w : e);
N.forEach(function(t, n) {
t.nonStackable ? (e[n].nonStackableSeries = R++, N[n] = e[n]) : n > 0 && N[n - 1].nonStackable && N[n].values.map(function(e, t) {
e.y0 -= N[n - 1].values[t].y, e.y1 = e.y0 + e.y
})
}), e = N
}
e.forEach(function(e, t) {
e.values.forEach(function(n) {
n.series = t, n.key = e.key
})
}), E && e[0].values.map(function(t, n) {
var r = 0,
o = 0;
e.map(function(t, i) {
if (!e[i].nonStackable) {
var a = t.values[n];
a.size = Math.abs(a.y), a.y < 0 ? (a.y1 = o, o -= a.size) : (a.y1 = a.size + r, r += a.size)
}
})
});
var L = r && o ? [] : e.map(function(e, t) {
return e.values.map(function(e, n) {
return {
x: v(e, n),
y: h(e, n),
y0: e.y0,
y1: e.y1,
idx: t
}
})
});
f.domain(r || d3.merge(L).map(function(e) {
return e.x
})).rangeBands(i || [0, M], C), m.domain(o || d3.extent(d3.merge(L).map(function(t) {
var n = t.y;
return E && !e[t.idx].nonStackable && (n = t.y > 0 ? t.y1 : t.y1 + t.y), n
}).concat(y))).range(a || [O, 0]), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] - .01 * f.domain()[0], f.domain()[1] + .01 * f.domain()[1]]) : f.domain([-1, 1])), m.domain()[0] === m.domain()[1] && (m.domain()[0] ? m.domain([m.domain()[0] + .01 * m.domain()[0], m.domain()[1] - .01 * m.domain()[1]]) : m.domain([-1, 1])), s = s || f, l = l || m;
var k = g.selectAll("g.nv-wrap.nv-multibar").data([e]),
P = k.enter().append("g").attr("class", "nvd3 nv-wrap nv-multibar"),
G = P.append("defs"),
F = P.append("g"),
U = k.select("g");
F.append("g").attr("class", "nv-groups"), k.attr("transform", "translate(" + c.left + "," + c.top + ")"), G.append("clipPath").attr("id", "nv-edge-clip-" + p).append("rect"), k.select("#nv-edge-clip-" + p + " rect").attr("width", M).attr("height", O), U.attr("clip-path", b ? "url(#nv-edge-clip-" + p + ")" : "");
var V = k.select(".nv-groups").selectAll(".nv-group").data(function(e) {
return e
}, function(e, t) {
return t
});
V.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6);
var z = x.transition(V.exit().selectAll("rect.nv-bar"), "multibarExit", Math.min(100, T)).attr("y", function(t, n, r) {
var o = l(0) || 0;
return E && e[t.series] && !e[t.series].nonStackable && (o = l(t.y0)), o
}).attr("height", 0).remove();
z.delay && z.delay(function(e, t) {
var n = t * (T / (D + 1)) - t;
return n
}), V.attr("class", function(e, t) {
return "nv-group nv-series-" + t
}).classed("hover", function(e) {
return e.hover
}).style("fill", function(e, t) {
return _(e, t)
}).style("stroke", function(e, t) {
return _(e, t)
}), V.style("stroke-opacity", 1).style("fill-opacity", .75);
var B = V.selectAll("rect.nv-bar").data(function(t) {
return w && !e.length ? w.values : t.values
});
B.exit().remove();
B.enter().append("rect").attr("class", function(e, t) {
return h(e, t) < 0 ? "nv-bar negative" : "nv-bar positive"
}).attr("x", function(t, n, r) {
return E && !e[r].nonStackable ? 0 : r * f.rangeBand() / e.length
}).attr("y", function(t, n, r) {
return l(E && !e[r].nonStackable ? t.y0 : 0) || 0
}).attr("height", 0).attr("width", function(t, n, r) {
return f.rangeBand() / (E && !e[r].nonStackable ? 1 : e.length)
}).attr("transform", function(e, t) {
return "translate(" + f(v(e, t)) + ",0)"
});
B.style("fill", function(e, t, n) {
return _(e, n, t)
}).style("stroke", function(e, t, n) {
return _(e, n, t)
}).on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0), I.elementMouseover({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1), I.elementMouseout({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("mousemove", function(e, t) {
I.elementMousemove({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("click", function(e, t) {
I.elementClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation()
}).on("dblclick", function(e, t) {
I.elementDblClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation()
}), B.attr("class", function(e, t) {
return h(e, t) < 0 ? "nv-bar negative" : "nv-bar positive"
}).attr("transform", function(e, t) {
return "translate(" + f(v(e, t)) + ",0)"
}), A && (n || (n = e.map(function() {
return !0
})), B.style("fill", function(e, t, r) {
return d3.rgb(A(e, t)).darker(n.map(function(e, t) {
return t
}).filter(function(e, t) {
return !n[t]
})[r]).toString()
}).style("stroke", function(e, t, r) {
return d3.rgb(A(e, t)).darker(n.map(function(e, t) {
return t
}).filter(function(e, t) {
return !n[t]
})[r]).toString()
}));
var $ = B.watchTransition(x, "multibar", Math.min(250, T)).delay(function(t, n) {
return n * T / e[0].values.length
});
E ? $.attr("y", function(t, n, r) {
var o = 0;
return o = e[r].nonStackable ? h(t, n) < 0 ? m(0) : m(0) - m(h(t, n)) < -1 ? m(0) - 1 : m(h(t, n)) || 0 : m(t.y1)
}).attr("height", function(t, n, r) {
return e[r].nonStackable ? Math.max(Math.abs(m(h(t, n)) - m(0)), 1) || 0 : Math.max(Math.abs(m(t.y + t.y0) - m(t.y0)), 1)
}).attr("x", function(t, n, r) {
var o = 0;
return e[r].nonStackable && (o = t.series * f.rangeBand() / e.length, e.length !== R && (o = e[r].nonStackableSeries * f.rangeBand() / (2 * R))), o
}).attr("width", function(t, n, r) {
if (e[r].nonStackable) {
var o = f.rangeBand() / R;
return e.length !== R && (o = f.rangeBand() / (2 * R)), o
}
return f.rangeBand()
}) : $.attr("x", function(t, n) {
return t.series * f.rangeBand() / e.length
}).attr("width", f.rangeBand() / e.length).attr("y", function(e, t) {
return h(e, t) < 0 ? m(0) : m(0) - m(h(e, t)) < 1 ? m(0) - 1 : m(h(e, t)) || 0
}).attr("height", function(e, t) {
return Math.max(Math.abs(m(h(e, t)) - m(0)), 1) || 0
}), s = f.copy(), l = m.copy(), e[0] && e[0].values && (D = e[0].values.length)
}), x.renderEnd("multibar immediate"), e
}
var n, r, o, i, a, s, l, c = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
u = 960,
d = 500,
f = d3.scale.ordinal(),
m = d3.scale.linear(),
p = Math.floor(1e4 * Math.random()),
g = null,
v = function(e) {
return e.x
},
h = function(e) {
return e.y
},
y = [0],
b = !0,
E = !1,
S = "zero",
_ = t.utils.defaultColor(),
w = !1,
A = null,
T = 500,
C = .1,
I = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"),
x = t.utils.renderWatch(I, T),
D = 0;
return e.dispatch = I, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
height: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
x: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
y: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
xScale: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
yScale: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
xDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
yDomain: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
xRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
yRange: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
forceY: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
stacked: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
stackOffset: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
clipEdge: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
disabled: {
get: function() {
return n
},
set: function(e) {
n = e
}
},
id: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
hideable: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
groupSpacing: {
get: function() {
return C
},
set: function(e) {
C = e
}
},
margin: {
get: function() {
return c
},
set: function(e) {
c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left
}
},
duration: {
get: function() {
return T
},
set: function(e) {
T = e, x.reset(T)
}
},
color: {
get: function() {
return _
},
set: function(e) {
_ = t.utils.getColor(e)
}
},
barColor: {
get: function() {
return A
},
set: function(e) {
A = e ? t.utils.getColor(e) : null
}
}
}), t.utils.initOptions(e), e
}, t.models.multiBarChart = function() {
"use strict";
function e(c) {
return D.reset(), D.models(o), h && D.models(i), y && D.models(a), c.each(function(c) {
var T = d3.select(this);
t.utils.initSVG(T);
var D = t.utils.availableWidth(d, T, u),
N = t.utils.availableHeight(f, T, u);
if (e.update = function() {
0 === x ? T.call(e) : T.transition().duration(x).call(e)
}, e.container = this, w.setter(R(c), e.update).getter(O(c)).update(), w.disabled = c.map(function(e) {
return !!e.disabled
}), !A) {
var L;
A = {};
for (L in w) w[L] instanceof Array ? A[L] = w[L].slice(0) : A[L] = w[L]
}
if (!(c && c.length && c.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, T), e;
T.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale();
var k = T.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([c]),
P = k.enter().append("g").attr("class", "nvd3 nv-wrap nv-multiBarWithLegend").append("g"),
G = k.select("g");
if (P.append("g").attr("class", "nv-x nv-axis"), P.append("g").attr("class", "nv-y nv-axis"), P.append("g").attr("class", "nv-barsWrap"), P.append("g").attr("class", "nv-legendWrap"), P.append("g").attr("class", "nv-controlsWrap"), v && (s.width(D - I()), G.select(".nv-legendWrap").datum(c).call(s), u.top != s.height() && (u.top = s.height(), N = t.utils.availableHeight(f, T, u)), G.select(".nv-legendWrap").attr("transform", "translate(" + I() + "," + -u.top + ")")), p) {
var F = [{
key: g.grouped || "Grouped",
disabled: o.stacked()
}, {
key: g.stacked || "Stacked",
disabled: !o.stacked()
}];
l.width(I()).color(["#444", "#444", "#444"]), G.select(".nv-controlsWrap").datum(F).attr("transform", "translate(0," + -u.top + ")").call(l)
}
k.attr("transform", "translate(" + u.left + "," + u.top + ")"), b && G.select(".nv-y.nv-axis").attr("transform", "translate(" + D + ",0)"), o.disabled(c.map(function(e) {
return e.disabled
})).width(D).height(N).color(c.map(function(e, t) {
return e.color || m(e, t)
}).filter(function(e, t) {
return !c[t].disabled
}));
var U = G.select(".nv-barsWrap").datum(c.filter(function(e) {
return !e.disabled
}));
if (U.call(o), h) {
i.scale(n)._ticks(t.utils.calcTicksX(D / 100, c)).tickSize(-N, 0), G.select(".nv-x.nv-axis").attr("transform", "translate(0," + r.range()[0] + ")"), G.select(".nv-x.nv-axis").call(i);
var V = G.select(".nv-x.nv-axis > g").selectAll("g");
if (V.selectAll("line, text").style("opacity", 1), S) {
var z = function(e, t) {
return "translate(" + e + "," + t + ")"
},
B = 5,
$ = 17;
V.selectAll("text").attr("transform", function(e, t, n) {
return z(0, n % 2 == 0 ? B : $)
});
var W = d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;
G.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform", function(e, t) {
return z(0, 0 === t || W % 2 !== 0 ? $ : B)
})
}
E && V.filter(function(e, t) {
return t % Math.ceil(c[0].values.length / (D / 100)) !== 0
}).selectAll("text, line").style("opacity", 0), _ && V.selectAll(".tick text").attr("transform", "rotate(" + _ + " 0,0)").style("text-anchor", _ > 0 ? "start" : "end"), G.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity", 1)
}
y && (a.scale(r)._ticks(t.utils.calcTicksY(N / 36, c)).tickSize(-D, 0), G.select(".nv-y.nv-axis").call(a)), s.dispatch.on("stateChange", function(t) {
for (var n in t) w[n] = t[n];
C.stateChange(w), e.update()
}), l.dispatch.on("legendClick", function(t, n) {
if (t.disabled) {
switch (F = F.map(function(e) {
return e.disabled = !0, e
}), t.disabled = !1, t.key) {
case "Grouped":
case g.grouped:
o.stacked(!1);
break;
case "Stacked":
case g.stacked:
o.stacked(!0)
}
w.stacked = o.stacked(), C.stateChange(w), e.update()
}
}), C.on("changeState", function(t) {
"undefined" != typeof t.disabled && (c.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), w.disabled = t.disabled), "undefined" != typeof t.stacked && (o.stacked(t.stacked), w.stacked = t.stacked, M = t.stacked), e.update()
})
}), D.renderEnd("multibarchart immediate"), e
}
var n, r, o = t.models.multiBar(),
i = t.models.axis(),
a = t.models.axis(),
s = t.models.legend(),
l = t.models.legend(),
c = t.models.tooltip(),
u = {
top: 30,
right: 20,
bottom: 50,
left: 60
},
d = null,
f = null,
m = t.utils.defaultColor(),
p = !0,
g = {},
v = !0,
h = !0,
y = !0,
b = !1,
E = !0,
S = !1,
_ = 0,
w = t.utils.state(),
A = null,
T = null,
C = d3.dispatch("stateChange", "changeState", "renderEnd"),
I = function() {
return p ? 180 : 0
},
x = 250;
w.stacked = !1, o.stacked(!1), i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(e) {
return e
}), a.orient(b ? "right" : "left").tickFormat(d3.format(",.1f")), c.duration(0).valueFormatter(function(e, t) {
return a.tickFormat()(e, t)
}).headerFormatter(function(e, t) {
return i.tickFormat()(e, t)
}), l.updateState(!1);
var D = t.utils.renderWatch(C),
M = !1,
O = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
}),
stacked: M
}
}
},
R = function(e) {
return function(t) {
void 0 !== t.stacked && (M = t.stacked), void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
};
return o.dispatch.on("elementMouseover.tooltip", function(t) {
t.value = e.x()(t.data), t.series = {
key: t.data.key,
value: e.y()(t.data),
color: t.color
}, c.data(t).hidden(!1)
}), o.dispatch.on("elementMouseout.tooltip", function(e) {
c.hidden(!0)
}), o.dispatch.on("elementMousemove.tooltip", function(e) {
c.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.dispatch = C, e.multibar = o, e.legend = s, e.controls = l, e.xAxis = i, e.yAxis = a, e.state = w, e.tooltip = c, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
height: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
showLegend: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
showControls: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
controlLabels: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
showXAxis: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
showYAxis: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
defaultState: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
noData: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
reduceXTicks: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
rotateLabels: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
staggerLabels: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
tooltips: {
get: function() {
return c.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), c.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return c.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), c.contentGenerator(e)
}
},
margin: {
get: function() {
return u
},
set: function(e) {
u.top = void 0 !== e.top ? e.top : u.top, u.right = void 0 !== e.right ? e.right : u.right, u.bottom = void 0 !== e.bottom ? e.bottom : u.bottom, u.left = void 0 !== e.left ? e.left : u.left
}
},
duration: {
get: function() {
return x
},
set: function(e) {
x = e, o.duration(x), i.duration(x), a.duration(x), D.reset(x)
}
},
color: {
get: function() {
return m
},
set: function(e) {
m = t.utils.getColor(e), s.color(m)
}
},
rightAlignYAxis: {
get: function() {
return b
},
set: function(e) {
b = e, a.orient(b ? "right" : "left")
}
},
barColor: {
get: function() {
return o.barColor
},
set: function(e) {
o.barColor(e), s.color(function(e, t) {
return d3.rgb("#ccc").darker(1.5 * t).toString()
})
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.multiBarHorizontal = function() {
"use strict";
function e(f) {
return M.reset(), f.each(function(e) {
var f = u - c.left - c.right,
x = d - c.top - c.bottom;
m = d3.select(this), t.utils.initSVG(m), _ && (e = d3.layout.stack().offset("zero").values(function(e) {
return e.values
}).y(h)(e)), e.forEach(function(e, t) {
e.values.forEach(function(n) {
n.series = t, n.key = e.key
})
}), _ && e[0].values.map(function(t, n) {
var r = 0,
o = 0;
e.map(function(e) {
var t = e.values[n];
t.size = Math.abs(t.y), t.y < 0 ? (t.y1 = o - t.size, o -= t.size) : (t.y1 = r, r += t.size)
})
});
var O = r && o ? [] : e.map(function(e) {
return e.values.map(function(e, t) {
return {
x: v(e, t),
y: h(e, t),
y0: e.y0,
y1: e.y1
}
})
});
p.domain(r || d3.merge(O).map(function(e) {
return e.x
})).rangeBands(i || [0, x], C), g.domain(o || d3.extent(d3.merge(O).map(function(e) {
return _ ? e.y > 0 ? e.y1 + e.y : e.y1 : e.y
}).concat(b))), w && !_ ? g.range(a || [g.domain()[0] < 0 ? T : 0, f - (g.domain()[1] > 0 ? T : 0)]) : g.range(a || [0, f]), s = s || p, l = l || d3.scale.linear().domain(g.domain()).range([g(0), g(0)]);
var R = d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([e]),
N = R.enter().append("g").attr("class", "nvd3 nv-wrap nv-multibarHorizontal"),
L = (N.append("defs"), N.append("g"));
R.select("g");
L.append("g").attr("class", "nv-groups"), R.attr("transform", "translate(" + c.left + "," + c.top + ")");
var k = R.select(".nv-groups").selectAll(".nv-group").data(function(e) {
return e
}, function(e, t) {
return t
});
k.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6), k.exit().watchTransition(M, "multibarhorizontal: exit groups").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6).remove(), k.attr("class", function(e, t) {
return "nv-group nv-series-" + t
}).classed("hover", function(e) {
return e.hover
}).style("fill", function(e, t) {
return E(e, t)
}).style("stroke", function(e, t) {
return E(e, t)
}), k.watchTransition(M, "multibarhorizontal: groups").style("stroke-opacity", 1).style("fill-opacity", .75);
var P = k.selectAll("g.nv-bar").data(function(e) {
return e.values
});
P.exit().remove();
var G = P.enter().append("g").attr("transform", function(t, n, r) {
return "translate(" + l(_ ? t.y0 : 0) + "," + (_ ? 0 : r * p.rangeBand() / e.length + p(v(t, n))) + ")"
});
G.append("rect").attr("width", 0).attr("height", p.rangeBand() / (_ ? 1 : e.length)), P.on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0), D.elementMouseover({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1), D.elementMouseout({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("mouseout", function(e, t) {
D.elementMouseout({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("mousemove", function(e, t) {
D.elementMousemove({
data: e,
index: t,
color: d3.select(this).style("fill")
})
}).on("click", function(e, t) {
D.elementClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation()
}).on("dblclick", function(e, t) {
D.elementDblClick({
data: e,
index: t,
color: d3.select(this).style("fill")
}), d3.event.stopPropagation()
}), y(e[0], 0) && (G.append("polyline"), P.select("polyline").attr("fill", "none").attr("points", function(t, n) {
var r = y(t, n),
o = .8 * p.rangeBand() / (2 * (_ ? 1 : e.length));
r = r.length ? r : [-Math.abs(r), Math.abs(r)], r = r.map(function(e) {
return g(e) - g(0)
});
var i = [
[r[0], -o],
[r[0], o],
[r[0], 0],
[r[1], 0],
[r[1], -o],
[r[1], o]
];
return i.map(function(e) {
return e.join(",")
}).join(" ")
}).attr("transform", function(t, n) {
var r = p.rangeBand() / (2 * (_ ? 1 : e.length));
return "translate(" + (h(t, n) < 0 ? 0 : g(h(t, n)) - g(0)) + ", " + r + ")"
})), G.append("text"), w && !_ ? (P.select("text").attr("text-anchor", function(e, t) {
return h(e, t) < 0 ? "end" : "start"
}).attr("y", p.rangeBand() / (2 * e.length)).attr("dy", ".32em").text(function(e, t) {
var n = I(h(e, t)),
r = y(e, t);
return void 0 === r ? n : r.length ? n + "+" + I(Math.abs(r[1])) + "-" + I(Math.abs(r[0])) : n + "±" + I(Math.abs(r))
}), P.watchTransition(M, "multibarhorizontal: bars").select("text").attr("x", function(e, t) {
return h(e, t) < 0 ? -4 : g(h(e, t)) - g(0) + 4
})) : P.selectAll("text").text(""), A && !_ ? (G.append("text").classed("nv-bar-label", !0), P.select("text.nv-bar-label").attr("text-anchor", function(e, t) {
return h(e, t) < 0 ? "start" : "end"
}).attr("y", p.rangeBand() / (2 * e.length)).attr("dy", ".32em").text(function(e, t) {
return v(e, t)
}), P.watchTransition(M, "multibarhorizontal: bars").select("text.nv-bar-label").attr("x", function(e, t) {
return h(e, t) < 0 ? g(0) - g(h(e, t)) + 4 : -4
})) : P.selectAll("text.nv-bar-label").text(""), P.attr("class", function(e, t) {
return h(e, t) < 0 ? "nv-bar negative" : "nv-bar positive"
}), S && (n || (n = e.map(function() {
return !0
})), P.style("fill", function(e, t, r) {
return d3.rgb(S(e, t)).darker(n.map(function(e, t) {
return t
}).filter(function(e, t) {
return !n[t]
})[r]).toString()
}).style("stroke", function(e, t, r) {
return d3.rgb(S(e, t)).darker(n.map(function(e, t) {
return t
}).filter(function(e, t) {
return !n[t]
})[r]).toString()
})), _ ? P.watchTransition(M, "multibarhorizontal: bars").attr("transform", function(e, t) {
return "translate(" + g(e.y1) + "," + p(v(e, t)) + ")"
}).select("rect").attr("width", function(e, t) {
return Math.abs(g(h(e, t) + e.y0) - g(e.y0))
}).attr("height", p.rangeBand()) : P.watchTransition(M, "multibarhorizontal: bars").attr("transform", function(t, n) {
return "translate(" + g(h(t, n) < 0 ? h(t, n) : 0) + "," + (t.series * p.rangeBand() / e.length + p(v(t, n))) + ")"
}).select("rect").attr("height", p.rangeBand() / e.length).attr("width", function(e, t) {
return Math.max(Math.abs(g(h(e, t)) - g(0)), 1)
}), s = p.copy(), l = g.copy()
}), M.renderEnd("multibarHorizontal immediate"), e
}
var n, r, o, i, a, s, l, c = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
u = 960,
d = 500,
f = Math.floor(1e4 * Math.random()),
m = null,
p = d3.scale.ordinal(),
g = d3.scale.linear(),
v = function(e) {
return e.x
},
h = function(e) {
return e.y
},
y = function(e) {
return e.yErr
},
b = [0],
E = t.utils.defaultColor(),
S = null,
_ = !1,
w = !1,
A = !1,
T = 60,
C = .1,
I = d3.format(",.2f"),
x = 250,
D = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"),
M = t.utils.renderWatch(D, x);
return e.dispatch = D, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
height: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
x: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
y: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
yErr: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
xScale: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
yScale: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
xDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
yDomain: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
xRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
yRange: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
forceY: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
stacked: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
showValues: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
disabled: {
get: function() {
return n
},
set: function(e) {
n = e
}
},
id: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
valueFormat: {
get: function() {
return I
},
set: function(e) {
I = e
}
},
valuePadding: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
groupSpacing: {
get: function() {
return C
},
set: function(e) {
C = e
}
},
margin: {
get: function() {
return c
},
set: function(e) {
c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left
}
},
duration: {
get: function() {
return x
},
set: function(e) {
x = e, M.reset(x)
}
},
color: {
get: function() {
return E
},
set: function(e) {
E = t.utils.getColor(e)
}
},
barColor: {
get: function() {
return S
},
set: function(e) {
S = e ? t.utils.getColor(e) : null
}
}
}), t.utils.initOptions(e), e
}, t.models.multiBarHorizontalChart = function() {
"use strict";
function e(c) {
return x.reset(), x.models(o), h && x.models(i), y && x.models(a), c.each(function(c) {
var _ = d3.select(this);
t.utils.initSVG(_);
var x = t.utils.availableWidth(d, _, u),
D = t.utils.availableHeight(f, _, u);
if (e.update = function() {
_.transition().duration(T).call(e)
}, e.container = this, b = o.stacked(), E.setter(I(c), e.update).getter(C(c)).update(), E.disabled = c.map(function(e) {
return !!e.disabled
}), !S) {
var M;
S = {};
for (M in E) E[M] instanceof Array ? S[M] = E[M].slice(0) : S[M] = E[M]
}
if (!(c && c.length && c.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, _), e;
_.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale();
var O = _.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([c]),
R = O.enter().append("g").attr("class", "nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),
N = O.select("g");
if (R.append("g").attr("class", "nv-x nv-axis"), R.append("g").attr("class", "nv-y nv-axis").append("g").attr("class", "nv-zeroLine").append("line"), R.append("g").attr("class", "nv-barsWrap"), R.append("g").attr("class", "nv-legendWrap"), R.append("g").attr("class", "nv-controlsWrap"), v && (s.width(x - A()), N.select(".nv-legendWrap").datum(c).call(s), u.top != s.height() && (u.top = s.height(), D = t.utils.availableHeight(f, _, u)), N.select(".nv-legendWrap").attr("transform", "translate(" + A() + "," + -u.top + ")")), p) {
var L = [{
key: g.grouped || "Grouped",
disabled: o.stacked()
}, {
key: g.stacked || "Stacked",
disabled: !o.stacked()
}];
l.width(A()).color(["#444", "#444", "#444"]), N.select(".nv-controlsWrap").datum(L).attr("transform", "translate(0," + -u.top + ")").call(l)
}
O.attr("transform", "translate(" + u.left + "," + u.top + ")"), o.disabled(c.map(function(e) {
return e.disabled
})).width(x).height(D).color(c.map(function(e, t) {
return e.color || m(e, t)
}).filter(function(e, t) {
return !c[t].disabled
}));
var k = N.select(".nv-barsWrap").datum(c.filter(function(e) {
return !e.disabled
}));
if (k.transition().call(o), h) {
i.scale(n)._ticks(t.utils.calcTicksY(D / 24, c)).tickSize(-x, 0), N.select(".nv-x.nv-axis").call(i);
var P = N.select(".nv-x.nv-axis").selectAll("g");
P.selectAll("line, text")
}
y && (a.scale(r)._ticks(t.utils.calcTicksX(x / 100, c)).tickSize(-D, 0), N.select(".nv-y.nv-axis").attr("transform", "translate(0," + D + ")"), N.select(".nv-y.nv-axis").call(a)), N.select(".nv-zeroLine line").attr("x1", r(0)).attr("x2", r(0)).attr("y1", 0).attr("y2", -D), s.dispatch.on("stateChange", function(t) {
for (var n in t) E[n] = t[n];
w.stateChange(E), e.update()
}), l.dispatch.on("legendClick", function(t, n) {
if (t.disabled) {
switch (L = L.map(function(e) {
return e.disabled = !0, e
}), t.disabled = !1, t.key) {
case "Grouped":
o.stacked(!1);
break;
case "Stacked":
o.stacked(!0)
}
E.stacked = o.stacked(), w.stateChange(E), b = o.stacked(), e.update()
}
}), w.on("changeState", function(t) {
"undefined" != typeof t.disabled && (c.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), E.disabled = t.disabled), "undefined" != typeof t.stacked && (o.stacked(t.stacked), E.stacked = t.stacked, b = t.stacked), e.update()
})
}), x.renderEnd("multibar horizontal chart immediate"), e
}
var n, r, o = t.models.multiBarHorizontal(),
i = t.models.axis(),
a = t.models.axis(),
s = t.models.legend().height(30),
l = t.models.legend().height(30),
c = t.models.tooltip(),
u = {
top: 30,
right: 20,
bottom: 50,
left: 60
},
d = null,
f = null,
m = t.utils.defaultColor(),
p = !0,
g = {},
v = !0,
h = !0,
y = !0,
b = !1,
E = t.utils.state(),
S = null,
_ = null,
w = d3.dispatch("stateChange", "changeState", "renderEnd"),
A = function() {
return p ? 180 : 0
},
T = 250;
E.stacked = !1, o.stacked(b),
i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(e) {
return e
}), a.orient("bottom").tickFormat(d3.format(",.1f")), c.duration(0).valueFormatter(function(e, t) {
return a.tickFormat()(e, t)
}).headerFormatter(function(e, t) {
return i.tickFormat()(e, t)
}), l.updateState(!1);
var C = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
}),
stacked: b
}
}
},
I = function(e) {
return function(t) {
void 0 !== t.stacked && (b = t.stacked), void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
},
x = t.utils.renderWatch(w, T);
return o.dispatch.on("elementMouseover.tooltip", function(t) {
t.value = e.x()(t.data), t.series = {
key: t.data.key,
value: e.y()(t.data),
color: t.color
}, c.data(t).hidden(!1)
}), o.dispatch.on("elementMouseout.tooltip", function(e) {
c.hidden(!0)
}), o.dispatch.on("elementMousemove.tooltip", function(e) {
c.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.dispatch = w, e.multibar = o, e.legend = s, e.controls = l, e.xAxis = i, e.yAxis = a, e.state = E, e.tooltip = c, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
height: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
showLegend: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
showControls: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
controlLabels: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
showXAxis: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
showYAxis: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
defaultState: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
noData: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
tooltips: {
get: function() {
return c.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), c.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return c.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), c.contentGenerator(e)
}
},
margin: {
get: function() {
return u
},
set: function(e) {
u.top = void 0 !== e.top ? e.top : u.top, u.right = void 0 !== e.right ? e.right : u.right, u.bottom = void 0 !== e.bottom ? e.bottom : u.bottom, u.left = void 0 !== e.left ? e.left : u.left
}
},
duration: {
get: function() {
return T
},
set: function(e) {
T = e, x.reset(T), o.duration(T), i.duration(T), a.duration(T)
}
},
color: {
get: function() {
return m
},
set: function(e) {
m = t.utils.getColor(e), s.color(m)
}
},
barColor: {
get: function() {
return o.barColor
},
set: function(e) {
o.barColor(e), s.color(function(e, t) {
return d3.rgb("#ccc").darker(1.5 * t).toString()
})
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.multiChart = function() {
"use strict";
function e(c) {
return c.each(function(c) {
function u(e) {
var t = 2 === c[e.seriesIndex].yAxis ? T : A;
e.value = e.point.x, e.series = {
value: e.point.y,
color: e.point.color
}, I.duration(100).valueFormatter(function(e, n) {
return t.tickFormat()(e, n)
}).data(e).position(e.pos).hidden(!1)
}
function d(e) {
var t = 2 === c[e.seriesIndex].yAxis ? T : A;
e.point.x = S.x()(e.point), e.point.y = S.y()(e.point), I.duration(100).valueFormatter(function(e, n) {
return t.tickFormat()(e, n)
}).data(e).position(e.pos).hidden(!1)
}
function m(e) {
var t = 2 === c[e.data.series].yAxis ? T : A;
e.value = b.x()(e.data), e.series = {
value: b.y()(e.data),
color: e.color
}, I.duration(0).valueFormatter(function(e, n) {
return t.tickFormat()(e, n)
}).data(e).hidden(!1)
}
var x = d3.select(this);
t.utils.initSVG(x), e.update = function() {
x.transition().call(e)
}, e.container = this;
var D = t.utils.availableWidth(a, x, o),
M = t.utils.availableHeight(s, x, o),
O = c.filter(function(e) {
return "line" == e.type && 1 == e.yAxis
}),
R = c.filter(function(e) {
return "line" == e.type && 2 == e.yAxis
}),
N = c.filter(function(e) {
return "bar" == e.type && 1 == e.yAxis
}),
L = c.filter(function(e) {
return "bar" == e.type && 2 == e.yAxis
}),
k = c.filter(function(e) {
return "area" == e.type && 1 == e.yAxis
}),
P = c.filter(function(e) {
return "area" == e.type && 2 == e.yAxis
});
if (!(c && c.length && c.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, x), e;
x.selectAll(".nv-noData").remove();
var G = c.filter(function(e) {
return !e.disabled && 1 == e.yAxis
}).map(function(e) {
return e.values.map(function(e, t) {
return {
x: e.x,
y: e.y
}
})
}),
F = c.filter(function(e) {
return !e.disabled && 2 == e.yAxis
}).map(function(e) {
return e.values.map(function(e, t) {
return {
x: e.x,
y: e.y
}
})
});
p.domain(d3.extent(d3.merge(G.concat(F)), function(e) {
return e.x
})).range([0, D]);
var U = x.selectAll("g.wrap.multiChart").data([c]),
V = U.enter().append("g").attr("class", "wrap nvd3 multiChart").append("g");
V.append("g").attr("class", "nv-x nv-axis"), V.append("g").attr("class", "nv-y1 nv-axis"), V.append("g").attr("class", "nv-y2 nv-axis"), V.append("g").attr("class", "lines1Wrap"), V.append("g").attr("class", "lines2Wrap"), V.append("g").attr("class", "bars1Wrap"), V.append("g").attr("class", "bars2Wrap"), V.append("g").attr("class", "stack1Wrap"), V.append("g").attr("class", "stack2Wrap"), V.append("g").attr("class", "legendWrap");
var z = U.select("g"),
B = c.map(function(e, t) {
return c[t].color || i(e, t)
});
if (l) {
var $ = C.align() ? D / 2 : D,
W = C.align() ? $ : 0;
C.width($), C.color(B), z.select(".legendWrap").datum(c.map(function(e) {
return e.originalKey = void 0 === e.originalKey ? e.key : e.originalKey, e.key = e.originalKey + (1 == e.yAxis ? "" : " (right axis)"), e
})).call(C), o.top != C.height() && (o.top = C.height(), M = t.utils.availableHeight(s, x, o)), z.select(".legendWrap").attr("transform", "translate(" + W + "," + -o.top + ")")
}
h.width(D).height(M).interpolate(f).color(B.filter(function(e, t) {
return !c[t].disabled && 1 == c[t].yAxis && "line" == c[t].type
})), y.width(D).height(M).interpolate(f).color(B.filter(function(e, t) {
return !c[t].disabled && 2 == c[t].yAxis && "line" == c[t].type
})), b.width(D).height(M).color(B.filter(function(e, t) {
return !c[t].disabled && 1 == c[t].yAxis && "bar" == c[t].type
})), E.width(D).height(M).color(B.filter(function(e, t) {
return !c[t].disabled && 2 == c[t].yAxis && "bar" == c[t].type
})), S.width(D).height(M).color(B.filter(function(e, t) {
return !c[t].disabled && 1 == c[t].yAxis && "area" == c[t].type
})), _.width(D).height(M).color(B.filter(function(e, t) {
return !c[t].disabled && 2 == c[t].yAxis && "area" == c[t].type
})), z.attr("transform", "translate(" + o.left + "," + o.top + ")");
var H = z.select(".lines1Wrap").datum(O.filter(function(e) {
return !e.disabled
})),
j = z.select(".bars1Wrap").datum(N.filter(function(e) {
return !e.disabled
})),
Y = z.select(".stack1Wrap").datum(k.filter(function(e) {
return !e.disabled
})),
q = z.select(".lines2Wrap").datum(R.filter(function(e) {
return !e.disabled
})),
K = z.select(".bars2Wrap").datum(L.filter(function(e) {
return !e.disabled
})),
Z = z.select(".stack2Wrap").datum(P.filter(function(e) {
return !e.disabled
})),
Q = k.length ? k.map(function(e) {
return e.values
}).reduce(function(e, t) {
return e.map(function(e, n) {
return {
x: e.x,
y: e.y + t[n].y
}
})
}).concat([{
x: 0,
y: 0
}]) : [],
X = P.length ? P.map(function(e) {
return e.values
}).reduce(function(e, t) {
return e.map(function(e, n) {
return {
x: e.x,
y: e.y + t[n].y
}
})
}).concat([{
x: 0,
y: 0
}]) : [];
g.domain(n || d3.extent(d3.merge(G).concat(Q), function(e) {
return e.y
})).range([0, M]), v.domain(r || d3.extent(d3.merge(F).concat(X), function(e) {
return e.y
})).range([0, M]), h.yDomain(g.domain()), b.yDomain(g.domain()), S.yDomain(g.domain()), y.yDomain(v.domain()), E.yDomain(v.domain()), _.yDomain(v.domain()), k.length && d3.transition(Y).call(S), P.length && d3.transition(Z).call(_), N.length && d3.transition(j).call(b), L.length && d3.transition(K).call(E), O.length && d3.transition(H).call(h), R.length && d3.transition(q).call(y), w._ticks(t.utils.calcTicksX(D / 100, c)).tickSize(-M, 0), z.select(".nv-x.nv-axis").attr("transform", "translate(0," + M + ")"), d3.transition(z.select(".nv-x.nv-axis")).call(w), A._ticks(t.utils.calcTicksY(M / 36, c)).tickSize(-D, 0), d3.transition(z.select(".nv-y1.nv-axis")).call(A), T._ticks(t.utils.calcTicksY(M / 36, c)).tickSize(-D, 0), d3.transition(z.select(".nv-y2.nv-axis")).call(T), z.select(".nv-y1.nv-axis").classed("nv-disabled", !G.length).attr("transform", "translate(" + p.range()[0] + ",0)"), z.select(".nv-y2.nv-axis").classed("nv-disabled", !F.length).attr("transform", "translate(" + p.range()[1] + ",0)"), C.dispatch.on("stateChange", function(t) {
e.update()
}), h.dispatch.on("elementMouseover.tooltip", u), y.dispatch.on("elementMouseover.tooltip", u), h.dispatch.on("elementMouseout.tooltip", function(e) {
I.hidden(!0)
}), y.dispatch.on("elementMouseout.tooltip", function(e) {
I.hidden(!0)
}), S.dispatch.on("elementMouseover.tooltip", d), _.dispatch.on("elementMouseover.tooltip", d), S.dispatch.on("elementMouseout.tooltip", function(e) {
I.hidden(!0)
}), _.dispatch.on("elementMouseout.tooltip", function(e) {
I.hidden(!0)
}), b.dispatch.on("elementMouseover.tooltip", m), E.dispatch.on("elementMouseover.tooltip", m), b.dispatch.on("elementMouseout.tooltip", function(e) {
I.hidden(!0)
}), E.dispatch.on("elementMouseout.tooltip", function(e) {
I.hidden(!0)
}), b.dispatch.on("elementMousemove.tooltip", function(e) {
I.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), E.dispatch.on("elementMousemove.tooltip", function(e) {
I.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
})
}), e
}
var n, r, o = {
top: 30,
right: 20,
bottom: 50,
left: 60
},
i = t.utils.defaultColor(),
a = null,
s = null,
l = !0,
c = null,
u = function(e) {
return e.x
},
d = function(e) {
return e.y
},
f = "monotone",
m = !0,
p = d3.scale.linear(),
g = d3.scale.linear(),
v = d3.scale.linear(),
h = t.models.line().yScale(g),
y = t.models.line().yScale(v),
b = t.models.multiBar().stacked(!1).yScale(g),
E = t.models.multiBar().stacked(!1).yScale(v),
S = t.models.stackedArea().yScale(g),
_ = t.models.stackedArea().yScale(v),
w = t.models.axis().scale(p).orient("bottom").tickPadding(5),
A = t.models.axis().scale(g).orient("left"),
T = t.models.axis().scale(v).orient("right"),
C = t.models.legend().height(30),
I = t.models.tooltip(),
x = d3.dispatch();
return e.dispatch = x, e.lines1 = h, e.lines2 = y, e.bars1 = b, e.bars2 = E, e.stack1 = S, e.stack2 = _, e.xAxis = w, e.yAxis1 = A, e.yAxis2 = T, e.tooltip = I, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
height: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
showLegend: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
yDomain1: {
get: function() {
return n
},
set: function(e) {
n = e
}
},
yDomain2: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
noData: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
interpolate: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
tooltips: {
get: function() {
return I.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), I.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return I.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), I.contentGenerator(e)
}
},
margin: {
get: function() {
return o
},
set: function(e) {
o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left
}
},
color: {
get: function() {
return i
},
set: function(e) {
i = t.utils.getColor(e)
}
},
x: {
get: function() {
return u
},
set: function(e) {
u = e, h.x(e), y.x(e), b.x(e), E.x(e), S.x(e), _.x(e)
}
},
y: {
get: function() {
return d
},
set: function(e) {
d = e, h.y(e), y.y(e), S.y(e), _.y(e), b.y(e), E.y(e)
}
},
useVoronoi: {
get: function() {
return m
},
set: function(e) {
m = e, h.useVoronoi(e), y.useVoronoi(e), S.useVoronoi(e), _.useVoronoi(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.ohlcBar = function() {
"use strict";
function e(A) {
return A.each(function(e) {
u = d3.select(this);
var A = t.utils.availableWidth(s, u, a),
C = t.utils.availableHeight(l, u, a);
t.utils.initSVG(u);
var I = A / e[0].values.length * .9;
d.domain(n || d3.extent(e[0].values.map(m).concat(b))), S ? d.range(o || [.5 * A / e[0].values.length, A * (e[0].values.length - .5) / e[0].values.length]) : d.range(o || [5 + I / 2, A - I / 2 - 5]), f.domain(r || [d3.min(e[0].values.map(y).concat(E)), d3.max(e[0].values.map(h).concat(E))]).range(i || [C, 0]), d.domain()[0] === d.domain()[1] && (d.domain()[0] ? d.domain([d.domain()[0] - .01 * d.domain()[0], d.domain()[1] + .01 * d.domain()[1]]) : d.domain([-1, 1])), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] + .01 * f.domain()[0], f.domain()[1] - .01 * f.domain()[1]]) : f.domain([-1, 1]));
var x = d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([e[0].values]),
D = x.enter().append("g").attr("class", "nvd3 nv-wrap nv-ohlcBar"),
M = D.append("defs"),
O = D.append("g"),
R = x.select("g");
O.append("g").attr("class", "nv-ticks"), x.attr("transform", "translate(" + a.left + "," + a.top + ")"), u.on("click", function(e, t) {
T.chartClick({
data: e,
index: t,
pos: d3.event,
id: c
})
}), M.append("clipPath").attr("id", "nv-chart-clip-path-" + c).append("rect"), x.select("#nv-chart-clip-path-" + c + " rect").attr("width", A).attr("height", C), R.attr("clip-path", _ ? "url(#nv-chart-clip-path-" + c + ")" : "");
var N = x.select(".nv-ticks").selectAll(".nv-tick").data(function(e) {
return e
});
N.exit().remove(), N.enter().append("path").attr("class", function(e, t, n) {
return (g(e, t) > v(e, t) ? "nv-tick negative" : "nv-tick positive") + " nv-tick-" + n + "-" + t
}).attr("d", function(e, t) {
return "m0,0l0," + (f(g(e, t)) - f(h(e, t))) + "l" + -I / 2 + ",0l" + I / 2 + ",0l0," + (f(y(e, t)) - f(g(e, t))) + "l0," + (f(v(e, t)) - f(y(e, t))) + "l" + I / 2 + ",0l" + -I / 2 + ",0z"
}).attr("transform", function(e, t) {
return "translate(" + d(m(e, t)) + "," + f(h(e, t)) + ")"
}).attr("fill", function(e, t) {
return w[0]
}).attr("stroke", function(e, t) {
return w[0]
}).attr("x", 0).attr("y", function(e, t) {
return f(Math.max(0, p(e, t)))
}).attr("height", function(e, t) {
return Math.abs(f(p(e, t)) - f(0))
}), N.attr("class", function(e, t, n) {
return (g(e, t) > v(e, t) ? "nv-tick negative" : "nv-tick positive") + " nv-tick-" + n + "-" + t
}), d3.transition(N).attr("transform", function(e, t) {
return "translate(" + d(m(e, t)) + "," + f(h(e, t)) + ")"
}).attr("d", function(t, n) {
var r = A / e[0].values.length * .9;
return "m0,0l0," + (f(g(t, n)) - f(h(t, n))) + "l" + -r / 2 + ",0l" + r / 2 + ",0l0," + (f(y(t, n)) - f(g(t, n))) + "l0," + (f(v(t, n)) - f(y(t, n))) + "l" + r / 2 + ",0l" + -r / 2 + ",0z"
})
}), e
}
var n, r, o, i, a = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
s = null,
l = null,
c = Math.floor(1e4 * Math.random()),
u = null,
d = d3.scale.linear(),
f = d3.scale.linear(),
m = function(e) {
return e.x
},
p = function(e) {
return e.y
},
g = function(e) {
return e.open
},
v = function(e) {
return e.close
},
h = function(e) {
return e.high
},
y = function(e) {
return e.low
},
b = [],
E = [],
S = !1,
_ = !0,
w = t.utils.defaultColor(),
A = !1,
T = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd", "chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove");
return e.highlightPoint = function(t, n) {
e.clearHighlights(), u.select(".nv-ohlcBar .nv-tick-0-" + t).classed("hover", n)
}, e.clearHighlights = function() {
u.select(".nv-ohlcBar .nv-tick.hover").classed("hover", !1)
}, e.dispatch = T, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
height: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
xScale: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
yScale: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
xDomain: {
get: function() {
return n
},
set: function(e) {
n = e
}
},
yDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
xRange: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
yRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
forceX: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
forceY: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
padData: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
clipEdge: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
id: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
interactive: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
x: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
y: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
open: {
get: function() {
return g()
},
set: function(e) {
g = e
}
},
close: {
get: function() {
return v()
},
set: function(e) {
v = e
}
},
high: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
low: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
margin: {
get: function() {
return a
},
set: function(e) {
a.top = void 0 != e.top ? e.top : a.top, a.right = void 0 != e.right ? e.right : a.right, a.bottom = void 0 != e.bottom ? e.bottom : a.bottom, a.left = void 0 != e.left ? e.left : a.left
}
},
color: {
get: function() {
return w
},
set: function(e) {
w = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.parallelCoordinates = function() {
"use strict";
function e(g) {
return g.each(function(e) {
function g(e) {
return O(s.map(function(t) {
if (isNaN(e[t]) || isNaN(parseFloat(e[t]))) {
var n = a[t].domain(),
r = a[t].range(),
o = n[0] - (n[1] - n[0]) / 9;
if (k.indexOf(t) < 0) {
var s = d3.scale.linear().domain([o, n[1]]).range([w - 12, r[1]]);
a[t].brush.y(s), k.push(t)
}
return [i(t), a[t](o)]
}
return k.length > 0 ? (D.style("display", "inline"), M.style("display", "inline")) : (D.style("display", "none"), M.style("display", "none")), [i(t), a[t](e[t])]
}))
}
function v() {
var e = s.filter(function(e) {
return !a[e].brush.empty()
}),
t = e.map(function(e) {
return a[e].brush.extent()
});
u = [], e.forEach(function(e, n) {
u[n] = {
dimension: e,
extent: t[n]
}
}), d = [], F.style("display", function(n) {
var r = e.every(function(e, r) {
return !(!isNaN(n[e]) || t[r][0] != a[e].brush.y().domain()[0]) || t[r][0] <= n[e] && n[e] <= t[r][1]
});
return r && d.push(n), r ? null : "none"
}), p.brush({
filters: u,
active: d
})
}
function h(e, t) {
f[e] = this.parentNode.__origin__ = i(e), G.attr("visibility", "hidden")
}
function y(e, t) {
f[e] = Math.min(_, Math.max(0, this.parentNode.__origin__ += d3.event.x)), F.attr("d", g), s.sort(function(e, t) {
return E(e) - E(t)
}), i.domain(s), U.attr("transform", function(e) {
return "translate(" + E(e) + ")"
})
}
function b(e, t) {
delete this.parentNode.__origin__, delete f[e], d3.select(this.parentNode).attr("transform", "translate(" + i(e) + ")"), F.attr("d", g), G.attr("d", g).attr("visibility", null)
}
function E(e) {
var t = f[e];
return null == t ? i(e) : t
}
var S = d3.select(this),
_ = t.utils.availableWidth(r, S, n),
w = t.utils.availableHeight(o, S, n);
t.utils.initSVG(S), d = e, i.rangePoints([0, _], 1).domain(s);
var A = {};
s.forEach(function(t) {
var n = d3.extent(e, function(e) {
return +e[t]
});
return A[t] = !1, void 0 === n[0] && (A[t] = !0, n[0] = 0, n[1] = 0), n[0] === n[1] && (n[0] = n[0] - 1, n[1] = n[1] + 1), a[t] = d3.scale.linear().domain(n).range([.9 * (w - 12), 0]), a[t].brush = d3.svg.brush().y(a[t]).on("brush", v), "name" != t
});
var T = S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([e]),
C = T.enter().append("g").attr("class", "nvd3 nv-wrap nv-parallelCoordinates"),
I = C.append("g"),
x = T.select("g");
I.append("g").attr("class", "nv-parallelCoordinates background"), I.append("g").attr("class", "nv-parallelCoordinates foreground"), I.append("g").attr("class", "nv-parallelCoordinates missingValuesline"), T.attr("transform", "translate(" + n.left + "," + n.top + ")");
var D, M, O = d3.svg.line().interpolate("cardinal").tension(m),
R = d3.svg.axis().orient("left"),
N = d3.behavior.drag().on("dragstart", h).on("drag", y).on("dragend", b),
L = i.range()[1] - i.range()[0],
k = [],
P = [0 + L / 2, w - 12, _ - L / 2, w - 12];
D = T.select(".missingValuesline").selectAll("line").data([P]), D.enter().append("line"), D.exit().remove(), D.attr("x1", function(e) {
return e[0]
}).attr("y1", function(e) {
return e[1]
}).attr("x2", function(e) {
return e[2]
}).attr("y2", function(e) {
return e[3]
}), M = T.select(".missingValuesline").selectAll("text").data(["undefined values"]), M.append("text").data(["undefined values"]), M.enter().append("text"), M.exit().remove(), M.attr("y", w).attr("x", _ - 92 - L / 2).text(function(e) {
return e
});
var G = T.select(".background").selectAll("path").data(e);
G.enter().append("path"), G.exit().remove(), G.attr("d", g);
var F = T.select(".foreground").selectAll("path").data(e);
F.enter().append("path"), F.exit().remove(), F.attr("d", g).attr("stroke", c), F.on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0), p.elementMouseover({
label: e.name,
data: e.data,
index: t,
pos: [d3.mouse(this.parentNode)[0], d3.mouse(this.parentNode)[1]]
})
}), F.on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1), p.elementMouseout({
label: e.name,
data: e.data,
index: t
})
});
var U = x.selectAll(".dimension").data(s),
V = U.enter().append("g").attr("class", "nv-parallelCoordinates dimension");
V.append("g").attr("class", "nv-parallelCoordinates nv-axis"), V.append("g").attr("class", "nv-parallelCoordinates-brush"), V.append("text").attr("class", "nv-parallelCoordinates nv-label"), U.attr("transform", function(e) {
return "translate(" + i(e) + ",0)"
}), U.exit().remove(), U.select(".nv-label").style("cursor", "move").attr("dy", "-1em").attr("text-anchor", "middle").text(String).on("mouseover", function(e, t) {
p.elementMouseover({
dim: e,
pos: [d3.mouse(this.parentNode.parentNode)[0], d3.mouse(this.parentNode.parentNode)[1]]
})
}).on("mouseout", function(e, t) {
p.elementMouseout({
dim: e
})
}).call(N), U.select(".nv-axis").each(function(e, t) {
d3.select(this).call(R.scale(a[e]).tickFormat(d3.format(l[t])))
}), U.select(".nv-parallelCoordinates-brush").each(function(e) {
d3.select(this).call(a[e].brush)
}).selectAll("rect").attr("x", -8).attr("width", 16)
}), e
}
var n = {
top: 30,
right: 0,
bottom: 10,
left: 0
},
r = null,
o = null,
i = d3.scale.ordinal(),
a = {},
s = [],
l = [],
c = t.utils.defaultColor(),
u = [],
d = [],
f = [],
m = 1,
p = d3.dispatch("brush", "elementMouseover", "elementMouseout");
return e.dispatch = p, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
height: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
dimensionNames: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
dimensionFormats: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
lineTension: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
dimensions: {
get: function() {
return s
},
set: function(e) {
t.deprecated("dimensions", "use dimensionNames instead"), s = e
}
},
margin: {
get: function() {
return n
},
set: function(e) {
n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left
}
},
color: {
get: function() {
return c
},
set: function(e) {
c = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.pie = function() {
"use strict";
function e(M) {
return D.reset(), M.each(function(e) {
function M(e, t) {
e.endAngle = isNaN(e.endAngle) ? 0 : e.endAngle, e.startAngle = isNaN(e.startAngle) ? 0 : e.startAngle, g || (e.innerRadius = 0);
var n = d3.interpolate(this._current, e);
return this._current = n(0),
function(e) {
return I[t](n(e))
}
}
var O = r - n.left - n.right,
R = o - n.top - n.bottom,
N = Math.min(O, R) / 2,
L = [],
k = [];
if (l = d3.select(this), 0 === T.length)
for (var P = N - N / 5, G = A * N, F = 0; F < e[0].length; F++) L.push(P), k.push(G);
else L = T.map(function(e) {
return (e.outer - e.outer / 5) * N
}), k = T.map(function(e) {
return (e.inner - e.inner / 5) * N
}), A = d3.min(T.map(function(e) {
return e.inner - e.inner / 5
}));
t.utils.initSVG(l);
var U = l.selectAll(".nv-wrap.nv-pie").data(e),
V = U.enter().append("g").attr("class", "nvd3 nv-wrap nv-pie nv-chart-" + s),
z = V.append("g"),
B = U.select("g"),
$ = z.append("g").attr("class", "nv-pie");
z.append("g").attr("class", "nv-pieLabels"), U.attr("transform", "translate(" + n.left + "," + n.top + ")"), B.select(".nv-pie").attr("transform", "translate(" + O / 2 + "," + R / 2 + ")"), B.select(".nv-pieLabels").attr("transform", "translate(" + O / 2 + "," + R / 2 + ")"), l.on("click", function(e, t) {
C.chartClick({
data: e,
index: t,
pos: d3.event,
id: s
})
}), I = [], x = [];
for (var F = 0; F < e[0].length; F++) {
var W = d3.svg.arc().outerRadius(L[F]),
H = d3.svg.arc().outerRadius(L[F] + 5);
E !== !1 && (W.startAngle(E), H.startAngle(E)), _ !== !1 && (W.endAngle(_), H.endAngle(_)), g && (W.innerRadius(k[F]), H.innerRadius(k[F])), W.cornerRadius && w && (W.cornerRadius(w), H.cornerRadius(w)), I.push(W), x.push(H)
}
var j = d3.layout.pie().sort(null).value(function(e) {
return e.disabled ? 0 : a(e)
});
j.padAngle && S && j.padAngle(S), g && v && ($.append("text").attr("class", "nv-pie-title"), U.select(".nv-pie-title").style("text-anchor", "middle").text(function(e) {
return v
}).style("font-size", Math.min(O, R) * A * 2 / (v.length + 2) + "px").attr("dy", "0.35em").attr("transform", function(e, t) {
return "translate(0, " + y + ")"
}));
var Y = U.select(".nv-pie").selectAll(".nv-slice").data(j),
q = U.select(".nv-pieLabels").selectAll(".nv-label").data(j);
Y.exit().remove(), q.exit().remove();
var K = Y.enter().append("g");
K.attr("class", "nv-slice"), K.on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0), h && d3.select(this).select("path").transition().duration(70).attr("d", x[t]), C.elementMouseover({
data: e.data,
index: t,
color: d3.select(this).style("fill")
})
}), K.on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1), h && d3.select(this).select("path").transition().duration(50).attr("d", I[t]), C.elementMouseout({
data: e.data,
index: t
})
}), K.on("mousemove", function(e, t) {
C.elementMousemove({
data: e.data,
index: t
})
}), K.on("click", function(e, t) {
C.elementClick({
data: e.data,
index: t,
color: d3.select(this).style("fill")
})
}), K.on("dblclick", function(e, t) {
C.elementDblClick({
data: e.data,
index: t,
color: d3.select(this).style("fill")
})
}), Y.attr("fill", function(e, t) {
return c(e.data, t)
}), Y.attr("stroke", function(e, t) {
return c(e.data, t)
});
K.append("path").each(function(e) {
this._current = e
});
if (Y.select("path").transition().attr("d", function(e, t) {
return I[t](e)
}).attrTween("d", M), d) {
for (var Z = [], F = 0; F < e[0].length; F++) Z.push(I[F]), f ? g && (Z[F] = d3.svg.arc().outerRadius(I[F].outerRadius()), E !== !1 && Z[F].startAngle(E), _ !== !1 && Z[F].endAngle(_)) : g || Z[F].innerRadius(0);
q.enter().append("g").classed("nv-label", !0).each(function(e, t) {
var n = d3.select(this);
n.attr("transform", function(e, t) {
if (b) {
e.outerRadius = L[t] + 10, e.innerRadius = L[t] + 15;
var n = (e.startAngle + e.endAngle) / 2 * (180 / Math.PI);
return (e.startAngle + e.endAngle) / 2 < Math.PI ? n -= 90 : n += 90, "translate(" + Z[t].centroid(e) + ") rotate(" + n + ")"
}
return e.outerRadius = N + 10, e.innerRadius = N + 15, "translate(" + Z[t].centroid(e) + ")"
}), n.append("rect").style("stroke", "#fff").style("fill", "#fff").attr("rx", 3).attr("ry", 3), n.append("text").style("text-anchor", b ? (e.startAngle + e.endAngle) / 2 < Math.PI ? "start" : "end" : "middle").style("fill", "#000")
});
var Q = {},
X = 14,
J = 140,
ee = function(e) {
return Math.floor(e[0] / J) * J + "," + Math.floor(e[1] / X) * X
};
q.watchTransition(D, "pie labels").attr("transform", function(e, t) {
if (b) {
e.outerRadius = L[t] + 10, e.innerRadius = L[t] + 15;
var n = (e.startAngle + e.endAngle) / 2 * (180 / Math.PI);
return (e.startAngle + e.endAngle) / 2 < Math.PI ? n -= 90 : n += 90, "translate(" + Z[t].centroid(e) + ") rotate(" + n + ")"
}
e.outerRadius = N + 10, e.innerRadius = N + 15;
var r = Z[t].centroid(e);
if (e.value) {
var o = ee(r);
Q[o] && (r[1] -= X), Q[ee(r)] = !0
}
return "translate(" + r + ")"
}), q.select(".nv-label text").style("text-anchor", function(e, t) {
return b ? (e.startAngle + e.endAngle) / 2 < Math.PI ? "start" : "end" : "middle"
}).text(function(e, t) {
var n = (e.endAngle - e.startAngle) / (2 * Math.PI),
r = "";
if (!e.value || n < p) return "";
if ("function" == typeof m) r = m(e, t, {
key: i(e.data),
value: a(e.data),
percent: u(n)
});
else switch (m) {
case "key":
r = i(e.data);
break;
case "value":
r = u(a(e.data));
break;
case "percent":
r = d3.format("%")(n)
}
return r
})
}
}), D.renderEnd("pie immediate"), e
}
var n = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
r = 500,
o = 500,
i = function(e) {
return e.x
},
a = function(e) {
return e.y
},
s = Math.floor(1e4 * Math.random()),
l = null,
c = t.utils.defaultColor(),
u = d3.format(",.2f"),
d = !0,
f = !1,
m = "key",
p = .02,
g = !1,
v = !1,
h = !0,
y = 0,
b = !1,
E = !1,
S = !1,
_ = !1,
w = 0,
A = .5,
T = [],
C = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"),
I = [],
x = [],
D = t.utils.renderWatch(C);
return e.dispatch = C, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
arcsRadius: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
width: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
height: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
showLabels: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
title: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
titleOffset: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
labelThreshold: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
valueFormat: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
x: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
id: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
endAngle: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
startAngle: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
padAngle: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
cornerRadius: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
donutRatio: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
labelsOutside: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
labelSunbeamLayout: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
donut: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
growOnHover: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
pieLabelsOutside: {
get: function() {
return f
},
set: function(e) {
f = e, t.deprecated("pieLabelsOutside", "use labelsOutside instead")
}
},
donutLabelsOutside: {
get: function() {
return f
},
set: function(e) {
f = e, t.deprecated("donutLabelsOutside", "use labelsOutside instead")
}
},
labelFormat: {
get: function() {
return u
},
set: function(e) {
u = e, t.deprecated("labelFormat", "use valueFormat instead")
}
},
margin: {
get: function() {
return n
},
set: function(e) {
n.top = "undefined" != typeof e.top ? e.top : n.top, n.right = "undefined" != typeof e.right ? e.right : n.right, n.bottom = "undefined" != typeof e.bottom ? e.bottom : n.bottom, n.left = "undefined" != typeof e.left ? e.left : n.left
}
},
y: {
get: function() {
return a
},
set: function(e) {
a = d3.functor(e)
}
},
color: {
get: function() {
return c
},
set: function(e) {
c = t.utils.getColor(e)
}
},
labelType: {
get: function() {
return m
},
set: function(e) {
m = e || "key"
}
}
}), t.utils.initOptions(e), e
}, t.models.pieChart = function() {
"use strict";
function e(o) {
return v.reset(), v.models(n), o.each(function(o) {
var u = d3.select(this);
t.utils.initSVG(u);
var m = t.utils.availableWidth(a, u, i),
p = t.utils.availableHeight(s, u, i);
if (e.update = function() {
u.transition().call(e)
}, e.container = this, d.setter(y(o), e.update).getter(h(o)).update(), d.disabled = o.map(function(e) {
return !!e.disabled
}), !f) {
var v;
f = {};
for (v in d) d[v] instanceof Array ? f[v] = d[v].slice(0) : f[v] = d[v]
}
if (!o || !o.length) return t.utils.noData(e, u), e;
u.selectAll(".nv-noData").remove();
var b = u.selectAll("g.nv-wrap.nv-pieChart").data([o]),
E = b.enter().append("g").attr("class", "nvd3 nv-wrap nv-pieChart").append("g"),
S = b.select("g");
if (E.append("g").attr("class", "nv-pieWrap"), E.append("g").attr("class", "nv-legendWrap"), l)
if ("top" === c) r.width(m).key(n.x()), b.select(".nv-legendWrap").datum(o).call(r), i.top != r.height() && (i.top = r.height(), p = t.utils.availableHeight(s, u, i)), b.select(".nv-legendWrap").attr("transform", "translate(0," + -i.top + ")");
else if ("right" === c) {
var _ = t.models.legend().width();
m / 2 < _ && (_ = m / 2), r.height(p).key(n.x()), r.width(_), m -= r.width(), b.select(".nv-legendWrap").datum(o).call(r).attr("transform", "translate(" + m + ",0)")
}
b.attr("transform", "translate(" + i.left + "," + i.top + ")"), n.width(m).height(p);
var w = S.select(".nv-pieWrap").datum([o]);
d3.transition(w).call(n), r.dispatch.on("stateChange", function(t) {
for (var n in t) d[n] = t[n];
g.stateChange(d), e.update()
}), g.on("changeState", function(t) {
"undefined" != typeof t.disabled && (o.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), d.disabled = t.disabled), e.update()
})
}), v.renderEnd("pieChart immediate"), e
}
var n = t.models.pie(),
r = t.models.legend(),
o = t.models.tooltip(),
i = {
top: 30,
right: 20,
bottom: 20,
left: 20
},
a = null,
s = null,
l = !0,
c = "top",
u = t.utils.defaultColor(),
d = t.utils.state(),
f = null,
m = null,
p = 250,
g = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd");
o.headerEnabled(!1).duration(0).valueFormatter(function(e, t) {
return n.valueFormat()(e, t)
});
var v = t.utils.renderWatch(g),
h = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
})
}
}
},
y = function(e) {
return function(t) {
void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
};
return n.dispatch.on("elementMouseover.tooltip", function(t) {
t.series = {
key: e.x()(t.data),
value: e.y()(t.data),
color: t.color
}, o.data(t).hidden(!1)
}), n.dispatch.on("elementMouseout.tooltip", function(e) {
o.hidden(!0)
}), n.dispatch.on("elementMousemove.tooltip", function(e) {
o.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.legend = r, e.dispatch = g, e.pie = n, e.tooltip = o, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
noData: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
showLegend: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
legendPosition: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
defaultState: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
tooltips: {
get: function() {
return o.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), o.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return o.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), o.contentGenerator(e)
}
},
color: {
get: function() {
return u
},
set: function(e) {
u = e, r.color(u), n.color(u)
}
},
duration: {
get: function() {
return p
},
set: function(e) {
p = e, v.reset(p)
}
},
margin: {
get: function() {
return i
},
set: function(e) {
i.top = void 0 !== e.top ? e.top : i.top, i.right = void 0 !== e.right ? e.right : i.right, i.bottom = void 0 !== e.bottom ? e.bottom : i.bottom, i.left = void 0 !== e.left ? e.left : i.left
}
}
}), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e
}, t.models.scatter = function() {
"use strict";
function e(U) {
return z.reset(), U.each(function(e) {
function U() {
if (V = !1, !_) return !1;
if (F === !0) {
var t = d3.merge(e.map(function(e, t) {
return e.values.map(function(e, n) {
var r = g(e, n),
o = v(e, n);
return [f(r) + 1e-4 * Math.random(), m(o) + 1e-4 * Math.random(), t, n, e]
}).filter(function(e, t) {
return w(e[4], t)
})
}));
if (0 == t.length) return !1;
t.length < 3 && (t.push([f.range()[0] - 20, m.range()[0] - 20, null, null]), t.push([f.range()[1] + 20, m.range()[1] + 20, null, null]), t.push([f.range()[0] - 20, m.range()[0] + 20, null, null]), t.push([f.range()[1] + 20, m.range()[1] - 20, null, null]));
var n = d3.geom.polygon([
[-10, -10],
[-10, l + 10],
[s + 10, l + 10],
[s + 10, -10]
]),
r = d3.geom.voronoi(t).map(function(e, r) {
return {
data: n.clip(e),
series: t[r][2],
point: t[r][3]
}
});
j.select(".nv-point-paths").selectAll("path").remove();
var o = j.select(".nv-point-paths").selectAll("path").data(r),
i = o.enter().append("svg:path").attr("d", function(e) {
return e && e.data && 0 !== e.data.length ? "M" + e.data.join(",") + "Z" : "M 0 0"
}).attr("id", function(e, t) {
return "nv-path-" + t
}).attr("clip-path", function(e, t) {
return "url(#nv-clip-" + t + ")"
});
x && i.style("fill", d3.rgb(230, 230, 230)).style("fill-opacity", .4).style("stroke-opacity", 1).style("stroke", d3.rgb(200, 200, 200)), I && (j.select(".nv-point-clips").selectAll("clipPath").remove(), j.select(".nv-point-clips").selectAll("clipPath").data(t).enter().append("svg:clipPath").attr("id", function(e, t) {
return "nv-clip-" + t
}).append("svg:circle").attr("cx", function(e) {
return e[0]
}).attr("cy", function(e) {
return e[1]
}).attr("r", D));
var u = function(t, n) {
if (V) return 0;
var r = e[t.series];
if (void 0 !== r) {
var o = r.values[t.point];
o.color = c(r, t.series), o.x = g(o), o.y = v(o);
var i = d.node().getBoundingClientRect(),
s = window.pageYOffset || document.documentElement.scrollTop,
l = window.pageXOffset || document.documentElement.scrollLeft,
u = {
left: f(g(o, t.point)) + i.left + l + a.left + 10,
top: m(v(o, t.point)) + i.top + s + a.top + 10
};
n({
point: o,
series: r,
pos: u,
seriesIndex: t.series,
pointIndex: t.point
})
}
};
o.on("click", function(e) {
u(e, G.elementClick)
}).on("dblclick", function(e) {
u(e, G.elementDblClick)
}).on("mouseover", function(e) {
u(e, G.elementMouseover)
}).on("mouseout", function(e, t) {
u(e, G.elementMouseout)
})
} else j.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click", function(t, n) {
if (V || !e[t.series]) return 0;
var r = e[t.series],
o = r.values[n];
G.elementClick({
point: o,
series: r,
pos: [f(g(o, n)) + a.left, m(v(o, n)) + a.top],
seriesIndex: t.series,
pointIndex: n
})
}).on("dblclick", function(t, n) {
if (V || !e[t.series]) return 0;
var r = e[t.series],
o = r.values[n];
G.elementDblClick({
point: o,
series: r,
pos: [f(g(o, n)) + a.left, m(v(o, n)) + a.top],
seriesIndex: t.series,
pointIndex: n
})
}).on("mouseover", function(t, n) {
if (V || !e[t.series]) return 0;
var r = e[t.series],
o = r.values[n];
G.elementMouseover({
point: o,
series: r,
pos: [f(g(o, n)) + a.left, m(v(o, n)) + a.top],
seriesIndex: t.series,
pointIndex: n,
color: c(t, n)
})
}).on("mouseout", function(t, n) {
if (V || !e[t.series]) return 0;
var r = e[t.series],
o = r.values[n];
G.elementMouseout({
point: o,
series: r,
seriesIndex: t.series,
pointIndex: n,
color: c(t, n)
})
})
}
d = d3.select(this);
var $ = t.utils.availableWidth(s, d, a),
W = t.utils.availableHeight(l, d, a);
t.utils.initSVG(d), e.forEach(function(e, t) {
e.values.forEach(function(e) {
e.series = t
})
});
var H = M && O && L ? [] : d3.merge(e.map(function(e) {
return e.values.map(function(e, t) {
return {
x: g(e, t),
y: v(e, t),
size: h(e, t)
}
})
}));
f.domain(M || d3.extent(H.map(function(e) {
return e.x
}).concat(b))), A && e[0] ? f.range(R || [($ * T + $) / (2 * e[0].values.length), $ - $ * (1 + T) / (2 * e[0].values.length)]) : f.range(R || [0, $]), m.domain(O || d3.extent(H.map(function(e) {
return e.y
}).concat(E))).range(N || [W, 0]), p.domain(L || d3.extent(H.map(function(e) {
return e.size
}).concat(S))).range(k || B), P = f.domain()[0] === f.domain()[1] || m.domain()[0] === m.domain()[1], f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] - .01 * f.domain()[0], f.domain()[1] + .01 * f.domain()[1]]) : f.domain([-1, 1])), m.domain()[0] === m.domain()[1] && (m.domain()[0] ? m.domain([m.domain()[0] - .01 * m.domain()[0], m.domain()[1] + .01 * m.domain()[1]]) : m.domain([-1, 1])), isNaN(f.domain()[0]) && f.domain([-1, 1]), isNaN(m.domain()[0]) && m.domain([-1, 1]), n = n || f, r = r || m, o = o || p;
var j = d.selectAll("g.nv-wrap.nv-scatter").data([e]),
Y = j.enter().append("g").attr("class", "nvd3 nv-wrap nv-scatter nv-chart-" + u),
q = Y.append("defs"),
K = Y.append("g"),
Z = j.select("g");
j.classed("nv-single-point", P), K.append("g").attr("class", "nv-groups"), K.append("g").attr("class", "nv-point-paths"), Y.append("g").attr("class", "nv-point-clips"), j.attr("transform", "translate(" + a.left + "," + a.top + ")"), q.append("clipPath").attr("id", "nv-edge-clip-" + u).append("rect"), j.select("#nv-edge-clip-" + u + " rect").attr("width", $).attr("height", W > 0 ? W : 0), Z.attr("clip-path", C ? "url(#nv-edge-clip-" + u + ")" : ""), V = !0;
var Q = j.select(".nv-groups").selectAll(".nv-group").data(function(e) {
return e
}, function(e) {
return e.key
});
Q.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6), Q.exit().remove(), Q.attr("class", function(e, t) {
return "nv-group nv-series-" + t
}).classed("hover", function(e) {
return e.hover
}), Q.watchTransition(z, "scatter: groups").style("fill", function(e, t) {
return c(e, t)
}).style("stroke", function(e, t) {
return c(e, t)
}).style("stroke-opacity", 1).style("fill-opacity", .5);
var X = Q.selectAll("path.nv-point").data(function(e) {
return e.values.map(function(e, t) {
return [e, t]
}).filter(function(e, t) {
return w(e[0], t)
})
});
X.enter().append("path").style("fill", function(e) {
return e.color
}).style("stroke", function(e) {
return e.color
}).attr("transform", function(e) {
return "translate(" + n(g(e[0], e[1])) + "," + r(v(e[0], e[1])) + ")"
}).attr("d", t.utils.symbol().type(function(e) {
return y(e[0])
}).size(function(e) {
return p(h(e[0], e[1]))
})), X.exit().remove(), Q.exit().selectAll("path.nv-point").watchTransition(z, "scatter exit").attr("transform", function(e) {
return "translate(" + f(g(e[0], e[1])) + "," + m(v(e[0], e[1])) + ")"
}).remove(), X.each(function(e) {
d3.select(this).classed("nv-point", !0).classed("nv-point-" + e[1], !0).classed("nv-noninteractive", !_).classed("hover", !1)
}), X.watchTransition(z, "scatter points").attr("transform", function(e) {
return "translate(" + f(g(e[0], e[1])) + "," + m(v(e[0], e[1])) + ")"
}).attr("d", t.utils.symbol().type(function(e) {
return y(e[0])
}).size(function(e) {
return p(h(e[0], e[1]))
})), clearTimeout(i), i = setTimeout(U, 300), n = f.copy(), r = m.copy(), o = p.copy()
}), z.renderEnd("scatter immediate"), e
}
var n, r, o, i, a = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
s = null,
l = null,
c = t.utils.defaultColor(),
u = Math.floor(1e5 * Math.random()),
d = null,
f = d3.scale.linear(),
m = d3.scale.linear(),
p = d3.scale.linear(),
g = function(e) {
return e.x
},
v = function(e) {
return e.y
},
h = function(e) {
return e.size || 1
},
y = function(e) {
return e.shape || "circle"
},
b = [],
E = [],
S = [],
_ = !0,
w = function(e) {
return !e.notActive
},
A = !1,
T = .1,
C = !1,
I = !0,
x = !1,
D = function() {
return 25
},
M = null,
O = null,
R = null,
N = null,
L = null,
k = null,
P = !1,
G = d3.dispatch("elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "renderEnd"),
F = !0,
U = 250,
V = !1,
z = t.utils.renderWatch(G, U),
B = [16, 256];
return e.dispatch = G, e.options = t.utils.optionsFunc.bind(e), e._calls = new function() {
this.clearHighlights = function() {
return t.dom.write(function() {
d.selectAll(".nv-point.hover").classed("hover", !1)
}), null
}, this.highlightPoint = function(e, n, r) {
t.dom.write(function() {
d.select(" .nv-series-" + e + " .nv-point-" + n).classed("hover", r)
})
}
}, G.on("elementMouseover.point", function(t) {
_ && e._calls.highlightPoint(t.seriesIndex, t.pointIndex, !0)
}), G.on("elementMouseout.point", function(t) {
_ && e._calls.highlightPoint(t.seriesIndex, t.pointIndex, !1)
}), e._options = Object.create({}, {
width: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
height: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
xScale: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
yScale: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
pointScale: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
xDomain: {
get: function() {
return M
},
set: function(e) {
M = e
}
},
yDomain: {
get: function() {
return O
},
set: function(e) {
O = e
}
},
pointDomain: {
get: function() {
return L
},
set: function(e) {
L = e
}
},
xRange: {
get: function() {
return R
},
set: function(e) {
R = e
}
},
yRange: {
get: function() {
return N
},
set: function(e) {
N = e
}
},
pointRange: {
get: function() {
return k
},
set: function(e) {
k = e
}
},
forceX: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
forceY: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
forcePoint: {
get: function() {
return S
},
set: function(e) {
S = e
}
},
interactive: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
pointActive: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
padDataOuter: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
padData: {
get: function() {
return A
},
set: function(e) {
A = e
}
},
clipEdge: {
get: function() {
return C
},
set: function(e) {
C = e
}
},
clipVoronoi: {
get: function() {
return I
},
set: function(e) {
I = e
}
},
clipRadius: {
get: function() {
return D
},
set: function(e) {
D = e
}
},
showVoronoi: {
get: function() {
return x
},
set: function(e) {
x = e
}
},
id: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
x: {
get: function() {
return g
},
set: function(e) {
g = d3.functor(e)
}
},
y: {
get: function() {
return v
},
set: function(e) {
v = d3.functor(e)
}
},
pointSize: {
get: function() {
return h
},
set: function(e) {
h = d3.functor(e)
}
},
pointShape: {
get: function() {
return y
},
set: function(e) {
y = d3.functor(e)
}
},
margin: {
get: function() {
return a
},
set: function(e) {
a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left
}
},
duration: {
get: function() {
return U
},
set: function(e) {
U = e, z.reset(U)
}
},
color: {
get: function() {
return c
},
set: function(e) {
c = t.utils.getColor(e)
}
},
useVoronoi: {
get: function() {
return F
},
set: function(e) {
F = e, F === !1 && (I = !1)
}
}
}), t.utils.initOptions(e), e
}, t.models.scatterChart = function() {
"use strict";
function e(T) {
return D.reset(), D.models(n), b && D.models(r), E && D.models(o), v && D.models(a), h && D.models(s), T.each(function(T) {
f = d3.select(this), t.utils.initSVG(f);
var R = t.utils.availableWidth(u, f, c),
N = t.utils.availableHeight(d, f, c);
if (e.update = function() {
0 === C ? f.call(e) : f.transition().duration(C).call(e)
}, e.container = this, _.setter(O(T), e.update).getter(M(T)).update(), _.disabled = T.map(function(e) {
return !!e.disabled
}), !w) {
var L;
w = {};
for (L in _) _[L] instanceof Array ? w[L] = _[L].slice(0) : w[L] = _[L]
}
if (!(T && T.length && T.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, f), D.renderEnd("scatter immediate"), e;
f.selectAll(".nv-noData").remove(), p = n.xScale(), g = n.yScale();
var k = f.selectAll("g.nv-wrap.nv-scatterChart").data([T]),
P = k.enter().append("g").attr("class", "nvd3 nv-wrap nv-scatterChart nv-chart-" + n.id()),
G = P.append("g"),
F = k.select("g");
if (G.append("rect").attr("class", "nvd3 nv-background").style("pointer-events", "none"), G.append("g").attr("class", "nv-x nv-axis"), G.append("g").attr("class", "nv-y nv-axis"), G.append("g").attr("class", "nv-scatterWrap"), G.append("g").attr("class", "nv-regressionLinesWrap"), G.append("g").attr("class", "nv-distWrap"), G.append("g").attr("class", "nv-legendWrap"), S && F.select(".nv-y.nv-axis").attr("transform", "translate(" + R + ",0)"), y) {
var U = R;
i.width(U), k.select(".nv-legendWrap").datum(T).call(i), c.top != i.height() && (c.top = i.height(), N = t.utils.availableHeight(d, f, c)), k.select(".nv-legendWrap").attr("transform", "translate(0," + -c.top + ")")
}
k.attr("transform", "translate(" + c.left + "," + c.top + ")"), n.width(R).height(N).color(T.map(function(e, t) {
return e.color = e.color || m(e, t), e.color
}).filter(function(e, t) {
return !T[t].disabled
})), k.select(".nv-scatterWrap").datum(T.filter(function(e) {
return !e.disabled
})).call(n), k.select(".nv-regressionLinesWrap").attr("clip-path", "url(#nv-edge-clip-" + n.id() + ")");
var V = k.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(e) {
return e
});
V.enter().append("g").attr("class", "nv-regLines");
var z = V.selectAll(".nv-regLine").data(function(e) {
return [e]
});
z.enter().append("line").attr("class", "nv-regLine").style("stroke-opacity", 0), z.filter(function(e) {
return e.intercept && e.slope
}).watchTransition(D, "scatterPlusLineChart: regline").attr("x1", p.range()[0]).attr("x2", p.range()[1]).attr("y1", function(e, t) {
return g(p.domain()[0] * e.slope + e.intercept)
}).attr("y2", function(e, t) {
return g(p.domain()[1] * e.slope + e.intercept)
}).style("stroke", function(e, t, n) {
return m(e, n)
}).style("stroke-opacity", function(e, t) {
return e.disabled || "undefined" == typeof e.slope || "undefined" == typeof e.intercept ? 0 : 1
}), b && (r.scale(p)._ticks(t.utils.calcTicksX(R / 100, T)).tickSize(-N, 0), F.select(".nv-x.nv-axis").attr("transform", "translate(0," + g.range()[0] + ")").call(r)), E && (o.scale(g)._ticks(t.utils.calcTicksY(N / 36, T)).tickSize(-R, 0), F.select(".nv-y.nv-axis").call(o)), v && (a.getData(n.x()).scale(p).width(R).color(T.map(function(e, t) {
return e.color || m(e, t)
}).filter(function(e, t) {
return !T[t].disabled
})), G.select(".nv-distWrap").append("g").attr("class", "nv-distributionX"), F.select(".nv-distributionX").attr("transform", "translate(0," + g.range()[0] + ")").datum(T.filter(function(e) {
return !e.disabled
})).call(a)), h && (s.getData(n.y()).scale(g).width(N).color(T.map(function(e, t) {
return e.color || m(e, t)
}).filter(function(e, t) {
return !T[t].disabled
})), G.select(".nv-distWrap").append("g").attr("class", "nv-distributionY"), F.select(".nv-distributionY").attr("transform", "translate(" + (S ? R : -s.size()) + ",0)").datum(T.filter(function(e) {
return !e.disabled
})).call(s)), i.dispatch.on("stateChange", function(t) {
for (var n in t) _[n] = t[n];
A.stateChange(_), e.update()
}), A.on("changeState", function(t) {
"undefined" != typeof t.disabled && (T.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), _.disabled = t.disabled), e.update()
}), n.dispatch.on("elementMouseout.tooltip", function(e) {
l.hidden(!0), f.select(".nv-chart-" + n.id() + " .nv-series-" + e.seriesIndex + " .nv-distx-" + e.pointIndex).attr("y1", 0), f.select(".nv-chart-" + n.id() + " .nv-series-" + e.seriesIndex + " .nv-disty-" + e.pointIndex).attr("x2", s.size())
}), n.dispatch.on("elementMouseover.tooltip", function(e) {
f.select(".nv-series-" + e.seriesIndex + " .nv-distx-" + e.pointIndex).attr("y1", e.pos.top - N - c.top), f.select(".nv-series-" + e.seriesIndex + " .nv-disty-" + e.pointIndex).attr("x2", e.pos.left + a.size() - c.left), l.position(e.pos).data(e).hidden(!1)
}), I = p.copy(), x = g.copy()
}), D.renderEnd("scatter with line immediate"), e
}
var n = t.models.scatter(),
r = t.models.axis(),
o = t.models.axis(),
i = t.models.legend(),
a = t.models.distribution(),
s = t.models.distribution(),
l = t.models.tooltip(),
c = {
top: 30,
right: 20,
bottom: 50,
left: 75
},
u = null,
d = null,
f = null,
m = t.utils.defaultColor(),
p = n.xScale(),
g = n.yScale(),
v = !1,
h = !1,
y = !0,
b = !0,
E = !0,
S = !1,
_ = t.utils.state(),
w = null,
A = d3.dispatch("stateChange", "changeState", "renderEnd"),
T = null,
C = 250;
n.xScale(p).yScale(g), r.orient("bottom").tickPadding(10), o.orient(S ? "right" : "left").tickPadding(10), a.axis("x"), s.axis("y"), l.headerFormatter(function(e, t) {
return r.tickFormat()(e, t)
}).valueFormatter(function(e, t) {
return o.tickFormat()(e, t)
});
var I, x, D = t.utils.renderWatch(A, C),
M = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
})
}
}
},
O = function(e) {
return function(t) {
void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
};
return e.dispatch = A, e.scatter = n, e.legend = i, e.xAxis = r, e.yAxis = o, e.distX = a, e.distY = s, e.tooltip = l, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
height: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
container: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
showDistX: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
showDistY: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
showLegend: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
showXAxis: {
get: function() {
return b
},
set: function(e) {
b = e
}
},
showYAxis: {
get: function() {
return E
},
set: function(e) {
E = e
}
},
defaultState: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
noData: {
get: function() {
return T
},
set: function(e) {
T = e
}
},
duration: {
get: function() {
return C
},
set: function(e) {
C = e
}
},
tooltips: {
get: function() {
return l.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), l.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return l.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), l.contentGenerator(e)
}
},
tooltipXContent: {
get: function() {
return l.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "This option is removed, put values into main tooltip.")
}
},
tooltipYContent: {
get: function() {
return l.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "This option is removed, put values into main tooltip.")
}
},
margin: {
get: function() {
return c
},
set: function(e) {
c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left
}
},
rightAlignYAxis: {
get: function() {
return S
},
set: function(e) {
S = e, o.orient(e ? "right" : "left")
}
},
color: {
get: function() {
return m
},
set: function(e) {
m = t.utils.getColor(e), i.color(m), a.color(m), s.color(m)
}
}
}), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e
}, t.models.sparkline = function() {
"use strict";
function e(u) {
return u.each(function(e) {
var u = s - a.left - a.right,
v = l - a.top - a.bottom;
c = d3.select(this), t.utils.initSVG(c), d.domain(n || d3.extent(e, m)).range(o || [0, u]), f.domain(r || d3.extent(e, p)).range(i || [v, 0]);
var h = c.selectAll("g.nv-wrap.nv-sparkline").data([e]),
y = h.enter().append("g").attr("class", "nvd3 nv-wrap nv-sparkline");
y.append("g"), h.select("g");
h.attr("transform", "translate(" + a.left + "," + a.top + ")");
var b = h.selectAll("path").data(function(e) {
return [e]
});
b.enter().append("path"), b.exit().remove(), b.style("stroke", function(e, t) {
return e.color || g(e, t)
}).attr("d", d3.svg.line().x(function(e, t) {
return d(m(e, t))
}).y(function(e, t) {
return f(p(e, t))
}));
var E = h.selectAll("circle.nv-point").data(function(e) {
function t(t) {
if (t != -1) {
var n = e[t];
return n.pointIndex = t, n
}
return null
}
var n = e.map(function(e, t) {
return p(e, t)
}),
r = t(n.lastIndexOf(f.domain()[1])),
o = t(n.indexOf(f.domain()[0])),
i = t(n.length - 1);
return [o, r, i].filter(function(e) {
return null != e
})
});
E.enter().append("circle"), E.exit().remove(), E.attr("cx", function(e, t) {
return d(m(e, e.pointIndex))
}).attr("cy", function(e, t) {
return f(p(e, e.pointIndex))
}).attr("r", 2).attr("class", function(e, t) {
return m(e, e.pointIndex) == d.domain()[1] ? "nv-point nv-currentValue" : p(e, e.pointIndex) == f.domain()[0] ? "nv-point nv-minValue" : "nv-point nv-maxValue"
})
}), e
}
var n, r, o, i, a = {
top: 2,
right: 0,
bottom: 2,
left: 0
},
s = 400,
l = 32,
c = null,
u = !0,
d = d3.scale.linear(),
f = d3.scale.linear(),
m = function(e) {
return e.x
},
p = function(e) {
return e.y
},
g = t.utils.getColor(["#000"]);
return e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
height: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
xDomain: {
get: function() {
return n
},
set: function(e) {
n = e
}
},
yDomain: {
get: function() {
return r
},
set: function(e) {
r = e
}
},
xRange: {
get: function() {
return o
},
set: function(e) {
o = e
}
},
yRange: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
xScale: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
yScale: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
animate: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
x: {
get: function() {
return m
},
set: function(e) {
m = d3.functor(e)
}
},
y: {
get: function() {
return p
},
set: function(e) {
p = d3.functor(e)
}
},
margin: {
get: function() {
return a
},
set: function(e) {
a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left
}
},
color: {
get: function() {
return g
},
set: function(e) {
g = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.sparklinePlus = function() {
"use strict";
function e(g) {
return g.each(function(g) {
function v() {
if (!c) {
var e = T.selectAll(".nv-hoverValue").data(l),
t = e.enter().append("g").attr("class", "nv-hoverValue").style("stroke-opacity", 0).style("fill-opacity", 0);
e.exit().transition().duration(250).style("stroke-opacity", 0).style("fill-opacity", 0).remove(), e.attr("transform", function(e) {
return "translate(" + n(o.x()(g[e], e)) + ",0)"
}).transition().duration(250).style("stroke-opacity", 1).style("fill-opacity", 1), l.length && (t.append("line").attr("x1", 0).attr("y1", -i.top).attr("x2", 0).attr("y2", E), t.append("text").attr("class", "nv-xValue").attr("x", -6).attr("y", -i.top).attr("text-anchor", "end").attr("dy", ".9em"), T.select(".nv-hoverValue .nv-xValue").text(u(o.x()(g[l[0]], l[0]))), t.append("text").attr("class", "nv-yValue").attr("x", 6).attr("y", -i.top).attr("text-anchor", "start").attr("dy", ".9em"), T.select(".nv-hoverValue .nv-yValue").text(d(o.y()(g[l[0]], l[0]))))
}
}
function h() {
function e(e, t) {
for (var n = Math.abs(o.x()(e[0], 0) - t), r = 0, i = 0; i < e.length; i++) Math.abs(o.x()(e[i], i) - t) < n && (n = Math.abs(o.x()(e[i], i) - t), r = i);
return r
}
if (!c) {
var t = d3.mouse(this)[0] - i.left;
l = [e(g, Math.round(n.invert(t)))], v()
}
}
var y = d3.select(this);
t.utils.initSVG(y);
var b = t.utils.availableWidth(a, y, i),
E = t.utils.availableHeight(s, y, i);
if (e.update = function() {
y.call(e)
}, e.container = this, !g || !g.length) return t.utils.noData(e, y), e;
y.selectAll(".nv-noData").remove();
var S = o.y()(g[g.length - 1], g.length - 1);
n = o.xScale(), r = o.yScale();
var _ = y.selectAll("g.nv-wrap.nv-sparklineplus").data([g]),
w = _.enter().append("g").attr("class", "nvd3 nv-wrap nv-sparklineplus"),
A = w.append("g"),
T = _.select("g");
A.append("g").attr("class", "nv-sparklineWrap"), A.append("g").attr("class", "nv-valueWrap"), A.append("g").attr("class", "nv-hoverArea"), _.attr("transform", "translate(" + i.left + "," + i.top + ")");
var C = T.select(".nv-sparklineWrap");
if (o.width(b).height(E), C.call(o), f) {
var I = T.select(".nv-valueWrap"),
x = I.selectAll(".nv-currentValue").data([S]);
x.enter().append("text").attr("class", "nv-currentValue").attr("dx", p ? -8 : 8).attr("dy", ".9em").style("text-anchor", p ? "end" : "start"), x.attr("x", b + (p ? i.right : 0)).attr("y", m ? function(e) {
return r(e)
} : 0).style("fill", o.color()(g[g.length - 1], g.length - 1)).text(d(S))
}
A.select(".nv-hoverArea").append("rect").on("mousemove", h).on("click", function() {
c = !c
}).on("mouseout", function() {
l = [], v()
}), T.select(".nv-hoverArea rect").attr("transform", function(e) {
return "translate(" + -i.left + "," + -i.top + ")"
}).attr("width", b + i.left + i.right).attr("height", E + i.top)
}), e
}
var n, r, o = t.models.sparkline(),
i = {
top: 15,
right: 100,
bottom: 10,
left: 50
},
a = null,
s = null,
l = [],
c = !1,
u = d3.format(",r"),
d = d3.format(",.2f"),
f = !0,
m = !0,
p = !1,
g = null;
return e.sparkline = o, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
height: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
xTickFormat: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
yTickFormat: {
get: function() {
return d
},
set: function(e) {
d = e
}
},
showLastValue: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
alignValue: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
rightAlignValue: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
noData: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
margin: {
get: function() {
return i
},
set: function(e) {
i.top = void 0 !== e.top ? e.top : i.top, i.right = void 0 !== e.right ? e.right : i.right, i.bottom = void 0 !== e.bottom ? e.bottom : i.bottom, i.left = void 0 !== e.left ? e.left : i.left
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.stackedArea = function() {
"use strict";
function e(f) {
return E.reset(), E.models(h), f.each(function(f) {
var y = i - o.left - o.right,
S = a - o.top - o.bottom;
c = d3.select(this), t.utils.initSVG(c), n = h.xScale(), r = h.yScale();
var _ = f;
f.forEach(function(e, t) {
e.seriesIndex = t, e.values = e.values.map(function(e, n) {
return e.index = n, e.seriesIndex = t, e
})
});
var w = f.filter(function(e) {
return !e.disabled
});
f = d3.layout.stack().order(p).offset(m).values(function(e) {
return e.values
}).x(u).y(d).out(function(e, t, n) {
e.display = {
y: n,
y0: t
}
})(w);
var A = c.selectAll("g.nv-wrap.nv-stackedarea").data([f]),
T = A.enter().append("g").attr("class", "nvd3 nv-wrap nv-stackedarea"),
C = T.append("defs"),
I = T.append("g"),
x = A.select("g");
I.append("g").attr("class", "nv-areaWrap"), I.append("g").attr("class", "nv-scatterWrap"), A.attr("transform", "translate(" + o.left + "," + o.top + ")"), 0 == h.forceY().length && h.forceY().push(0), h.width(y).height(S).x(u).y(function(e) {
return e.display.y + e.display.y0
}).forceY([0]).color(f.map(function(e, t) {
return e.color || s(e, e.seriesIndex)
}));
var D = x.select(".nv-scatterWrap").datum(f);
D.call(h), C.append("clipPath").attr("id", "nv-edge-clip-" + l).append("rect"), A.select("#nv-edge-clip-" + l + " rect").attr("width", y).attr("height", S), x.attr("clip-path", v ? "url(#nv-edge-clip-" + l + ")" : "");
var M = d3.svg.area().x(function(e, t) {
return n(u(e, t))
}).y0(function(e) {
return r(e.display.y0)
}).y1(function(e) {
return r(e.display.y + e.display.y0)
}).interpolate(g),
O = d3.svg.area().x(function(e, t) {
return n(u(e, t))
}).y0(function(e) {
return r(e.display.y0)
}).y1(function(e) {
return r(e.display.y0)
}),
R = x.select(".nv-areaWrap").selectAll("path.nv-area").data(function(e) {
return e
});
R.enter().append("path").attr("class", function(e, t) {
return "nv-area nv-area-" + t
}).attr("d", function(e, t) {
return O(e.values, e.seriesIndex)
}).on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0), b.areaMouseover({
point: e,
series: e.key,
pos: [d3.event.pageX, d3.event.pageY],
seriesIndex: e.seriesIndex
})
}).on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1), b.areaMouseout({
point: e,
series: e.key,
pos: [d3.event.pageX, d3.event.pageY],
seriesIndex: e.seriesIndex
})
}).on("click", function(e, t) {
d3.select(this).classed("hover", !1), b.areaClick({
point: e,
series: e.key,
pos: [d3.event.pageX, d3.event.pageY],
seriesIndex: e.seriesIndex
})
}), R.exit().remove(), R.style("fill", function(e, t) {
return e.color || s(e, e.seriesIndex)
}).style("stroke", function(e, t) {
return e.color || s(e, e.seriesIndex)
}), R.watchTransition(E, "stackedArea path").attr("d", function(e, t) {
return M(e.values, t)
}), h.dispatch.on("elementMouseover.area", function(e) {
x.select(".nv-chart-" + l + " .nv-area-" + e.seriesIndex).classed("hover", !0)
}), h.dispatch.on("elementMouseout.area", function(e) {
x.select(".nv-chart-" + l + " .nv-area-" + e.seriesIndex).classed("hover", !1)
}), e.d3_stackedOffset_stackPercent = function(e) {
var t, n, r, o = e.length,
i = e[0].length,
a = [];
for (n = 0; n < i; ++n) {
for (t = 0, r = 0; t < _.length; t++) r += d(_[t].values[n]);
if (r)
for (t = 0; t < o; t++) e[t][n][1] /= r;
else
for (t = 0; t < o; t++) e[t][n][1] = 0
}
for (n = 0; n < i; ++n) a[n] = 0;
return a
}
}), E.renderEnd("stackedArea immediate"), e
}
var n, r, o = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
i = 960,
a = 500,
s = t.utils.defaultColor(),
l = Math.floor(1e5 * Math.random()),
c = null,
u = function(e) {
return e.x
},
d = function(e) {
return e.y
},
f = "stack",
m = "zero",
p = "default",
g = "linear",
v = !1,
h = t.models.scatter(),
y = 250,
b = d3.dispatch("areaClick", "areaMouseover", "areaMouseout", "renderEnd", "elementClick", "elementMouseover", "elementMouseout");
h.pointSize(2.2).pointDomain([2.2, 2.2]);
var E = t.utils.renderWatch(b, y);
return e.dispatch = b, e.scatter = h, h.dispatch.on("elementClick", function() {
b.elementClick.apply(this, arguments)
}), h.dispatch.on("elementMouseover", function() {
b.elementMouseover.apply(this, arguments)
}), h.dispatch.on("elementMouseout", function() {
b.elementMouseout.apply(this, arguments)
}), e.interpolate = function(t) {
return arguments.length ? (g = t, e) : g
}, e.duration = function(t) {
return arguments.length ? (y = t, E.reset(y), h.duration(y), e) : y
}, e.dispatch = b, e.scatter = h, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return i
},
set: function(e) {
i = e
}
},
height: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
clipEdge: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
offset: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
order: {
get: function() {
return p
},
set: function(e) {
p = e
}
},
interpolate: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
x: {
get: function() {
return u
},
set: function(e) {
u = d3.functor(e)
}
},
y: {
get: function() {
return d
},
set: function(e) {
d = d3.functor(e)
}
},
margin: {
get: function() {
return o
},
set: function(e) {
o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left
}
},
color: {
get: function() {
return s
},
set: function(e) {
s = t.utils.getColor(e)
}
},
style: {
get: function() {
return f
},
set: function(t) {
switch (f = t) {
case "stack":
e.offset("zero"), e.order("default");
break;
case "stream":
e.offset("wiggle"), e.order("inside-out");
break;
case "stream-center":
e.offset("silhouette"), e.order("inside-out");
break;
case "expand":
e.offset("expand"), e.order("default");
break;
case "stack_percent":
e.offset(e.d3_stackedOffset_stackPercent), e.order("default")
}
}
},
duration: {
get: function() {
return y
},
set: function(e) {
y = e, E.reset(y), h.duration(y)
}
}
}), t.utils.inheritOptions(e, h), t.utils.initOptions(e), e
}, t.models.stackedAreaChart = function() {
"use strict";
function e(u) {
return O.reset(), O.models(o), h && O.models(i), y && O.models(a), u.each(function(u) {
var w = d3.select(this),
O = this;
t.utils.initSVG(w);
var P = t.utils.availableWidth(f, w, d),
G = t.utils.availableHeight(m, w, d);
if (e.update = function() {
w.transition().duration(x).call(e)
}, e.container = this, S.setter(L(u), e.update).getter(N(u)).update(), S.disabled = u.map(function(e) {
return !!e.disabled
}), !_) {
var F;
_ = {};
for (F in S) S[F] instanceof Array ? _[F] = S[F].slice(0) : _[F] = S[F]
}
if (!(u && u.length && u.filter(function(e) {
return e.values.length
}).length)) return t.utils.noData(e, w), e;
w.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale();
var U = w.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]),
V = U.enter().append("g").attr("class", "nvd3 nv-wrap nv-stackedAreaChart").append("g"),
z = U.select("g");
if (V.append("rect").style("opacity", 0), V.append("g").attr("class", "nv-x nv-axis"), V.append("g").attr("class", "nv-y nv-axis"), V.append("g").attr("class", "nv-stackedWrap"), V.append("g").attr("class", "nv-legendWrap"), V.append("g").attr("class", "nv-controlsWrap"), V.append("g").attr("class", "nv-interactive"), z.select("rect").attr("width", P).attr("height", G), v) {
var B = g ? P - T : P;
s.width(B), z.select(".nv-legendWrap").datum(u).call(s), d.top != s.height() && (d.top = s.height(), G = t.utils.availableHeight(m, w, d)), z.select(".nv-legendWrap").attr("transform", "translate(" + (P - B) + "," + -d.top + ")")
}
if (g) {
var $ = [{
key: I.stacked || "Stacked",
metaKey: "Stacked",
disabled: "stack" != o.style(),
style: "stack"
}, {
key: I.stream || "Stream",
metaKey: "Stream",
disabled: "stream" != o.style(),
style: "stream"
}, {
key: I.expanded || "Expanded",
metaKey: "Expanded",
disabled: "expand" != o.style(),
style: "expand"
}, {
key: I.stack_percent || "Stack %",
metaKey: "Stack_Percent",
disabled: "stack_percent" != o.style(),
style: "stack_percent"
}];
T = C.length / 3 * 260, $ = $.filter(function(e) {
return C.indexOf(e.metaKey) !== -1
}), l.width(T).color(["#444", "#444", "#444"]), z.select(".nv-controlsWrap").datum($).call(l), d.top != Math.max(l.height(), s.height()) && (d.top = Math.max(l.height(), s.height()), G = t.utils.availableHeight(m, w, d)), z.select(".nv-controlsWrap").attr("transform", "translate(0," + -d.top + ")")
}
U.attr("transform", "translate(" + d.left + "," + d.top + ")"), b && z.select(".nv-y.nv-axis").attr("transform", "translate(" + P + ",0)"), E && (c.width(P).height(G).margin({
left: d.left,
top: d.top
}).svgContainer(w).xScale(n), U.select(".nv-interactive").call(c)), o.width(P).height(G);
var W = z.select(".nv-stackedWrap").datum(u);
if (W.transition().call(o), h && (i.scale(n)._ticks(t.utils.calcTicksX(P / 100, u)).tickSize(-G, 0), z.select(".nv-x.nv-axis").attr("transform", "translate(0," + G + ")"), z.select(".nv-x.nv-axis").transition().duration(0).call(i)), y) {
var H;
if (H = "wiggle" === o.offset() ? 0 : t.utils.calcTicksY(G / 36, u), a.scale(r)._ticks(H).tickSize(-P, 0), "expand" === o.style() || "stack_percent" === o.style()) {
var j = a.tickFormat();
D && j === k || (D = j), a.tickFormat(k)
} else D && (a.tickFormat(D), D = null);
z.select(".nv-y.nv-axis").transition().duration(0).call(a)
}
o.dispatch.on("areaClick.toggle", function(t) {
1 === u.filter(function(e) {
return !e.disabled
}).length ? u.forEach(function(e) {
e.disabled = !1
}) : u.forEach(function(e, n) {
e.disabled = n != t.seriesIndex
}), S.disabled = u.map(function(e) {
return !!e.disabled
}), A.stateChange(S), e.update()
}), s.dispatch.on("stateChange", function(t) {
for (var n in t) S[n] = t[n];
A.stateChange(S), e.update()
}), l.dispatch.on("legendClick", function(t, n) {
t.disabled && ($ = $.map(function(e) {
return e.disabled = !0, e
}), t.disabled = !1, o.style(t.style), S.style = o.style(), A.stateChange(S), e.update())
}), c.dispatch.on("elementMousemove", function(n) {
o.clearHighlights();
var r, a, s, l = [];
if (u.filter(function(e, t) {
return e.seriesIndex = t, !e.disabled
}).forEach(function(i, c) {
a = t.interactiveBisect(i.values, n.pointXValue, e.x());
var u = i.values[a],
d = e.y()(u, a);
if (null != d && o.highlightPoint(c, a, !0), "undefined" != typeof u) {
"undefined" == typeof r && (r = u), "undefined" == typeof s && (s = e.xScale()(e.x()(u, a)));
var f = "expand" == o.style() ? u.display.y : e.y()(u, a);
l.push({
key: i.key,
value: f,
color: p(i, i.seriesIndex),
stackedValue: u.display
})
}
}), l.reverse(), l.length > 2) {
var f = e.yScale().invert(n.mouseY),
m = null;
l.forEach(function(e, t) {
f = Math.abs(f);
var n = Math.abs(e.stackedValue.y0),
r = Math.abs(e.stackedValue.y);
if (f >= n && f <= r + n) return void(m = t);
}), null != m && (l[m].highlight = !0)
}
var g = i.tickFormat()(e.x()(r, a)),
v = c.tooltip.valueFormatter();
"expand" === o.style() || "stack_percent" === o.style() ? (M || (M = v), v = d3.format(".1%")) : M && (v = M, M = null), c.tooltip.position({
left: s + d.left,
top: n.mouseY + d.top
}).chartContainer(O.parentNode).valueFormatter(v).data({
value: g,
series: l
})(), c.renderGuideLine(s)
}), c.dispatch.on("elementMouseout", function(e) {
o.clearHighlights()
}), A.on("changeState", function(t) {
"undefined" != typeof t.disabled && u.length === t.disabled.length && (u.forEach(function(e, n) {
e.disabled = t.disabled[n]
}), S.disabled = t.disabled), "undefined" != typeof t.style && (o.style(t.style), R = t.style), e.update()
})
}), O.renderEnd("stacked Area chart immediate"), e
}
var n, r, o = t.models.stackedArea(),
i = t.models.axis(),
a = t.models.axis(),
s = t.models.legend(),
l = t.models.legend(),
c = t.interactiveGuideline(),
u = t.models.tooltip(),
d = {
top: 30,
right: 25,
bottom: 50,
left: 60
},
f = null,
m = null,
p = t.utils.defaultColor(),
g = !0,
v = !0,
h = !0,
y = !0,
b = !1,
E = !1,
S = t.utils.state(),
_ = null,
w = null,
A = d3.dispatch("stateChange", "changeState", "renderEnd"),
T = 250,
C = ["Stacked", "Stream", "Expanded"],
I = {},
x = 250;
S.style = o.style(), i.orient("bottom").tickPadding(7), a.orient(b ? "right" : "left"), u.headerFormatter(function(e, t) {
return i.tickFormat()(e, t)
}).valueFormatter(function(e, t) {
return a.tickFormat()(e, t)
}), c.tooltip.headerFormatter(function(e, t) {
return i.tickFormat()(e, t)
}).valueFormatter(function(e, t) {
return a.tickFormat()(e, t)
});
var D = null,
M = null;
l.updateState(!1);
var O = t.utils.renderWatch(A),
R = o.style(),
N = function(e) {
return function() {
return {
active: e.map(function(e) {
return !e.disabled
}),
style: o.style()
}
}
},
L = function(e) {
return function(t) {
void 0 !== t.style && (R = t.style), void 0 !== t.active && e.forEach(function(e, n) {
e.disabled = !t.active[n]
})
}
},
k = d3.format("%");
return o.dispatch.on("elementMouseover.tooltip", function(e) {
e.point.x = o.x()(e.point), e.point.y = o.y()(e.point), u.data(e).position(e.pos).hidden(!1)
}), o.dispatch.on("elementMouseout.tooltip", function(e) {
u.hidden(!0)
}), e.dispatch = A, e.stacked = o, e.legend = s, e.controls = l, e.xAxis = i, e.yAxis = a, e.interactiveLayer = c, e.tooltip = u, e.dispatch = A, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return f
},
set: function(e) {
f = e
}
},
height: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
showLegend: {
get: function() {
return v
},
set: function(e) {
v = e
}
},
showXAxis: {
get: function() {
return h
},
set: function(e) {
h = e
}
},
showYAxis: {
get: function() {
return y
},
set: function(e) {
y = e
}
},
defaultState: {
get: function() {
return _
},
set: function(e) {
_ = e
}
},
noData: {
get: function() {
return w
},
set: function(e) {
w = e
}
},
showControls: {
get: function() {
return g
},
set: function(e) {
g = e
}
},
controlLabels: {
get: function() {
return I
},
set: function(e) {
I = e
}
},
controlOptions: {
get: function() {
return C
},
set: function(e) {
C = e
}
},
tooltips: {
get: function() {
return u.enabled()
},
set: function(e) {
t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), u.enabled(!!e)
}
},
tooltipContent: {
get: function() {
return u.contentGenerator()
},
set: function(e) {
t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), u.contentGenerator(e)
}
},
margin: {
get: function() {
return d
},
set: function(e) {
d.top = void 0 !== e.top ? e.top : d.top, d.right = void 0 !== e.right ? e.right : d.right, d.bottom = void 0 !== e.bottom ? e.bottom : d.bottom, d.left = void 0 !== e.left ? e.left : d.left
}
},
duration: {
get: function() {
return x
},
set: function(e) {
x = e, O.reset(x), o.duration(x), i.duration(x), a.duration(x)
}
},
color: {
get: function() {
return p
},
set: function(e) {
p = t.utils.getColor(e), s.color(p), o.color(p)
}
},
rightAlignYAxis: {
get: function() {
return b
},
set: function(e) {
b = e, a.orient(b ? "right" : "left")
}
},
useInteractiveGuideline: {
get: function() {
return E
},
set: function(t) {
E = !!t, e.interactive(!t), e.useVoronoi(!t), o.scatter.interactive(!t)
}
}
}), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e
}, t.models.sunburst = function() {
"use strict";
function e(E) {
return b.reset(), E.each(function(e) {
function b(e) {
e.x0 = e.x, e.dx0 = e.dx
}
function E(e) {
var t = d3.interpolate(g.domain(), [e.x, e.x + e.dx]),
n = d3.interpolate(v.domain(), [e.y, 1]),
r = d3.interpolate(v.range(), [e.y ? 20 : 0, A]);
return function(e, o) {
return o ? function(t) {
return y(e)
} : function(o) {
return g.domain(t(o)), v.domain(n(o)).range(r(o)), y(e)
}
}
}
d = d3.select(this);
var S, _ = t.utils.availableWidth(a, d, i),
w = t.utils.availableHeight(s, d, i),
A = Math.min(_, w) / 2;
t.utils.initSVG(d);
var T = d.selectAll(".nv-wrap.nv-sunburst").data(e),
C = T.enter().append("g").attr("class", "nvd3 nv-wrap nv-sunburst nv-chart-" + u),
I = C.selectAll("nv-sunburst");
T.attr("transform", "translate(" + _ / 2 + "," + w / 2 + ")"), d.on("click", function(e, t) {
p.chartClick({
data: e,
index: t,
pos: d3.event,
id: u
})
}), v.range([0, A]), n = n || e, o = e[0], h.value(c[l] || c.count), S = I.data(h.nodes).enter().append("path").attr("d", y).style("fill", function(e) {
return f((e.children ? e : e.parent).name)
}).style("stroke", "#FFF").on("click", function(e) {
r !== n && n !== e && (r = n), n = e, S.transition().duration(m).attrTween("d", E(e))
}).each(b).on("dblclick", function(e) {
r.parent == e && S.transition().duration(m).attrTween("d", E(o))
}).each(b).on("mouseover", function(e, t) {
d3.select(this).classed("hover", !0).style("opacity", .8), p.elementMouseover({
data: e,
color: d3.select(this).style("fill")
})
}).on("mouseout", function(e, t) {
d3.select(this).classed("hover", !1).style("opacity", 1), p.elementMouseout({
data: e
})
}).on("mousemove", function(e, t) {
p.elementMousemove({
data: e
})
})
}), b.renderEnd("sunburst immediate"), e
}
var n, r, o, i = {
top: 0,
right: 0,
bottom: 0,
left: 0
},
a = null,
s = null,
l = "count",
c = {
count: function(e) {
return 1
},
size: function(e) {
return e.size
}
},
u = Math.floor(1e4 * Math.random()),
d = null,
f = t.utils.defaultColor(),
m = 500,
p = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMousemove", "elementMouseover", "elementMouseout", "renderEnd"),
g = d3.scale.linear().range([0, 2 * Math.PI]),
v = d3.scale.sqrt(),
h = d3.layout.partition().sort(null).value(function(e) {
return 1
}),
y = d3.svg.arc().startAngle(function(e) {
return Math.max(0, Math.min(2 * Math.PI, g(e.x)))
}).endAngle(function(e) {
return Math.max(0, Math.min(2 * Math.PI, g(e.x + e.dx)))
}).innerRadius(function(e) {
return Math.max(0, v(e.y))
}).outerRadius(function(e) {
return Math.max(0, v(e.y + e.dy))
}),
b = t.utils.renderWatch(p);
return e.dispatch = p, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
width: {
get: function() {
return a
},
set: function(e) {
a = e
}
},
height: {
get: function() {
return s
},
set: function(e) {
s = e
}
},
mode: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
id: {
get: function() {
return u
},
set: function(e) {
u = e
}
},
duration: {
get: function() {
return m
},
set: function(e) {
m = e
}
},
margin: {
get: function() {
return i
},
set: function(e) {
i.top = void 0 != e.top ? e.top : i.top, i.right = void 0 != e.right ? e.right : i.right, i.bottom = void 0 != e.bottom ? e.bottom : i.bottom, i.left = void 0 != e.left ? e.left : i.left
}
},
color: {
get: function() {
return f
},
set: function(e) {
f = t.utils.getColor(e)
}
}
}), t.utils.initOptions(e), e
}, t.models.sunburstChart = function() {
"use strict";
function e(r) {
return f.reset(), f.models(n), r.each(function(r) {
var s = d3.select(this);
t.utils.initSVG(s);
var l = t.utils.availableWidth(i, s, o),
c = t.utils.availableHeight(a, s, o);
if (e.update = function() {
0 === u ? s.call(e) : s.transition().duration(u).call(e)
}, e.container = this, !r || !r.length) return t.utils.noData(e, s), e;
s.selectAll(".nv-noData").remove();
var d = s.selectAll("g.nv-wrap.nv-sunburstChart").data(r),
f = d.enter().append("g").attr("class", "nvd3 nv-wrap nv-sunburstChart").append("g"),
m = d.select("g");
f.append("g").attr("class", "nv-sunburstWrap"), d.attr("transform", "translate(" + o.left + "," + o.top + ")"), n.width(l).height(c);
var p = m.select(".nv-sunburstWrap").datum(r);
d3.transition(p).call(n)
}), f.renderEnd("sunburstChart immediate"), e
}
var n = t.models.sunburst(),
r = t.models.tooltip(),
o = {
top: 30,
right: 20,
bottom: 20,
left: 20
},
i = null,
a = null,
s = t.utils.defaultColor(),
l = (Math.round(1e5 * Math.random()), null),
c = null,
u = 250,
d = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd"),
f = t.utils.renderWatch(d);
return r.headerEnabled(!1).duration(0).valueFormatter(function(e, t) {
return e
}), n.dispatch.on("elementMouseover.tooltip", function(e) {
e.series = {
key: e.data.name,
value: e.data.size,
color: e.color
}, r.data(e).hidden(!1)
}), n.dispatch.on("elementMouseout.tooltip", function(e) {
r.hidden(!0)
}), n.dispatch.on("elementMousemove.tooltip", function(e) {
r.position({
top: d3.event.pageY,
left: d3.event.pageX
})()
}), e.dispatch = d, e.sunburst = n, e.tooltip = r, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, {
noData: {
get: function() {
return c
},
set: function(e) {
c = e
}
},
defaultState: {
get: function() {
return l
},
set: function(e) {
l = e
}
},
color: {
get: function() {
return s
},
set: function(e) {
s = e, n.color(s)
}
},
duration: {
get: function() {
return u
},
set: function(e) {
u = e, f.reset(u), n.duration(u)
}
},
margin: {
get: function() {
return o
},
set: function(e) {
o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left
}
}
}), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e
}, t.version = "1.8.1"
}()
}, function(e, t, n) {
var r, o;
(function() {
function n(e) {
function t(t, n, r, o, i, a) {
for (; i >= 0 && i < a; i += e) {
var s = o ? o[i] : i;
r = n(r, t[s], s, t)
}
return r
}
return function(n, r, o, i) {
r = w(r, i, 4);
var a = !M(n) && _.keys(n),
s = (a || n).length,
l = e > 0 ? 0 : s - 1;
return arguments.length < 3 && (o = n[a ? a[l] : l], l += e), t(n, r, o, a, l, s)
}
}
function i(e) {
return function(t, n, r) {
n = A(n, r);
for (var o = D(t), i = e > 0 ? 0 : o - 1; i >= 0 && i < o; i += e)
if (n(t[i], i, t)) return i;
return -1
}
}
function a(e, t, n) {
return function(r, o, i) {
var a = 0,
s = D(r);
if ("number" == typeof i) e > 0 ? a = i >= 0 ? i : Math.max(i + s, a) : s = i >= 0 ? Math.min(i + 1, s) : i + s + 1;
else if (n && i && s) return i = n(r, o), r[i] === o ? i : -1;
if (o !== o) return i = t(p.call(r, a, s), _.isNaN), i >= 0 ? i + a : -1;
for (i = e > 0 ? a : s - 1; i >= 0 && i < s; i += e)
if (r[i] === o) return i;
return -1
}
}
function s(e, t) {
var n = k.length,
r = e.constructor,
o = _.isFunction(r) && r.prototype || d,
i = "constructor";
for (_.has(e, i) && !_.contains(t, i) && t.push(i); n--;) i = k[n], i in e && e[i] !== o[i] && !_.contains(t, i) && t.push(i)
}
var l = this,
c = l._,
u = Array.prototype,
d = Object.prototype,
f = Function.prototype,
m = u.push,
p = u.slice,
g = d.toString,
v = d.hasOwnProperty,
h = Array.isArray,
y = Object.keys,
b = f.bind,
E = Object.create,
S = function() {},
_ = function(e) {
return e instanceof _ ? e : this instanceof _ ? void(this._wrapped = e) : new _(e)
};
"undefined" != typeof e && e.exports && (t = e.exports = _), t._ = _, _.VERSION = "1.8.3";
var w = function(e, t, n) {
if (void 0 === t) return e;
switch (null == n ? 3 : n) {
case 1:
return function(n) {
return e.call(t, n)
};
case 2:
return function(n, r) {
return e.call(t, n, r)
};
case 3:
return function(n, r, o) {
return e.call(t, n, r, o)
};
case 4:
return function(n, r, o, i) {
return e.call(t, n, r, o, i)
}
}
return function() {
return e.apply(t, arguments)
}
},
A = function(e, t, n) {
return null == e ? _.identity : _.isFunction(e) ? w(e, t, n) : _.isObject(e) ? _.matcher(e) : _.property(e)
};
_.iteratee = function(e, t) {
return A(e, t, 1 / 0)
};
var T = function(e, t) {
return function(n) {
var r = arguments.length;
if (r < 2 || null == n) return n;
for (var o = 1; o < r; o++)
for (var i = arguments[o], a = e(i), s = a.length, l = 0; l < s; l++) {
var c = a[l];
t && void 0 !== n[c] || (n[c] = i[c])
}
return n
}
},
C = function(e) {
if (!_.isObject(e)) return {};
if (E) return E(e);
S.prototype = e;
var t = new S;
return S.prototype = null, t
},
I = function(e) {
return function(t) {
return null == t ? void 0 : t[e]
}
},
x = Math.pow(2, 53) - 1,
D = I("length"),
M = function(e) {
var t = D(e);
return "number" == typeof t && t >= 0 && t <= x
};
_.each = _.forEach = function(e, t, n) {
t = w(t, n);
var r, o;
if (M(e))
for (r = 0, o = e.length; r < o; r++) t(e[r], r, e);
else {
var i = _.keys(e);
for (r = 0, o = i.length; r < o; r++) t(e[i[r]], i[r], e)
}
return e
}, _.map = _.collect = function(e, t, n) {
t = A(t, n);
for (var r = !M(e) && _.keys(e), o = (r || e).length, i = Array(o), a = 0; a < o; a++) {
var s = r ? r[a] : a;
i[a] = t(e[s], s, e)
}
return i
}, _.reduce = _.foldl = _.inject = n(1), _.reduceRight = _.foldr = n(-1), _.find = _.detect = function(e, t, n) {
var r;
if (r = M(e) ? _.findIndex(e, t, n) : _.findKey(e, t, n), void 0 !== r && r !== -1) return e[r]
}, _.filter = _.select = function(e, t, n) {
var r = [];
return t = A(t, n), _.each(e, function(e, n, o) {
t(e, n, o) && r.push(e)
}), r
}, _.reject = function(e, t, n) {
return _.filter(e, _.negate(A(t)), n)
}, _.every = _.all = function(e, t, n) {
t = A(t, n);
for (var r = !M(e) && _.keys(e), o = (r || e).length, i = 0; i < o; i++) {
var a = r ? r[i] : i;
if (!t(e[a], a, e)) return !1
}
return !0
}, _.some = _.any = function(e, t, n) {
t = A(t, n);
for (var r = !M(e) && _.keys(e), o = (r || e).length, i = 0; i < o; i++) {
var a = r ? r[i] : i;
if (t(e[a], a, e)) return !0
}
return !1
}, _.contains = _.includes = _.include = function(e, t, n, r) {
return M(e) || (e = _.values(e)), ("number" != typeof n || r) && (n = 0), _.indexOf(e, t, n) >= 0
}, _.invoke = function(e, t) {
var n = p.call(arguments, 2),
r = _.isFunction(t);
return _.map(e, function(e) {
var o = r ? t : e[t];
return null == o ? o : o.apply(e, n)
})
}, _.pluck = function(e, t) {
return _.map(e, _.property(t))
}, _.where = function(e, t) {
return _.filter(e, _.matcher(t))
}, _.findWhere = function(e, t) {
return _.find(e, _.matcher(t))
}, _.max = function(e, t, n) {
var r, o, i = -(1 / 0),
a = -(1 / 0);
if (null == t && null != e) {
e = M(e) ? e : _.values(e);
for (var s = 0, l = e.length; s < l; s++) r = e[s], r > i && (i = r)
} else t = A(t, n), _.each(e, function(e, n, r) {
o = t(e, n, r), (o > a || o === -(1 / 0) && i === -(1 / 0)) && (i = e, a = o)
});
return i
}, _.min = function(e, t, n) {
var r, o, i = 1 / 0,
a = 1 / 0;
if (null == t && null != e) {
e = M(e) ? e : _.values(e);
for (var s = 0, l = e.length; s < l; s++) r = e[s], r < i && (i = r)
} else t = A(t, n), _.each(e, function(e, n, r) {
o = t(e, n, r), (o < a || o === 1 / 0 && i === 1 / 0) && (i = e, a = o)
});
return i
}, _.shuffle = function(e) {
for (var t, n = M(e) ? e : _.values(e), r = n.length, o = Array(r), i = 0; i < r; i++) t = _.random(0, i), t !== i && (o[i] = o[t]), o[t] = n[i];
return o
}, _.sample = function(e, t, n) {
return null == t || n ? (M(e) || (e = _.values(e)), e[_.random(e.length - 1)]) : _.shuffle(e).slice(0, Math.max(0, t))
}, _.sortBy = function(e, t, n) {
return t = A(t, n), _.pluck(_.map(e, function(e, n, r) {
return {
value: e,
index: n,
criteria: t(e, n, r)
}
}).sort(function(e, t) {
var n = e.criteria,
r = t.criteria;
if (n !== r) {
if (n > r || void 0 === n) return 1;
if (n < r || void 0 === r) return -1
}
return e.index - t.index
}), "value")
};
var O = function(e) {
return function(t, n, r) {
var o = {};
return n = A(n, r), _.each(t, function(r, i) {
var a = n(r, i, t);
e(o, r, a)
}), o
}
};
_.groupBy = O(function(e, t, n) {
_.has(e, n) ? e[n].push(t) : e[n] = [t]
}), _.indexBy = O(function(e, t, n) {
e[n] = t
}), _.countBy = O(function(e, t, n) {
_.has(e, n) ? e[n]++ : e[n] = 1
}), _.toArray = function(e) {
return e ? _.isArray(e) ? p.call(e) : M(e) ? _.map(e, _.identity) : _.values(e) : []
}, _.size = function(e) {
return null == e ? 0 : M(e) ? e.length : _.keys(e).length
}, _.partition = function(e, t, n) {
t = A(t, n);
var r = [],
o = [];
return _.each(e, function(e, n, i) {
(t(e, n, i) ? r : o).push(e)
}), [r, o]
}, _.first = _.head = _.take = function(e, t, n) {
if (null != e) return null == t || n ? e[0] : _.initial(e, e.length - t)
}, _.initial = function(e, t, n) {
return p.call(e, 0, Math.max(0, e.length - (null == t || n ? 1 : t)))
}, _.last = function(e, t, n) {
if (null != e) return null == t || n ? e[e.length - 1] : _.rest(e, Math.max(0, e.length - t))
}, _.rest = _.tail = _.drop = function(e, t, n) {
return p.call(e, null == t || n ? 1 : t)
}, _.compact = function(e) {
return _.filter(e, _.identity)
};
var R = function(e, t, n, r) {
for (var o = [], i = 0, a = r || 0, s = D(e); a < s; a++) {
var l = e[a];
if (M(l) && (_.isArray(l) || _.isArguments(l))) {
t || (l = R(l, t, n));
var c = 0,
u = l.length;
for (o.length += u; c < u;) o[i++] = l[c++]
} else n || (o[i++] = l)
}
return o
};
_.flatten = function(e, t) {
return R(e, t, !1)
}, _.without = function(e) {
return _.difference(e, p.call(arguments, 1))
}, _.uniq = _.unique = function(e, t, n, r) {
_.isBoolean(t) || (r = n, n = t, t = !1), null != n && (n = A(n, r));
for (var o = [], i = [], a = 0, s = D(e); a < s; a++) {
var l = e[a],
c = n ? n(l, a, e) : l;
t ? (a && i === c || o.push(l), i = c) : n ? _.contains(i, c) || (i.push(c), o.push(l)) : _.contains(o, l) || o.push(l)
}
return o
}, _.union = function() {
return _.uniq(R(arguments, !0, !0))
}, _.intersection = function(e) {
for (var t = [], n = arguments.length, r = 0, o = D(e); r < o; r++) {
var i = e[r];
if (!_.contains(t, i)) {
for (var a = 1; a < n && _.contains(arguments[a], i); a++);
a === n && t.push(i)
}
}
return t
}, _.difference = function(e) {
var t = R(arguments, !0, !0, 1);
return _.filter(e, function(e) {
return !_.contains(t, e)
})
}, _.zip = function() {
return _.unzip(arguments)
}, _.unzip = function(e) {
for (var t = e && _.max(e, D).length || 0, n = Array(t), r = 0; r < t; r++) n[r] = _.pluck(e, r);
return n
}, _.object = function(e, t) {
for (var n = {}, r = 0, o = D(e); r < o; r++) t ? n[e[r]] = t[r] : n[e[r][0]] = e[r][1];
return n
}, _.findIndex = i(1), _.findLastIndex = i(-1), _.sortedIndex = function(e, t, n, r) {
n = A(n, r, 1);
for (var o = n(t), i = 0, a = D(e); i < a;) {
var s = Math.floor((i + a) / 2);
n(e[s]) < o ? i = s + 1 : a = s
}
return i
}, _.indexOf = a(1, _.findIndex, _.sortedIndex), _.lastIndexOf = a(-1, _.findLastIndex), _.range = function(e, t, n) {
null == t && (t = e || 0, e = 0), n = n || 1;
for (var r = Math.max(Math.ceil((t - e) / n), 0), o = Array(r), i = 0; i < r; i++, e += n) o[i] = e;
return o
};
var N = function(e, t, n, r, o) {
if (!(r instanceof t)) return e.apply(n, o);
var i = C(e.prototype),
a = e.apply(i, o);
return _.isObject(a) ? a : i
};
_.bind = function(e, t) {
if (b && e.bind === b) return b.apply(e, p.call(arguments, 1));
if (!_.isFunction(e)) throw new TypeError("Bind must be called on a function");
var n = p.call(arguments, 2),
r = function() {
return N(e, r, t, this, n.concat(p.call(arguments)))
};
return r
}, _.partial = function(e) {
var t = p.call(arguments, 1),
n = function() {
for (var r = 0, o = t.length, i = Array(o), a = 0; a < o; a++) i[a] = t[a] === _ ? arguments[r++] : t[a];
for (; r < arguments.length;) i.push(arguments[r++]);
return N(e, n, this, this, i)
};
return n
}, _.bindAll = function(e) {
var t, n, r = arguments.length;
if (r <= 1) throw new Error("bindAll must be passed function names");
for (t = 1; t < r; t++) n = arguments[t], e[n] = _.bind(e[n], e);
return e
}, _.memoize = function(e, t) {
var n = function(r) {
var o = n.cache,
i = "" + (t ? t.apply(this, arguments) : r);
return _.has(o, i) || (o[i] = e.apply(this, arguments)), o[i]
};
return n.cache = {}, n
}, _.delay = function(e, t) {
var n = p.call(arguments, 2);
return setTimeout(function() {
return e.apply(null, n)
}, t)
}, _.defer = _.partial(_.delay, _, 1), _.throttle = function(e, t, n) {
var r, o, i, a = null,
s = 0;
n || (n = {});
var l = function() {
s = n.leading === !1 ? 0 : _.now(), a = null, i = e.apply(r, o), a || (r = o = null)
};
return function() {
var c = _.now();
s || n.leading !== !1 || (s = c);
var u = t - (c - s);
return r = this, o = arguments, u <= 0 || u > t ? (a && (clearTimeout(a), a = null), s = c, i = e.apply(r, o), a || (r = o = null)) : a || n.trailing === !1 || (a = setTimeout(l, u)), i
}
}, _.debounce = function(e, t, n) {
var r, o, i, a, s, l = function() {
var c = _.now() - a;
c < t && c >= 0 ? r = setTimeout(l, t - c) : (r = null, n || (s = e.apply(i, o), r || (i = o = null)))
};
return function() {
i = this, o = arguments, a = _.now();
var c = n && !r;
return r || (r = setTimeout(l, t)), c && (s = e.apply(i, o), i = o = null), s
}
}, _.wrap = function(e, t) {
return _.partial(t, e)
}, _.negate = function(e) {
return function() {
return !e.apply(this, arguments)
}
}, _.compose = function() {
var e = arguments,
t = e.length - 1;
return function() {
for (var n = t, r = e[t].apply(this, arguments); n--;) r = e[n].call(this, r);
return r
}
}, _.after = function(e, t) {
return function() {
if (--e < 1) return t.apply(this, arguments)
}
}, _.before = function(e, t) {
var n;
return function() {
return --e > 0 && (n = t.apply(this, arguments)), e <= 1 && (t = null), n
}
}, _.once = _.partial(_.before, 2);
var L = !{
toString: null
}.propertyIsEnumerable("toString"),
k = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
_.keys = function(e) {
if (!_.isObject(e)) return [];
if (y) return y(e);
var t = [];
for (var n in e) _.has(e, n) && t.push(n);
return L && s(e, t), t
}, _.allKeys = function(e) {
if (!_.isObject(e)) return [];
var t = [];
for (var n in e) t.push(n);
return L && s(e, t), t
}, _.values = function(e) {
for (var t = _.keys(e), n = t.length, r = Array(n), o = 0; o < n; o++) r[o] = e[t[o]];
return r
}, _.mapObject = function(e, t, n) {
t = A(t, n);
for (var r, o = _.keys(e), i = o.length, a = {}, s = 0; s < i; s++) r = o[s], a[r] = t(e[r], r, e);
return a
}, _.pairs = function(e) {
for (var t = _.keys(e), n = t.length, r = Array(n), o = 0; o < n; o++) r[o] = [t[o], e[t[o]]];
return r
}, _.invert = function(e) {
for (var t = {}, n = _.keys(e), r = 0, o = n.length; r < o; r++) t[e[n[r]]] = n[r];
return t
}, _.functions = _.methods = function(e) {
var t = [];
for (var n in e) _.isFunction(e[n]) && t.push(n);
return t.sort()
}, _.extend = T(_.allKeys), _.extendOwn = _.assign = T(_.keys), _.findKey = function(e, t, n) {
t = A(t, n);
for (var r, o = _.keys(e), i = 0, a = o.length; i < a; i++)
if (r = o[i], t(e[r], r, e)) return r
}, _.pick = function(e, t, n) {
var r, o, i = {},
a = e;
if (null == a) return i;
_.isFunction(t) ? (o = _.allKeys(a), r = w(t, n)) : (o = R(arguments, !1, !1, 1), r = function(e, t, n) {
return t in n
}, a = Object(a));
for (var s = 0, l = o.length; s < l; s++) {
var c = o[s],
u = a[c];
r(u, c, a) && (i[c] = u)
}
return i
}, _.omit = function(e, t, n) {
if (_.isFunction(t)) t = _.negate(t);
else {
var r = _.map(R(arguments, !1, !1, 1), String);
t = function(e, t) {
return !_.contains(r, t)
}
}
return _.pick(e, t, n)
}, _.defaults = T(_.allKeys, !0), _.create = function(e, t) {
var n = C(e);
return t && _.extendOwn(n, t), n
}, _.clone = function(e) {
return _.isObject(e) ? _.isArray(e) ? e.slice() : _.extend({}, e) : e
}, _.tap = function(e, t) {
return t(e), e
}, _.isMatch = function(e, t) {
var n = _.keys(t),
r = n.length;
if (null == e) return !r;
for (var o = Object(e), i = 0; i < r; i++) {
var a = n[i];
if (t[a] !== o[a] || !(a in o)) return !1
}
return !0
};
var P = function(e, t, n, r) {
if (e === t) return 0 !== e || 1 / e === 1 / t;
if (null == e || null == t) return e === t;
e instanceof _ && (e = e._wrapped), t instanceof _ && (t = t._wrapped);
var o = g.call(e);
if (o !== g.call(t)) return !1;
switch (o) {
case "[object RegExp]":
case "[object String]":
return "" + e == "" + t;
case "[object Number]":
return +e !== +e ? +t !== +t : 0 === +e ? 1 / +e === 1 / t : +e === +t;
case "[object Date]":
case "[object Boolean]":
return +e === +t
}
var i = "[object Array]" === o;
if (!i) {
if ("object" != typeof e || "object" != typeof t) return !1;
var a = e.constructor,
s = t.constructor;
if (a !== s && !(_.isFunction(a) && a instanceof a && _.isFunction(s) && s instanceof s) && "constructor" in e && "constructor" in t) return !1
}
n = n || [], r = r || [];
for (var l = n.length; l--;)
if (n[l] === e) return r[l] === t;
if (n.push(e), r.push(t), i) {
if (l = e.length, l !== t.length) return !1;
for (; l--;)
if (!P(e[l], t[l], n, r)) return !1
} else {
var c, u = _.keys(e);
if (l = u.length, _.keys(t).length !== l) return !1;
for (; l--;)
if (c = u[l], !_.has(t, c) || !P(e[c], t[c], n, r)) return !1
}
return n.pop(), r.pop(), !0
};
_.isEqual = function(e, t) {
return P(e, t)
}, _.isEmpty = function(e) {
return null == e || (M(e) && (_.isArray(e) || _.isString(e) || _.isArguments(e)) ? 0 === e.length : 0 === _.keys(e).length)
}, _.isElement = function(e) {
return !(!e || 1 !== e.nodeType)
}, _.isArray = h || function(e) {
return "[object Array]" === g.call(e)
}, _.isObject = function(e) {
var t = typeof e;
return "function" === t || "object" === t && !!e
}, _.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error"], function(e) {
_["is" + e] = function(t) {
return g.call(t) === "[object " + e + "]"
}
}), _.isArguments(arguments) || (_.isArguments = function(e) {
return _.has(e, "callee")
}), "function" != typeof /./ && "object" != typeof Int8Array && (_.isFunction = function(e) {
return "function" == typeof e || !1
}), _.isFinite = function(e) {
return isFinite(e) && !isNaN(parseFloat(e))
}, _.isNaN = function(e) {
return _.isNumber(e) && e !== +e
}, _.isBoolean = function(e) {
return e === !0 || e === !1 || "[object Boolean]" === g.call(e)
}, _.isNull = function(e) {
return null === e
}, _.isUndefined = function(e) {
return void 0 === e
}, _.has = function(e, t) {
return null != e && v.call(e, t)
}, _.noConflict = function() {
return l._ = c, this
}, _.identity = function(e) {
return e
}, _.constant = function(e) {
return function() {
return e
}
}, _.noop = function() {}, _.property = I, _.propertyOf = function(e) {
return null == e ? function() {} : function(t) {
return e[t]
}
}, _.matcher = _.matches = function(e) {
return e = _.extendOwn({}, e),
function(t) {
return _.isMatch(t, e)
}
}, _.times = function(e, t, n) {
var r = Array(Math.max(0, e));
t = w(t, n, 1);
for (var o = 0; o < e; o++) r[o] = t(o);
return r
}, _.random = function(e, t) {
return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1))
}, _.now = Date.now || function() {
return (new Date).getTime()
};
var G = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"`": "`"
},
F = _.invert(G),
U = function(e) {
var t = function(t) {
return e[t]
},
n = "(?:" + _.keys(e).join("|") + ")",
r = RegExp(n),
o = RegExp(n, "g");
return function(e) {
return e = null == e ? "" : "" + e, r.test(e) ? e.replace(o, t) : e
}
};
_.escape = U(G), _.unescape = U(F), _.result = function(e, t, n) {
var r = null == e ? void 0 : e[t];
return void 0 === r && (r = n), _.isFunction(r) ? r.call(e) : r
};
var V = 0;
_.uniqueId = function(e) {
var t = ++V + "";
return e ? e + t : t
}, _.templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
escape: /<%-([\s\S]+?)%>/g
};
var z = /(.)^/,
B = {
"'": "'",
"\\": "\\",
"\r": "r",
"\n": "n",
"\u2028": "u2028",
"\u2029": "u2029"
},
$ = /\\|'|\r|\n|\u2028|\u2029/g,
W = function(e) {
return "\\" + B[e]
};
_.template = function(e, t, n) {
!t && n && (t = n), t = _.defaults({}, t, _.templateSettings);
var r = RegExp([(t.escape || z).source, (t.interpolate || z).source, (t.evaluate || z).source].join("|") + "|$", "g"),
o = 0,
i = "__p+='";
e.replace(r, function(t, n, r, a, s) {
return i += e.slice(o, s).replace($, W), o = s + t.length, n ? i += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'" : r ? i += "'+\n((__t=(" + r + "))==null?'':__t)+\n'" : a && (i += "';\n" + a + "\n__p+='"), t
}), i += "';\n", t.variable || (i = "with(obj||{}){\n" + i + "}\n"), i = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + i + "return __p;\n";
try {
var a = new Function(t.variable || "obj", "_", i)
} catch (e) {
throw e.source = i, e
}
var s = function(e) {
return a.call(this, e, _)
},
l = t.variable || "obj";
return s.source = "function(" + l + "){\n" + i + "}", s
}, _.chain = function(e) {
var t = _(e);
return t._chain = !0, t
};
var H = function(e, t) {
return e._chain ? _(t).chain() : t
};
_.mixin = function(e) {
_.each(_.functions(e), function(t) {
var n = _[t] = e[t];
_.prototype[t] = function() {
var e = [this._wrapped];
return m.apply(e, arguments), H(this, n.apply(_, e))
}
})
}, _.mixin(_), _.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(e) {
var t = u[e];
_.prototype[e] = function() {
var n = this._wrapped;
return t.apply(n, arguments), "shift" !== e && "splice" !== e || 0 !== n.length || delete n[0], H(this, n)
}
}), _.each(["concat", "join", "slice"], function(e) {
var t = u[e];
_.prototype[e] = function() {
return H(this, t.apply(this._wrapped, arguments))
}
}), _.prototype.value = function() {
return this._wrapped
}, _.prototype.valueOf = _.prototype.toJSON = _.prototype.value, _.prototype.toString = function() {
return "" + this._wrapped
}, r = [], o = function() {
return _
}.apply(t, r), !(void 0 !== o && (e.exports = o))
}).call(this)
}, function(e, t, n) {
var r = n(659);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(660);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(661);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(662);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(663);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(664);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(665);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(666);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, , , , function(e, t, n) {
var r = n(671);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(672);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(673);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(674);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(675);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(676);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(e, t, n) {
var r = n(677);
"string" == typeof r && (r = [
[e.id, r, ""]
]);
n(7)(r, {});
r.locals && (e.exports = r.locals)
}, function(module, exports, __webpack_require__) {
var _ = __webpack_require__(922);
module.exports = function(obj) {
var __t, __p = "",
__j = Array.prototype.join,
print = function() {
__p += __j.call(arguments, "")
};
with(obj || {}) __p += '\r\n\r\n
' + (null == (__t = title) ? "" : __t) + '
\r\n
' + (null == (__t = description) ? "" : __t) + "
";
return __p
}
}, function(e, t, n) {
e.exports = n(2)(210)
}, function(e, t, n) {
e.exports = n(2)(224)
}, function(e, t, n) {
e.exports = n(2)(229)
}, function(e, t, n) {
e.exports = n(2)(234)
}, function(e, t, n) {
e.exports = n(2)(268)
}, function(e, t, n) {
e.exports = n(2)(293)
}, function(e, t, n) {
e.exports = n(2)(337)
}, function(e, t, n) {
e.exports = n(2)(372)
}, function(e, t, n) {
e.exports = n(2)(377)
}, function(e, t, n) {
e.exports = n(2)(388)
}, function(e, t, n) {
e.exports = n(2)(390)
}, function(e, t, n) {
e.exports = n(2)(393)
}, function(e, t, n) {
e.exports = n(2)(396)
}, function(e, t, n) {
e.exports = n(2)(399)
}, function(e, t, n) {
e.exports = n(2)(401)
}, function(e, t, n) {
e.exports = n(2)(421)
}]);
//# sourceMappingURL=app.js.map