| 1 |
<!DOCTYPE html> |
| 2 |
|
| 3 |
<html> |
| 4 |
|
| 5 |
<head> |
| 6 |
|
| 7 |
<meta charset="utf-8" /> |
| 8 |
<meta name="generator" content="pandoc" /> |
| 9 |
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" /> |
| 10 |
|
| 11 |
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
<title>Getting started with profvis</title> |
| 16 |
|
| 17 |
<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to |
| 18 |
// be compatible with the behavior of Pandoc < 2.8). |
| 19 |
document.addEventListener('DOMContentLoaded', function(e) { |
| 20 |
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); |
| 21 |
var i, h, a; |
| 22 |
for (i = 0; i < hs.length; i++) { |
| 23 |
h = hs[i]; |
| 24 |
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 |
| 25 |
a = h.attributes; |
| 26 |
while (a.length > 0) h.removeAttribute(a[0].name); |
| 27 |
} |
| 28 |
}); |
| 29 |
</script> |
| 30 |
<script>(function() { |
| 31 |
// If window.HTMLWidgets is already defined, then use it; otherwise create a |
| 32 |
// new object. This allows preceding code to set options that affect the |
| 33 |
// initialization process (though none currently exist). |
| 34 |
window.HTMLWidgets = window.HTMLWidgets || {}; |
| 35 |
|
| 36 |
// See if we're running in a viewer pane. If not, we're in a web browser. |
| 37 |
var viewerMode = window.HTMLWidgets.viewerMode = |
| 38 |
/\bviewer_pane=1\b/.test(window.location); |
| 39 |
|
| 40 |
// See if we're running in Shiny mode. If not, it's a static document. |
| 41 |
// Note that static widgets can appear in both Shiny and static modes, but |
| 42 |
// obviously, Shiny widgets can only appear in Shiny apps/documents. |
| 43 |
var shinyMode = window.HTMLWidgets.shinyMode = |
| 44 |
typeof(window.Shiny) !== "undefined" && !!window.Shiny.outputBindings; |
| 45 |
|
| 46 |
// We can't count on jQuery being available, so we implement our own |
| 47 |
// version if necessary. |
| 48 |
function querySelectorAll(scope, selector) { |
| 49 |
if (typeof(jQuery) !== "undefined" && scope instanceof jQuery) { |
| 50 |
return scope.find(selector); |
| 51 |
} |
| 52 |
if (scope.querySelectorAll) { |
| 53 |
return scope.querySelectorAll(selector); |
| 54 |
} |
| 55 |
} |
| 56 |
|
| 57 |
function asArray(value) { |
| 58 |
if (value === null) |
| 59 |
return []; |
| 60 |
if ($.isArray(value)) |
| 61 |
return value; |
| 62 |
return [value]; |
| 63 |
} |
| 64 |
|
| 65 |
// Implement jQuery's extend |
| 66 |
function extend(target /*, ... */) { |
| 67 |
if (arguments.length == 1) { |
| 68 |
return target; |
| 69 |
} |
| 70 |
for (var i = 1; i < arguments.length; i++) { |
| 71 |
var source = arguments[i]; |
| 72 |
for (var prop in source) { |
| 73 |
if (source.hasOwnProperty(prop)) { |
| 74 |
target[prop] = source[prop]; |
| 75 |
} |
| 76 |
} |
| 77 |
} |
| 78 |
return target; |
| 79 |
} |
| 80 |
|
| 81 |
// IE8 doesn't support Array.forEach. |
| 82 |
function forEach(values, callback, thisArg) { |
| 83 |
if (values.forEach) { |
| 84 |
values.forEach(callback, thisArg); |
| 85 |
} else { |
| 86 |
for (var i = 0; i < values.length; i++) { |
| 87 |
callback.call(thisArg, values[i], i, values); |
| 88 |
} |
| 89 |
} |
| 90 |
} |
| 91 |
|
| 92 |
// Replaces the specified method with the return value of funcSource. |
| 93 |
// |
| 94 |
// Note that funcSource should not BE the new method, it should be a function |
| 95 |
// that RETURNS the new method. funcSource receives a single argument that is |
| 96 |
// the overridden method, it can be called from the new method. The overridden |
| 97 |
// method can be called like a regular function, it has the target permanently |
| 98 |
// bound to it so "this" will work correctly. |
| 99 |
function overrideMethod(target, methodName, funcSource) { |
| 100 |
var superFunc = target[methodName] || function() {}; |
| 101 |
var superFuncBound = function() { |
| 102 |
return superFunc.apply(target, arguments); |
| 103 |
}; |
| 104 |
target[methodName] = funcSource(superFuncBound); |
| 105 |
} |
| 106 |
|
| 107 |
// Add a method to delegator that, when invoked, calls |
| 108 |
// delegatee.methodName. If there is no such method on |
| 109 |
// the delegatee, but there was one on delegator before |
| 110 |
// delegateMethod was called, then the original version |
| 111 |
// is invoked instead. |
| 112 |
// For example: |
| 113 |
// |
| 114 |
// var a = { |
| 115 |
// method1: function() { console.log('a1'); } |
| 116 |
// method2: function() { console.log('a2'); } |
| 117 |
// }; |
| 118 |
// var b = { |
| 119 |
// method1: function() { console.log('b1'); } |
| 120 |
// }; |
| 121 |
// delegateMethod(a, b, "method1"); |
| 122 |
// delegateMethod(a, b, "method2"); |
| 123 |
// a.method1(); |
| 124 |
// a.method2(); |
| 125 |
// |
| 126 |
// The output would be "b1", "a2". |
| 127 |
function delegateMethod(delegator, delegatee, methodName) { |
| 128 |
var inherited = delegator[methodName]; |
| 129 |
delegator[methodName] = function() { |
| 130 |
var target = delegatee; |
| 131 |
var method = delegatee[methodName]; |
| 132 |
|
| 133 |
// The method doesn't exist on the delegatee. Instead, |
| 134 |
// call the method on the delegator, if it exists. |
| 135 |
if (!method) { |
| 136 |
target = delegator; |
| 137 |
method = inherited; |
| 138 |
} |
| 139 |
|
| 140 |
if (method) { |
| 141 |
return method.apply(target, arguments); |
| 142 |
} |
| 143 |
}; |
| 144 |
} |
| 145 |
|
| 146 |
// Implement a vague facsimilie of jQuery's data method |
| 147 |
function elementData(el, name, value) { |
| 148 |
if (arguments.length == 2) { |
| 149 |
return el["htmlwidget_data_" + name]; |
| 150 |
} else if (arguments.length == 3) { |
| 151 |
el["htmlwidget_data_" + name] = value; |
| 152 |
return el; |
| 153 |
} else { |
| 154 |
throw new Error("Wrong number of arguments for elementData: " + |
| 155 |
arguments.length); |
| 156 |
} |
| 157 |
} |
| 158 |
|
| 159 |
// http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex |
| 160 |
function escapeRegExp(str) { |
| 161 |
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
| 162 |
} |
| 163 |
|
| 164 |
function hasClass(el, className) { |
| 165 |
var re = new RegExp("\\b" + escapeRegExp(className) + "\\b"); |
| 166 |
return re.test(el.className); |
| 167 |
} |
| 168 |
|
| 169 |
// elements - array (or array-like object) of HTML elements |
| 170 |
// className - class name to test for |
| 171 |
// include - if true, only return elements with given className; |
| 172 |
// if false, only return elements *without* given className |
| 173 |
function filterByClass(elements, className, include) { |
| 174 |
var results = []; |
| 175 |
for (var i = 0; i < elements.length; i++) { |
| 176 |
if (hasClass(elements[i], className) == include) |
| 177 |
results.push(elements[i]); |
| 178 |
} |
| 179 |
return results; |
| 180 |
} |
| 181 |
|
| 182 |
function on(obj, eventName, func) { |
| 183 |
if (obj.addEventListener) { |
| 184 |
obj.addEventListener(eventName, func, false); |
| 185 |
} else if (obj.attachEvent) { |
| 186 |
obj.attachEvent(eventName, func); |
| 187 |
} |
| 188 |
} |
| 189 |
|
| 190 |
function off(obj, eventName, func) { |
| 191 |
if (obj.removeEventListener) |
| 192 |
obj.removeEventListener(eventName, func, false); |
| 193 |
else if (obj.detachEvent) { |
| 194 |
obj.detachEvent(eventName, func); |
| 195 |
} |
| 196 |
} |
| 197 |
|
| 198 |
// Translate array of values to top/right/bottom/left, as usual with |
| 199 |
// the "padding" CSS property |
| 200 |
// https://developer.mozilla.org/en-US/docs/Web/CSS/padding |
| 201 |
function unpackPadding(value) { |
| 202 |
if (typeof(value) === "number") |
| 203 |
value = [value]; |
| 204 |
if (value.length === 1) { |
| 205 |
return {top: value[0], right: value[0], bottom: value[0], left: value[0]}; |
| 206 |
} |
| 207 |
if (value.length === 2) { |
| 208 |
return {top: value[0], right: value[1], bottom: value[0], left: value[1]}; |
| 209 |
} |
| 210 |
if (value.length === 3) { |
| 211 |
return {top: value[0], right: value[1], bottom: value[2], left: value[1]}; |
| 212 |
} |
| 213 |
if (value.length === 4) { |
| 214 |
return {top: value[0], right: value[1], bottom: value[2], left: value[3]}; |
| 215 |
} |
| 216 |
} |
| 217 |
|
| 218 |
// Convert an unpacked padding object to a CSS value |
| 219 |
function paddingToCss(paddingObj) { |
| 220 |
return paddingObj.top + "px " + paddingObj.right + "px " + paddingObj.bottom + "px " + paddingObj.left + "px"; |
| 221 |
} |
| 222 |
|
| 223 |
// Makes a number suitable for CSS |
| 224 |
function px(x) { |
| 225 |
if (typeof(x) === "number") |
| 226 |
return x + "px"; |
| 227 |
else |
| 228 |
return x; |
| 229 |
} |
| 230 |
|
| 231 |
// Retrieves runtime widget sizing information for an element. |
| 232 |
// The return value is either null, or an object with fill, padding, |
| 233 |
// defaultWidth, defaultHeight fields. |
| 234 |
function sizingPolicy(el) { |
| 235 |
var sizingEl = document.querySelector("script[data-for='" + el.id + "'][type='application/htmlwidget-sizing']"); |
| 236 |
if (!sizingEl) |
| 237 |
return null; |
| 238 |
var sp = JSON.parse(sizingEl.textContent || sizingEl.text || "{}"); |
| 239 |
if (viewerMode) { |
| 240 |
return sp.viewer; |
| 241 |
} else { |
| 242 |
return sp.browser; |
| 243 |
} |
| 244 |
} |
| 245 |
|
| 246 |
// @param tasks Array of strings (or falsy value, in which case no-op). |
| 247 |
// Each element must be a valid JavaScript expression that yields a |
| 248 |
// function. Or, can be an array of objects with "code" and "data" |
| 249 |
// properties; in this case, the "code" property should be a string |
| 250 |
// of JS that's an expr that yields a function, and "data" should be |
| 251 |
// an object that will be added as an additional argument when that |
| 252 |
// function is called. |
| 253 |
// @param target The object that will be "this" for each function |
| 254 |
// execution. |
| 255 |
// @param args Array of arguments to be passed to the functions. (The |
| 256 |
// same arguments will be passed to all functions.) |
| 257 |
function evalAndRun(tasks, target, args) { |
| 258 |
if (tasks) { |
| 259 |
forEach(tasks, function(task) { |
| 260 |
var theseArgs = args; |
| 261 |
if (typeof(task) === "object") { |
| 262 |
theseArgs = theseArgs.concat([task.data]); |
| 263 |
task = task.code; |
| 264 |
} |
| 265 |
var taskFunc = tryEval(task); |
| 266 |
if (typeof(taskFunc) !== "function") { |
| 267 |
throw new Error("Task must be a function! Source:\n" + task); |
| 268 |
} |
| 269 |
taskFunc.apply(target, theseArgs); |
| 270 |
}); |
| 271 |
} |
| 272 |
} |
| 273 |
|
| 274 |
// Attempt eval() both with and without enclosing in parentheses. |
| 275 |
// Note that enclosing coerces a function declaration into |
| 276 |
// an expression that eval() can parse |
| 277 |
// (otherwise, a SyntaxError is thrown) |
| 278 |
function tryEval(code) { |
| 279 |
var result = null; |
| 280 |
try { |
| 281 |
result = eval("(" + code + ")"); |
| 282 |
} catch(error) { |
| 283 |
if (!(error instanceof SyntaxError)) { |
| 284 |
throw error; |
| 285 |
} |
| 286 |
try { |
| 287 |
result = eval(code); |
| 288 |
} catch(e) { |
| 289 |
if (e instanceof SyntaxError) { |
| 290 |
throw error; |
| 291 |
} else { |
| 292 |
throw e; |
| 293 |
} |
| 294 |
} |
| 295 |
} |
| 296 |
return result; |
| 297 |
} |
| 298 |
|
| 299 |
function initSizing(el) { |
| 300 |
var sizing = sizingPolicy(el); |
| 301 |
if (!sizing) |
| 302 |
return; |
| 303 |
|
| 304 |
var cel = document.getElementById("htmlwidget_container"); |
| 305 |
if (!cel) |
| 306 |
return; |
| 307 |
|
| 308 |
if (typeof(sizing.padding) !== "undefined") { |
| 309 |
document.body.style.margin = "0"; |
| 310 |
document.body.style.padding = paddingToCss(unpackPadding(sizing.padding)); |
| 311 |
} |
| 312 |
|
| 313 |
if (sizing.fill) { |
| 314 |
document.body.style.overflow = "hidden"; |
| 315 |
document.body.style.width = "100%"; |
| 316 |
document.body.style.height = "100%"; |
| 317 |
document.documentElement.style.width = "100%"; |
| 318 |
document.documentElement.style.height = "100%"; |
| 319 |
cel.style.position = "absolute"; |
| 320 |
var pad = unpackPadding(sizing.padding); |
| 321 |
cel.style.top = pad.top + "px"; |
| 322 |
cel.style.right = pad.right + "px"; |
| 323 |
cel.style.bottom = pad.bottom + "px"; |
| 324 |
cel.style.left = pad.left + "px"; |
| 325 |
el.style.width = "100%"; |
| 326 |
el.style.height = "100%"; |
| 327 |
|
| 328 |
return { |
| 329 |
getWidth: function() { return cel.getBoundingClientRect().width; }, |
| 330 |
getHeight: function() { return cel.getBoundingClientRect().height; } |
| 331 |
}; |
| 332 |
|
| 333 |
} else { |
| 334 |
el.style.width = px(sizing.width); |
| 335 |
el.style.height = px(sizing.height); |
| 336 |
|
| 337 |
return { |
| 338 |
getWidth: function() { return cel.getBoundingClientRect().width; }, |
| 339 |
getHeight: function() { return cel.getBoundingClientRect().height; } |
| 340 |
}; |
| 341 |
} |
| 342 |
} |
| 343 |
|
| 344 |
// Default implementations for methods |
| 345 |
var defaults = { |
| 346 |
find: function(scope) { |
| 347 |
return querySelectorAll(scope, "." + this.name); |
| 348 |
}, |
| 349 |
renderError: function(el, err) { |
| 350 |
var $el = $(el); |
| 351 |
|
| 352 |
this.clearError(el); |
| 353 |
|
| 354 |
// Add all these error classes, as Shiny does |
| 355 |
var errClass = "shiny-output-error"; |
| 356 |
if (err.type !== null) { |
| 357 |
// use the classes of the error condition as CSS class names |
| 358 |
errClass = errClass + " " + $.map(asArray(err.type), function(type) { |
| 359 |
return errClass + "-" + type; |
| 360 |
}).join(" "); |
| 361 |
} |
| 362 |
errClass = errClass + " htmlwidgets-error"; |
| 363 |
|
| 364 |
// Is el inline or block? If inline or inline-block, just display:none it |
| 365 |
// and add an inline error. |
| 366 |
var display = $el.css("display"); |
| 367 |
$el.data("restore-display-mode", display); |
| 368 |
|
| 369 |
if (display === "inline" || display === "inline-block") { |
| 370 |
$el.hide(); |
| 371 |
if (err.message !== "") { |
| 372 |
var errorSpan = $("<span>").addClass(errClass); |
| 373 |
errorSpan.text(err.message); |
| 374 |
$el.after(errorSpan); |
| 375 |
} |
| 376 |
} else if (display === "block") { |
| 377 |
// If block, add an error just after the el, set visibility:none on the |
| 378 |
// el, and position the error to be on top of the el. |
| 379 |
// Mark it with a unique ID and CSS class so we can remove it later. |
| 380 |
$el.css("visibility", "hidden"); |
| 381 |
if (err.message !== "") { |
| 382 |
var errorDiv = $("<div>").addClass(errClass).css("position", "absolute") |
| 383 |
.css("top", el.offsetTop) |
| 384 |
.css("left", el.offsetLeft) |
| 385 |
// setting width can push out the page size, forcing otherwise |
| 386 |
// unnecessary scrollbars to appear and making it impossible for |
| 387 |
// the element to shrink; so use max-width instead |
| 388 |
.css("maxWidth", el.offsetWidth) |
| 389 |
.css("height", el.offsetHeight); |
| 390 |
errorDiv.text(err.message); |
| 391 |
$el.after(errorDiv); |
| 392 |
|
| 393 |
// Really dumb way to keep the size/position of the error in sync with |
| 394 |
// the parent element as the window is resized or whatever. |
| 395 |
var intId = setInterval(function() { |
| 396 |
if (!errorDiv[0].parentElement) { |
| 397 |
clearInterval(intId); |
| 398 |
return; |
| 399 |
} |
| 400 |
errorDiv |
| 401 |
.css("top", el.offsetTop) |
| 402 |
.css("left", el.offsetLeft) |
| 403 |
.css("maxWidth", el.offsetWidth) |
| 404 |
.css("height", el.offsetHeight); |
| 405 |
}, 500); |
| 406 |
} |
| 407 |
} |
| 408 |
}, |
| 409 |
clearError: function(el) { |
| 410 |
var $el = $(el); |
| 411 |
var display = $el.data("restore-display-mode"); |
| 412 |
$el.data("restore-display-mode", null); |
| 413 |
|
| 414 |
if (display === "inline" || display === "inline-block") { |
| 415 |
if (display) |
| 416 |
$el.css("display", display); |
| 417 |
$(el.nextSibling).filter(".htmlwidgets-error").remove(); |
| 418 |
} else if (display === "block"){ |
| 419 |
$el.css("visibility", "inherit"); |
| 420 |
$(el.nextSibling).filter(".htmlwidgets-error").remove(); |
| 421 |
} |
| 422 |
}, |
| 423 |
sizing: {} |
| 424 |
}; |
| 425 |
|
| 426 |
// Called by widget bindings to register a new type of widget. The definition |
| 427 |
// object can contain the following properties: |
| 428 |
// - name (required) - A string indicating the binding name, which will be |
| 429 |
// used by default as the CSS classname to look for. |
| 430 |
// - initialize (optional) - A function(el) that will be called once per |
| 431 |
// widget element; if a value is returned, it will be passed as the third |
| 432 |
// value to renderValue. |
| 433 |
// - renderValue (required) - A function(el, data, initValue) that will be |
| 434 |
// called with data. Static contexts will cause this to be called once per |
| 435 |
// element; Shiny apps will cause this to be called multiple times per |
| 436 |
// element, as the data changes. |
| 437 |
window.HTMLWidgets.widget = function(definition) { |
| 438 |
if (!definition.name) { |
| 439 |
throw new Error("Widget must have a name"); |
| 440 |
} |
| 441 |
if (!definition.type) { |
| 442 |
throw new Error("Widget must have a type"); |
| 443 |
} |
| 444 |
// Currently we only support output widgets |
| 445 |
if (definition.type !== "output") { |
| 446 |
throw new Error("Unrecognized widget type '" + definition.type + "'"); |
| 447 |
} |
| 448 |
// TODO: Verify that .name is a valid CSS classname |
| 449 |
|
| 450 |
// Support new-style instance-bound definitions. Old-style class-bound |
| 451 |
// definitions have one widget "object" per widget per type/class of |
| 452 |
// widget; the renderValue and resize methods on such widget objects |
| 453 |
// take el and instance arguments, because the widget object can't |
| 454 |
// store them. New-style instance-bound definitions have one widget |
| 455 |
// object per widget instance; the definition that's passed in doesn't |
| 456 |
// provide renderValue or resize methods at all, just the single method |
| 457 |
// factory(el, width, height) |
| 458 |
// which returns an object that has renderValue(x) and resize(w, h). |
| 459 |
// This enables a far more natural programming style for the widget |
| 460 |
// author, who can store per-instance state using either OO-style |
| 461 |
// instance fields or functional-style closure variables (I guess this |
| 462 |
// is in contrast to what can only be called C-style pseudo-OO which is |
| 463 |
// what we required before). |
| 464 |
if (definition.factory) { |
| 465 |
definition = createLegacyDefinitionAdapter(definition); |
| 466 |
} |
| 467 |
|
| 468 |
if (!definition.renderValue) { |
| 469 |
throw new Error("Widget must have a renderValue function"); |
| 470 |
} |
| 471 |
|
| 472 |
// For static rendering (non-Shiny), use a simple widget registration |
| 473 |
// scheme. We also use this scheme for Shiny apps/documents that also |
| 474 |
// contain static widgets. |
| 475 |
window.HTMLWidgets.widgets = window.HTMLWidgets.widgets || []; |
| 476 |
// Merge defaults into the definition; don't mutate the original definition. |
| 477 |
var staticBinding = extend({}, defaults, definition); |
| 478 |
overrideMethod(staticBinding, "find", function(superfunc) { |
| 479 |
return function(scope) { |
| 480 |
var results = superfunc(scope); |
| 481 |
// Filter out Shiny outputs, we only want the static kind |
| 482 |
return filterByClass(results, "html-widget-output", false); |
| 483 |
}; |
| 484 |
}); |
| 485 |
window.HTMLWidgets.widgets.push(staticBinding); |
| 486 |
|
| 487 |
if (shinyMode) { |
| 488 |
// Shiny is running. Register the definition with an output binding. |
| 489 |
// The definition itself will not be the output binding, instead |
| 490 |
// we will make an output binding object that delegates to the |
| 491 |
// definition. This is because we foolishly used the same method |
| 492 |
// name (renderValue) for htmlwidgets definition and Shiny bindings |
| 493 |
// but they actually have quite different semantics (the Shiny |
| 494 |
// bindings receive data that includes lots of metadata that it |
| 495 |
// strips off before calling htmlwidgets renderValue). We can't |
| 496 |
// just ignore the difference because in some widgets it's helpful |
| 497 |
// to call this.renderValue() from inside of resize(), and if |
| 498 |
// we're not delegating, then that call will go to the Shiny |
| 499 |
// version instead of the htmlwidgets version. |
| 500 |
|
| 501 |
// Merge defaults with definition, without mutating either. |
| 502 |
var bindingDef = extend({}, defaults, definition); |
| 503 |
|
| 504 |
// This object will be our actual Shiny binding. |
| 505 |
var shinyBinding = new Shiny.OutputBinding(); |
| 506 |
|
| 507 |
// With a few exceptions, we'll want to simply use the bindingDef's |
| 508 |
// version of methods if they are available, otherwise fall back to |
| 509 |
// Shiny's defaults. NOTE: If Shiny's output bindings gain additional |
| 510 |
// methods in the future, and we want them to be overrideable by |
| 511 |
// HTMLWidget binding definitions, then we'll need to add them to this |
| 512 |
// list. |
| 513 |
delegateMethod(shinyBinding, bindingDef, "getId"); |
| 514 |
delegateMethod(shinyBinding, bindingDef, "onValueChange"); |
| 515 |
delegateMethod(shinyBinding, bindingDef, "onValueError"); |
| 516 |
delegateMethod(shinyBinding, bindingDef, "renderError"); |
| 517 |
delegateMethod(shinyBinding, bindingDef, "clearError"); |
| 518 |
delegateMethod(shinyBinding, bindingDef, "showProgress"); |
| 519 |
|
| 520 |
// The find, renderValue, and resize are handled differently, because we |
| 521 |
// want to actually decorate the behavior of the bindingDef methods. |
| 522 |
|
| 523 |
shinyBinding.find = function(scope) { |
| 524 |
var results = bindingDef.find(scope); |
| 525 |
|
| 526 |
// Only return elements that are Shiny outputs, not static ones |
| 527 |
var dynamicResults = results.filter(".html-widget-output"); |
| 528 |
|
| 529 |
// It's possible that whatever caused Shiny to think there might be |
| 530 |
// new dynamic outputs, also caused there to be new static outputs. |
| 531 |
// Since there might be lots of different htmlwidgets bindings, we |
| 532 |
// schedule execution for later--no need to staticRender multiple |
| 533 |
// times. |
| 534 |
if (results.length !== dynamicResults.length) |
| 535 |
scheduleStaticRender(); |
| 536 |
|
| 537 |
return dynamicResults; |
| 538 |
}; |
| 539 |
|
| 540 |
// Wrap renderValue to handle initialization, which unfortunately isn't |
| 541 |
// supported natively by Shiny at the time of this writing. |
| 542 |
|
| 543 |
shinyBinding.renderValue = function(el, data) { |
| 544 |
Shiny.renderDependencies(data.deps); |
| 545 |
// Resolve strings marked as javascript literals to objects |
| 546 |
if (!(data.evals instanceof Array)) data.evals = [data.evals]; |
| 547 |
for (var i = 0; data.evals && i < data.evals.length; i++) { |
| 548 |
window.HTMLWidgets.evaluateStringMember(data.x, data.evals[i]); |
| 549 |
} |
| 550 |
if (!bindingDef.renderOnNullValue) { |
| 551 |
if (data.x === null) { |
| 552 |
el.style.visibility = "hidden"; |
| 553 |
return; |
| 554 |
} else { |
| 555 |
el.style.visibility = "inherit"; |
| 556 |
} |
| 557 |
} |
| 558 |
if (!elementData(el, "initialized")) { |
| 559 |
initSizing(el); |
| 560 |
|
| 561 |
elementData(el, "initialized", true); |
| 562 |
if (bindingDef.initialize) { |
| 563 |
var rect = el.getBoundingClientRect(); |
| 564 |
var result = bindingDef.initialize(el, rect.width, rect.height); |
| 565 |
elementData(el, "init_result", result); |
| 566 |
} |
| 567 |
} |
| 568 |
bindingDef.renderValue(el, data.x, elementData(el, "init_result")); |
| 569 |
evalAndRun(data.jsHooks.render, elementData(el, "init_result"), [el, data.x]); |
| 570 |
}; |
| 571 |
|
| 572 |
// Only override resize if bindingDef implements it |
| 573 |
if (bindingDef.resize) { |
| 574 |
shinyBinding.resize = function(el, width, height) { |
| 575 |
// Shiny can call resize before initialize/renderValue have been |
| 576 |
// called, which doesn't make sense for widgets. |
| 577 |
if (elementData(el, "initialized")) { |
| 578 |
bindingDef.resize(el, width, height, elementData(el, "init_result")); |
| 579 |
} |
| 580 |
}; |
| 581 |
} |
| 582 |
|
| 583 |
Shiny.outputBindings.register(shinyBinding, bindingDef.name); |
| 584 |
} |
| 585 |
}; |
| 586 |
|
| 587 |
var scheduleStaticRenderTimerId = null; |
| 588 |
function scheduleStaticRender() { |
| 589 |
if (!scheduleStaticRenderTimerId) { |
| 590 |
scheduleStaticRenderTimerId = setTimeout(function() { |
| 591 |
scheduleStaticRenderTimerId = null; |
| 592 |
window.HTMLWidgets.staticRender(); |
| 593 |
}, 1); |
| 594 |
} |
| 595 |
} |
| 596 |
|
| 597 |
// Render static widgets after the document finishes loading |
| 598 |
// Statically render all elements that are of this widget's class |
| 599 |
window.HTMLWidgets.staticRender = function() { |
| 600 |
var bindings = window.HTMLWidgets.widgets || []; |
| 601 |
forEach(bindings, function(binding) { |
| 602 |
var matches = binding.find(document.documentElement); |
| 603 |
forEach(matches, function(el) { |
| 604 |
var sizeObj = initSizing(el, binding); |
| 605 |
|
| 606 |
var getSize = function(el) { |
| 607 |
if (sizeObj) { |
| 608 |
return {w: sizeObj.getWidth(), h: sizeObj.getHeight()} |
| 609 |
} else { |
| 610 |
var rect = el.getBoundingClientRect(); |
| 611 |
return {w: rect.width, h: rect.height} |
| 612 |
} |
| 613 |
}; |
| 614 |
|
| 615 |
if (hasClass(el, "html-widget-static-bound")) |
| 616 |
return; |
| 617 |
el.className = el.className + " html-widget-static-bound"; |
| 618 |
|
| 619 |
var initResult; |
| 620 |
if (binding.initialize) { |
| 621 |
var size = getSize(el); |
| 622 |
initResult = binding.initialize(el, size.w, size.h); |
| 623 |
elementData(el, "init_result", initResult); |
| 624 |
} |
| 625 |
|
| 626 |
if (binding.resize) { |
| 627 |
var lastSize = getSize(el); |
| 628 |
var resizeHandler = function(e) { |
| 629 |
var size = getSize(el); |
| 630 |
if (size.w === 0 && size.h === 0) |
| 631 |
return; |
| 632 |
if (size.w === lastSize.w && size.h === lastSize.h) |
| 633 |
return; |
| 634 |
lastSize = size; |
| 635 |
binding.resize(el, size.w, size.h, initResult); |
| 636 |
}; |
| 637 |
|
| 638 |
on(window, "resize", resizeHandler); |
| 639 |
|
| 640 |
// This is needed for cases where we're running in a Shiny |
| 641 |
// app, but the widget itself is not a Shiny output, but |
| 642 |
// rather a simple static widget. One example of this is |
| 643 |
// an rmarkdown document that has runtime:shiny and widget |
| 644 |
// that isn't in a render function. Shiny only knows to |
| 645 |
// call resize handlers for Shiny outputs, not for static |
| 646 |
// widgets, so we do it ourselves. |
| 647 |
if (window.jQuery) { |
| 648 |
window.jQuery(document).on( |
| 649 |
"shown.htmlwidgets shown.bs.tab.htmlwidgets shown.bs.collapse.htmlwidgets", |
| 650 |
resizeHandler |
| 651 |
); |
| 652 |
window.jQuery(document).on( |
| 653 |
"hidden.htmlwidgets hidden.bs.tab.htmlwidgets hidden.bs.collapse.htmlwidgets", |
| 654 |
resizeHandler |
| 655 |
); |
| 656 |
} |
| 657 |
|
| 658 |
// This is needed for the specific case of ioslides, which |
| 659 |
// flips slides between display:none and display:block. |
| 660 |
// Ideally we would not have to have ioslide-specific code |
| 661 |
// here, but rather have ioslides raise a generic event, |
| 662 |
// but the rmarkdown package just went to CRAN so the |
| 663 |
// window to getting that fixed may be long. |
| 664 |
if (window.addEventListener) { |
| 665 |
// It's OK to limit this to window.addEventListener |
| 666 |
// browsers because ioslides itself only supports |
| 667 |
// such browsers. |
| 668 |
on(document, "slideenter", resizeHandler); |
| 669 |
on(document, "slideleave", resizeHandler); |
| 670 |
} |
| 671 |
} |
| 672 |
|
| 673 |
var scriptData = document.querySelector("script[data-for='" + el.id + "'][type='application/json']"); |
| 674 |
if (scriptData) { |
| 675 |
var data = JSON.parse(scriptData.textContent || scriptData.text); |
| 676 |
// Resolve strings marked as javascript literals to objects |
| 677 |
if (!(data.evals instanceof Array)) data.evals = [data.evals]; |
| 678 |
for (var k = 0; data.evals && k < data.evals.length; k++) { |
| 679 |
window.HTMLWidgets.evaluateStringMember(data.x, data.evals[k]); |
| 680 |
} |
| 681 |
binding.renderValue(el, data.x, initResult); |
| 682 |
evalAndRun(data.jsHooks.render, initResult, [el, data.x]); |
| 683 |
} |
| 684 |
}); |
| 685 |
}); |
| 686 |
|
| 687 |
invokePostRenderHandlers(); |
| 688 |
} |
| 689 |
|
| 690 |
|
| 691 |
function has_jQuery3() { |
| 692 |
if (!window.jQuery) { |
| 693 |
return false; |
| 694 |
} |
| 695 |
var $version = window.jQuery.fn.jquery; |
| 696 |
var $major_version = parseInt($version.split(".")[0]); |
| 697 |
return $major_version >= 3; |
| 698 |
} |
| 699 |
|
| 700 |
/* |
| 701 |
/ Shiny 1.4 bumped jQuery from 1.x to 3.x which means jQuery's |
| 702 |
/ on-ready handler (i.e., $(fn)) is now asyncronous (i.e., it now |
| 703 |
/ really means $(setTimeout(fn)). |
| 704 |
/ https://jquery.com/upgrade-guide/3.0/#breaking-change-document-ready-handlers-are-now-asynchronous |
| 705 |
/ |
| 706 |
/ Since Shiny uses $() to schedule initShiny, shiny>=1.4 calls initShiny |
| 707 |
/ one tick later than it did before, which means staticRender() is |
| 708 |
/ called renderValue() earlier than (advanced) widget authors might be expecting. |
| 709 |
/ https://github.com/rstudio/shiny/issues/2630 |
| 710 |
/ |
| 711 |
/ For a concrete example, leaflet has some methods (e.g., updateBounds) |
| 712 |
/ which reference Shiny methods registered in initShiny (e.g., setInputValue). |
| 713 |
/ Since leaflet is privy to this life-cycle, it knows to use setTimeout() to |
| 714 |
/ delay execution of those methods (until Shiny methods are ready) |
| 715 |
/ https://github.com/rstudio/leaflet/blob/18ec981/javascript/src/index.js#L266-L268 |
| 716 |
/ |
| 717 |
/ Ideally widget authors wouldn't need to use this setTimeout() hack that |
| 718 |
/ leaflet uses to call Shiny methods on a staticRender(). In the long run, |
| 719 |
/ the logic initShiny should be broken up so that method registration happens |
| 720 |
/ right away, but binding happens later. |
| 721 |
*/ |
| 722 |
function maybeStaticRenderLater() { |
| 723 |
if (shinyMode && has_jQuery3()) { |
| 724 |
window.jQuery(window.HTMLWidgets.staticRender); |
| 725 |
} else { |
| 726 |
window.HTMLWidgets.staticRender(); |
| 727 |
} |
| 728 |
} |
| 729 |
|
| 730 |
if (document.addEventListener) { |
| 731 |
document.addEventListener("DOMContentLoaded", function() { |
| 732 |
document.removeEventListener("DOMContentLoaded", arguments.callee, false); |
| 733 |
maybeStaticRenderLater(); |
| 734 |
}, false); |
| 735 |
} else if (document.attachEvent) { |
| 736 |
document.attachEvent("onreadystatechange", function() { |
| 737 |
if (document.readyState === "complete") { |
| 738 |
document.detachEvent("onreadystatechange", arguments.callee); |
| 739 |
maybeStaticRenderLater(); |
| 740 |
} |
| 741 |
}); |
| 742 |
} |
| 743 |
|
| 744 |
|
| 745 |
window.HTMLWidgets.getAttachmentUrl = function(depname, key) { |
| 746 |
// If no key, default to the first item |
| 747 |
if (typeof(key) === "undefined") |
| 748 |
key = 1; |
| 749 |
|
| 750 |
var link = document.getElementById(depname + "-" + key + "-attachment"); |
| 751 |
if (!link) { |
| 752 |
throw new Error("Attachment " + depname + "/" + key + " not found in document"); |
| 753 |
} |
| 754 |
return link.getAttribute("href"); |
| 755 |
}; |
| 756 |
|
| 757 |
window.HTMLWidgets.dataframeToD3 = function(df) { |
| 758 |
var names = []; |
| 759 |
var length; |
| 760 |
for (var name in df) { |
| 761 |
if (df.hasOwnProperty(name)) |
| 762 |
names.push(name); |
| 763 |
if (typeof(df[name]) !== "object" || typeof(df[name].length) === "undefined") { |
| 764 |
throw new Error("All fields must be arrays"); |
| 765 |
} else if (typeof(length) !== "undefined" && length !== df[name].length) { |
| 766 |
throw new Error("All fields must be arrays of the same length"); |
| 767 |
} |
| 768 |
length = df[name].length; |
| 769 |
} |
| 770 |
var results = []; |
| 771 |
var item; |
| 772 |
for (var row = 0; row < length; row++) { |
| 773 |
item = {}; |
| 774 |
for (var col = 0; col < names.length; col++) { |
| 775 |
item[names[col]] = df[names[col]][row]; |
| 776 |
} |
| 777 |
results.push(item); |
| 778 |
} |
| 779 |
return results; |
| 780 |
}; |
| 781 |
|
| 782 |
window.HTMLWidgets.transposeArray2D = function(array) { |
| 783 |
if (array.length === 0) return array; |
| 784 |
var newArray = array[0].map(function(col, i) { |
| 785 |
return array.map(function(row) { |
| 786 |
return row[i] |
| 787 |
}) |
| 788 |
}); |
| 789 |
return newArray; |
| 790 |
}; |
| 791 |
// Split value at splitChar, but allow splitChar to be escaped |
| 792 |
// using escapeChar. Any other characters escaped by escapeChar |
| 793 |
// will be included as usual (including escapeChar itself). |
| 794 |
function splitWithEscape(value, splitChar, escapeChar) { |
| 795 |
var results = []; |
| 796 |
var escapeMode = false; |
| 797 |
var currentResult = ""; |
| 798 |
for (var pos = 0; pos < value.length; pos++) { |
| 799 |
if (!escapeMode) { |
| 800 |
if (value[pos] === splitChar) { |
| 801 |
results.push(currentResult); |
| 802 |
currentResult = ""; |
| 803 |
} else if (value[pos] === escapeChar) { |
| 804 |
escapeMode = true; |
| 805 |
} else { |
| 806 |
currentResult += value[pos]; |
| 807 |
} |
| 808 |
} else { |
| 809 |
currentResult += value[pos]; |
| 810 |
escapeMode = false; |
| 811 |
} |
| 812 |
} |
| 813 |
if (currentResult !== "") { |
| 814 |
results.push(currentResult); |
| 815 |
} |
| 816 |
return results; |
| 817 |
} |
| 818 |
// Function authored by Yihui/JJ Allaire |
| 819 |
window.HTMLWidgets.evaluateStringMember = function(o, member) { |
| 820 |
var parts = splitWithEscape(member, '.', '\\'); |
| 821 |
for (var i = 0, l = parts.length; i < l; i++) { |
| 822 |
var part = parts[i]; |
| 823 |
// part may be a character or 'numeric' member name |
| 824 |
if (o !== null && typeof o === "object" && part in o) { |
| 825 |
if (i == (l - 1)) { // if we are at the end of the line then evalulate |
| 826 |
if (typeof o[part] === "string") |
| 827 |
o[part] = tryEval(o[part]); |
| 828 |
} else { // otherwise continue to next embedded object |
| 829 |
o = o[part]; |
| 830 |
} |
| 831 |
} |
| 832 |
} |
| 833 |
}; |
| 834 |
|
| 835 |
// Retrieve the HTMLWidget instance (i.e. the return value of an |
| 836 |
// HTMLWidget binding's initialize() or factory() function) |
| 837 |
// associated with an element, or null if none. |
| 838 |
window.HTMLWidgets.getInstance = function(el) { |
| 839 |
return elementData(el, "init_result"); |
| 840 |
}; |
| 841 |
|
| 842 |
// Finds the first element in the scope that matches the selector, |
| 843 |
// and returns the HTMLWidget instance (i.e. the return value of |
| 844 |
// an HTMLWidget binding's initialize() or factory() function) |
| 845 |
// associated with that element, if any. If no element matches the |
| 846 |
// selector, or the first matching element has no HTMLWidget |
| 847 |
// instance associated with it, then null is returned. |
| 848 |
// |
| 849 |
// The scope argument is optional, and defaults to window.document. |
| 850 |
window.HTMLWidgets.find = function(scope, selector) { |
| 851 |
if (arguments.length == 1) { |
| 852 |
selector = scope; |
| 853 |
scope = document; |
| 854 |
} |
| 855 |
|
| 856 |
var el = scope.querySelector(selector); |
| 857 |
if (el === null) { |
| 858 |
return null; |
| 859 |
} else { |
| 860 |
return window.HTMLWidgets.getInstance(el); |
| 861 |
} |
| 862 |
}; |
| 863 |
|
| 864 |
// Finds all elements in the scope that match the selector, and |
| 865 |
// returns the HTMLWidget instances (i.e. the return values of |
| 866 |
// an HTMLWidget binding's initialize() or factory() function) |
| 867 |
// associated with the elements, in an array. If elements that |
| 868 |
// match the selector don't have an associated HTMLWidget |
| 869 |
// instance, the returned array will contain nulls. |
| 870 |
// |
| 871 |
// The scope argument is optional, and defaults to window.document. |
| 872 |
window.HTMLWidgets.findAll = function(scope, selector) { |
| 873 |
if (arguments.length == 1) { |
| 874 |
selector = scope; |
| 875 |
scope = document; |
| 876 |
} |
| 877 |
|
| 878 |
var nodes = scope.querySelectorAll(selector); |
| 879 |
var results = []; |
| 880 |
for (var i = 0; i < nodes.length; i++) { |
| 881 |
results.push(window.HTMLWidgets.getInstance(nodes[i])); |
| 882 |
} |
| 883 |
return results; |
| 884 |
}; |
| 885 |
|
| 886 |
var postRenderHandlers = []; |
| 887 |
function invokePostRenderHandlers() { |
| 888 |
while (postRenderHandlers.length) { |
| 889 |
var handler = postRenderHandlers.shift(); |
| 890 |
if (handler) { |
| 891 |
handler(); |
| 892 |
} |
| 893 |
} |
| 894 |
} |
| 895 |
|
| 896 |
// Register the given callback function to be invoked after the |
| 897 |
// next time static widgets are rendered. |
| 898 |
window.HTMLWidgets.addPostRenderHandler = function(callback) { |
| 899 |
postRenderHandlers.push(callback); |
| 900 |
}; |
| 901 |
|
| 902 |
// Takes a new-style instance-bound definition, and returns an |
| 903 |
// old-style class-bound definition. This saves us from having |
| 904 |
// to rewrite all the logic in this file to accomodate both |
| 905 |
// types of definitions. |
| 906 |
function createLegacyDefinitionAdapter(defn) { |
| 907 |
var result = { |
| 908 |
name: defn.name, |
| 909 |
type: defn.type, |
| 910 |
initialize: function(el, width, height) { |
| 911 |
return defn.factory(el, width, height); |
| 912 |
}, |
| 913 |
renderValue: function(el, x, instance) { |
| 914 |
return instance.renderValue(x); |
| 915 |
}, |
| 916 |
resize: function(el, width, height, instance) { |
| 917 |
return instance.resize(width, height); |
| 918 |
} |
| 919 |
}; |
| 920 |
|
| 921 |
if (defn.find) |
| 922 |
result.find = defn.find; |
| 923 |
if (defn.renderError) |
| 924 |
result.renderError = defn.renderError; |
| 925 |
if (defn.clearError) |
| 926 |
result.clearError = defn.clearError; |
| 927 |
|
| 928 |
return result; |
| 929 |
} |
| 930 |
})(); |
| 931 |
</script> |
| 932 |
<script>/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ |
| 933 |
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=ce.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<ce(i,this).index(l):ce.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Yt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&ie.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce}); |
| 934 |
</script> |
| 935 |
<script>!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=da.length;r>e;++e){var u=da[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new l;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function S(){ta.event.preventDefault()}function k(){for(var n,t=ta.event;n=t.sourceEvent;)t=n;return t}function E(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=ta.event;u.target=n,ta.event=u,t[u.type].apply(e,r)}finally{ta.event=i}}},t}function A(n){return ya(n,_a),n}function N(n){return"function"==typeof n?n:function(){return Ma(n,this)}}function C(n){return"function"==typeof n?n:function(){return xa(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ta.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function q(n){return n.trim().replace(/\s+/g," ")}function L(n){return new RegExp("(?:^|\\s+)"+ta.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=T(n).map(D);var u=n.length;return"function"==typeof t?r:e}function D(n){var t=L(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",q(u+" "+n))):e.setAttribute("class",q(u.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e?t.createElementNS(e,n):t.createElement(n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ta.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return ba(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function Z(n){return ya(n,Sa),n}function V(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,ra(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+ta.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=$;a>0&&(n=n.slice(0,a));var l=ka.get(n);return l&&(n=l,c=B),a?t?u:r:t?b:i}function $(n,t){return function(e){var r=ta.event;ta.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ta.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Aa,u="click"+r,i=ta.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ea&&(Ea="onselectstart"in e?!1:x(e.style,"userSelect")),Ea){var o=n(e).style,a=o[Ea];o[Ea]="none"}return function(n){if(i.on(r,null),Ea&&(o[Ea]=a),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Na){var i=t(n);if(i.scrollX||i.scrollY){r=ta.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Na=!(o.f||o.e),r.remove()}}return Na?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ta.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nt(n){return n>1?0:-1>n?qa:Math.acos(n)}function tt(n){return n>1?Ra:-1>n?-Ra:Math.asin(n)}function et(n){return((n=Math.exp(n))-1/n)/2}function rt(n){return((n=Math.exp(n))+1/n)/2}function ut(n){return((n=Math.exp(2*n))-1)/(n+1)}function it(n){return(n=Math.sin(n/2))*n}function ot(){}function at(n,t,e){return this instanceof at?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof at?new at(n.h,n.s,n.l):bt(""+n,_t,at):new at(n,t,e)}function ct(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new mt(u(n+120),u(n),u(n-120))}function lt(n,t,e){return this instanceof lt?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof lt?new lt(n.h,n.c,n.l):n instanceof ft?gt(n.l,n.a,n.b):gt((n=wt((n=ta.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new lt(n,t,e)}function st(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new ft(e,Math.cos(n*=Da)*t,Math.sin(n)*t)}function ft(n,t,e){return this instanceof ft?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof ft?new ft(n.l,n.a,n.b):n instanceof lt?st(n.h,n.c,n.l):wt((n=mt(n)).r,n.g,n.b):new ft(n,t,e)}function ht(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=pt(u)*Xa,r=pt(r)*$a,i=pt(i)*Ba,new mt(dt(3.2404542*u-1.5371385*r-.4985314*i),dt(-.969266*u+1.8760108*r+.041556*i),dt(.0556434*u-.2040259*r+1.0572252*i))}function gt(n,t,e){return n>0?new lt(Math.atan2(e,t)*Pa,Math.sqrt(t*t+e*e),n):new lt(0/0,0/0,n)}function pt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function vt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function dt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mt(n,t,e){return this instanceof mt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mt?new mt(n.r,n.g,n.b):bt(""+n,mt,ct):new mt(n,t,e)}function yt(n){return new mt(n>>16,n>>8&255,255&n)}function Mt(n){return yt(n)+""}function xt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function bt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(kt(u[0]),kt(u[1]),kt(u[2]))}return(i=Ga.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function _t(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new at(r,u,c)}function wt(n,t,e){n=St(n),t=St(t),e=St(e);var r=vt((.4124564*n+.3575761*t+.1804375*e)/Xa),u=vt((.2126729*n+.7151522*t+.072175*e)/$a),i=vt((.0193339*n+.119192*t+.9503041*e)/Ba);return ft(116*u-16,500*(r-u),200*(u-i))}function St(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function kt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function Et(n){return"function"==typeof n?n:function(){return n}}function At(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Nt(t,e,n,r)}}function Nt(n,t,e,r){function u(){var n,t=c.status;if(!t&&zt(c)||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return void o.error.call(i,r)}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ta.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ta.event;ta.event=n;try{o.progress.call(i,c)}finally{ta.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ra(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},ta.rebind(i,o,"on"),null==r?i:i.get(Ct(r))}function Ct(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function zt(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qt(){var n=Lt(),t=Tt()-n;t>24?(isFinite(t)&&(clearTimeout(tc),tc=setTimeout(qt,t)),nc=0):(nc=1,rc(qt))}function Lt(){var n=Date.now();for(ec=Ka;ec;)n>=ec.t&&(ec.f=ec.c(n-ec.t)),ec=ec.n;return n}function Tt(){for(var n,t=Ka,e=1/0;t;)t.f?t=n?n.n=t.n:Ka=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return Qa=n,e}function Rt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Dt(n,t){var e=Math.pow(10,3*ga(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Pt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],o=0,a=r[0],c=0;u>0&&a>0&&(c+a+1>t&&(a=Math.max(1,t-c)),i.push(n.substring(u-=a,u+a)),!((c+=a+1)>t));)a=r[o=(o+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=ic.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",c=e[4]||"",l=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=oc.get(g)||Ut;var M=l&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>p){var c=ta.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!l&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===o?u+n+k:">"===o?k+u+n:"^"===o?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Ut(n){return n+""}function jt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ft(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new cc(e-1)),1),e}function i(n,e){return t(n=new cc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{cc=jt;var r=new jt;return r._=n,o(r,t,e)}finally{cc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ht(n);return c.floor=c,c.round=Ht(r),c.ceil=Ht(u),c.offset=Ht(i),c.range=a,n}function Ht(n){return function(t,e){try{cc=jt;var r=new jt;return r._=t,n(r,e)._}finally{cc=Date}}}function Ot(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(c,a)),null!=(u=sc[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=N[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.slice(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&cc!==jt,o=new(i?jt:cc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,l=e.length;c>a;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=C[o in sc?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.slice(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,N.c.toString(),t,r)}function c(n,t,r){return e(n,N.x.toString(),t,r)}function l(n,t,r){return e(n,N.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{cc=jt;var t=new cc;return t._=n,r(t)}finally{cc=Date}}var r=t(n);return e.parse=function(n){try{cc=jt;var t=r.parse(n);return t&&t._}finally{cc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ae;var M=ta.map(),x=Yt(v),b=Zt(v),_=Yt(d),w=Zt(d),S=Yt(m),k=Zt(m),E=Yt(y),A=Zt(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var N={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+ac.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(ac.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(ac.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},C={a:r,A:u,b:i,B:o,c:a,d:Qt,e:Qt,H:te,I:te,j:ne,L:ue,m:Kt,M:ee,p:s,S:re,U:Xt,w:Vt,W:$t,x:c,X:l,y:Wt,Y:Bt,Z:Jt,"%":oe};return t}function It(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Yt(n){return new RegExp("^(?:"+n.map(ta.requote).join("|")+")","i")}function Zt(n){for(var t=new l,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Vt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Xt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function $t(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Bt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Wt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.y=Gt(+r[0]),e+r[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n){return n+(n>68?1900:2e3)}function Kt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Qt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function ne(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function te(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ee(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function re(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ue(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=ga(t)/60|0,u=ga(t)%60;return e+It(r,"0",2)+It(u,"0",2)}function oe(n,t,e){hc.lastIndex=0;var r=hc.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ae(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ce(){}function le(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function se(n,t){n&&dc.hasOwnProperty(n.type)&&dc[n.type](n,t)}function fe(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function he(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)fe(n[e],t,1);t.polygonEnd()}function ge(){function n(n,t){n*=Da,t=t*Da/2+qa/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),s=i*l,f=u*c+s*Math.cos(a),h=s*o*Math.sin(a);yc.add(Math.atan2(h,f)),r=n,u=c,i=l}var t,e,r,u,i;Mc.point=function(o,a){Mc.point=n,r=(t=o)*Da,u=Math.cos(a=(e=a)*Da/2+qa/4),i=Math.sin(a)},Mc.lineEnd=function(){n(t,e)}}function pe(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function ve(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function de(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function me(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ye(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Me(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function xe(n){return[Math.atan2(n[1],n[0]),tt(n[2])]}function be(n,t){return ga(n[0]-t[0])<Ca&&ga(n[1]-t[1])<Ca}function _e(n,t){n*=Da;var e=Math.cos(t*=Da);we(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function we(n,t,e){++xc,_c+=(n-_c)/xc,wc+=(t-wc)/xc,Sc+=(e-Sc)/xc}function Se(){function n(n,u){n*=Da;var i=Math.cos(u*=Da),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=e*c-r*a)*l+(l=r*o-t*c)*l+(l=t*a-e*o)*l),t*o+e*a+r*c);bc+=l,kc+=l*(t+(t=o)),Ec+=l*(e+(e=a)),Ac+=l*(r+(r=c)),we(t,e,r)}var t,e,r;qc.point=function(u,i){u*=Da;var o=Math.cos(i*=Da);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),qc.point=n,we(t,e,r)}}function ke(){qc.point=_e}function Ee(){function n(n,t){n*=Da;var e=Math.cos(t*=Da),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-r*c,f=r*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=r*o+u*a+i*c,p=h&&-nt(g)/h,v=Math.atan2(h,g);Nc+=p*l,Cc+=p*s,zc+=p*f,bc+=v,kc+=v*(r+(r=o)),Ec+=v*(u+(u=a)),Ac+=v*(i+(i=c)),we(r,u,i)}var t,e,r,u,i;qc.point=function(o,a){t=o,e=a,qc.point=n,o*=Da;var c=Math.cos(a*=Da);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),we(r,u,i)},qc.lineEnd=function(){n(t,e),qc.lineEnd=ke,qc.point=_e}}function Ae(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function Ne(){return!0}function Ce(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(be(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return void u.lineEnd()}var c=new qe(e,n,null,!0),l=new qe(e,null,c,!1);c.o=l,i.push(c),o.push(l),c=new qe(r,n,null,!1),l=new qe(r,null,c,!0),c.o=l,i.push(c),o.push(l)}}),o.sort(t),ze(i),ze(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,l=s.length;l>a;++a)u.point((f=s[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var a=s.length-1;a>=0;--a)u.point((f=s[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ze(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function qe(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Le(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function l(){y.point=o,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Te))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=ta.merge(g);var n=Fe(m,p);g.length?(b||(i.polygonStart(),b=!0),Ce(g,De,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Re(),x=t(M),b=!1;return y}}function Te(n){return n.length>1}function Re(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function De(n,t){return((n=n.x)[0]<0?n[1]-Ra-Ca:Ra-n[1])-((t=t.x)[0]<0?t[1]-Ra-Ca:Ra-t[1])}function Pe(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?qa:-qa,c=ga(i-e);ga(c-qa)<Ca?(n.point(e,r=(r+o)/2>0?Ra:-Ra),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=qa&&(ga(e-u)<Ca&&(e-=u*Ca),ga(i-a)<Ca&&(i-=a*Ca),r=Ue(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function Ue(n,t,e,r){var u,i,o=Math.sin(n-e);return ga(o)>Ca?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function je(n,t,e,r){var u;if(null==n)u=e*Ra,r.point(-qa,u),r.point(0,u),r.point(qa,u),r.point(qa,0),r.point(qa,-u),r.point(0,-u),r.point(-qa,-u),r.point(-qa,0),r.point(-qa,u);else if(ga(n[0]-t[0])>Ca){var i=n[0]<t[0]?qa:-qa;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function Fe(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;yc.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+qa/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=l[d];var m=n[0],y=n[1]/2+qa/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>qa,k=p*M;if(yc.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*La:b,S^h>=e^m>=e){var E=de(pe(f),pe(n));Me(E);var A=de(u,E);Me(A);var N=(S^b>=0?-1:1)*tt(A[2]);(r>N||r===N&&(E[0]||E[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Ca>i||Ca>i&&0>yc)^1&o}function He(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?qa:-qa),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(be(e,g)||be(p,g))&&(p[0]+=Ca,p[1]+=Ca,v=t(p[0],p[1]))),v!==c)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&be(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=pe(n),u=pe(t),o=[1,0,0],a=de(r,u),c=ve(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=de(o,a),p=ye(o,f),v=ye(a,h);me(p,v);var d=g,m=ve(p,d),y=ve(d,d),M=m*m-y*(ve(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=ye(d,(-m-x)/y);if(me(b,p),b=xe(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=ga(A-qa)<Ca,C=N||Ca>A;if(!N&&k>E&&(_=k,k=E,E=_),C?N?k+E>0^b[1]<(ga(b[0]-w)<Ca?k:E):k<=b[1]&&b[1]<=E:A>qa^(w<=b[0]&&b[0]<=S)){var z=ye(d,(-m+x)/y);return me(z,p),[b,xe(z)]}}}function u(t,e){var r=o?n:qa-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ga(i)>Ca,c=gr(n,6*Da);return Le(t,e,c,o?[0,-n]:[-qa,n-qa])}function Oe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,l=o.y,s=a.x,f=a.y,h=0,g=1,p=s-c,v=f-l;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-l,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-l,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:l+h*v}),1>g&&(u.b={x:c+g*p,y:l+g*v}),u}}}}}}function Ie(n,t,e,r){function u(r,u){return ga(r[0]-n)<Ca?u>0?0:3:ga(r[0]-e)<Ca?u>0?2:1:ga(r[1]-t)<Ca?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&Q(l,i,n)>0&&++t:i[1]<=r&&Q(l,i,n)<0&&--t,l=i;return 0!==t}function l(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&a.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=0/0}function g(){v&&(p(y,M),x&&w&&A.rejoin(),v.push(A.buffer())),C.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Tc,Math.min(Tc,n)),t=Math.max(-Tc,Math.min(Tc,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};N(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,E=a,A=Re(),N=Oe(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=ta.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),u&&Ce(v,i,t,l,a),a.polygonEnd()),v=d=m=null}};return C}}function Ye(n){var t=0,e=qa/3,r=ir(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*qa/180,e=n[1]*qa/180):[t/qa*180,e/qa*180]},u}function Ze(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,tt((i-(n*n+e*e)*u*u)/(2*u))]},e}function Ve(){function n(n,t){Dc+=u*n-r*t,r=n,u=t}var t,e,r,u;Hc.point=function(i,o){Hc.point=n,t=r=i,e=u=o},Hc.lineEnd=function(){n(t,e)}}function Xe(n,t){Pc>n&&(Pc=n),n>jc&&(jc=n),Uc>t&&(Uc=t),t>Fc&&(Fc=t)}function $e(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Be(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Be(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Be(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function We(n,t){_c+=n,wc+=t,++Sc}function Je(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);kc+=o*(t+n)/2,Ec+=o*(e+r)/2,Ac+=o,We(t=n,e=r)}var t,e;Ic.point=function(r,u){Ic.point=n,We(t=r,e=u)}}function Ge(){Ic.point=We}function Ke(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);kc+=o*(r+n)/2,Ec+=o*(u+t)/2,Ac+=o,o=u*n-r*t,Nc+=o*(r+n),Cc+=o*(u+t),zc+=3*o,We(r=n,u=t)}var t,e,r,u;Ic.point=function(i,o){Ic.point=n,We(t=r=i,e=u=o)},Ic.lineEnd=function(){n(t,e)}}function Qe(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,La)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function nr(n){function t(n){return(a?r:e)(n)}function e(t){return rr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=0/0,S.point=i,t.lineStart()}function i(e,r){var i=pe([e,r]),o=n(e,r);u(M,x,y,b,_,w,M=o[0],x=o[1],y=e,b=i[0],_=i[1],w=i[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c |
| 936 |
},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=c+p,w=l+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=ga(ga(w)-1)<Ca||ga(r-h)<Ca?(r+h)/2:Math.atan2(_,b),A=n(E,k),N=A[0],C=A[1],z=N-t,q=C-e,L=M*z-y*q;(L*L/x>i||ga((y*z+M*q)/x-.5)>.3||o>a*g+c*p+l*v)&&(u(t,e,r,a,c,l,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Da),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function tr(n){var t=nr(function(t,e){return n([t*Pa,e*Pa])});return function(n){return or(t(n))}}function er(n){this.stream=n}function rr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ur(n){return ir(function(){return n})()}function ir(n){function t(n){return n=a(n[0]*Da,n[1]*Da),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Pa,n[1]*Pa]}function r(){a=Ae(o=lr(m,M,x),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=nr(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Lc,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=or(b(o,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Lc):He((w=+n)*Da),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Ie(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Da,d=n[1]%360*Da,r()):[v*Pa,d*Pa]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Da,M=n[1]%360*Da,x=n.length>2?n[2]%360*Da:0,r()):[m*Pa,M*Pa,x*Pa]},ta.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function or(n){return rr(n,function(t,e){n.point(t*Da,e*Da)})}function ar(n,t){return[n,t]}function cr(n,t){return[n>qa?n-La:-qa>n?n+La:n,t]}function lr(n,t,e){return n?t||e?Ae(fr(n),hr(t,e)):fr(n):t||e?hr(t,e):cr}function sr(n){return function(t,e){return t+=n,[t>qa?t-La:-qa>t?t+La:t,e]}}function fr(n){var t=sr(n);return t.invert=sr(-n),t}function hr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),tt(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),tt(s*r-a*u)]},e}function gr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=pr(e,u),i=pr(e,i),(o>0?i>u:u>i)&&(u+=o*La)):(u=n+o*La,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=xe([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function pr(n,t){var e=pe(t);e[0]-=n,Me(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ca)%(2*Math.PI)}function vr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function dr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function mr(n){return n.source}function yr(n){return n.target}function Mr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Pa,Math.atan2(o,Math.sqrt(r*r+u*u))*Pa]}:function(){return[n*Pa,t*Pa]};return p.distance=h,p}function xr(){function n(n,u){var i=Math.sin(u*=Da),o=Math.cos(u),a=ga((n*=Da)-t),c=Math.cos(a);Yc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Zc.point=function(u,i){t=u*Da,e=Math.sin(i*=Da),r=Math.cos(i),Zc.point=n},Zc.lineEnd=function(){Zc.point=Zc.lineEnd=b}}function br(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function _r(n,t){function e(n,t){o>0?-Ra+Ca>t&&(t=-Ra+Ca):t>Ra-Ca&&(t=Ra-Ca);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(qa/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Ra]},e):Sr}function wr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ga(u)<Ca?ar:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function Sr(n,t){return[n,Math.log(Math.tan(qa/4+t/2))]}function kr(n){var t,e=ur(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=qa*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Er(n,t){return[Math.log(Math.tan(qa/4+t/2)),-n]}function Ar(n){return n[0]}function Nr(n){return n[1]}function Cr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function zr(n,t){return n[0]-t[0]||n[1]-t[1]}function qr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Lr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Tr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Rr(){tu(this),this.edge=this.site=this.circle=null}function Dr(n){var t=el.pop()||new Rr;return t.site=n,t}function Pr(n){Xr(n),Qc.remove(n),el.push(n),tu(n)}function Ur(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Pr(n);for(var c=i;c.circle&&ga(e-c.circle.x)<Ca&&ga(r-c.circle.cy)<Ca;)i=c.P,a.unshift(c),Pr(c),c=i;a.unshift(c),Xr(c);for(var l=o;l.circle&&ga(e-l.circle.x)<Ca&&ga(r-l.circle.cy)<Ca;)o=l.N,a.push(l),Pr(l),l=o;a.push(l),Xr(l);var s,f=a.length;for(s=1;f>s;++s)l=a[s],c=a[s-1],Kr(l.edge,c.site,l.site,u);c=a[0],l=a[f-1],l.edge=Jr(c.site,l.site,null,u),Vr(c),Vr(l)}function jr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Qc._;a;)if(r=Fr(a,o)-i,r>Ca)a=a.L;else{if(u=i-Hr(a,o),!(u>Ca)){r>-Ca?(t=a.P,e=a):u>-Ca?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Dr(n);if(Qc.insert(t,c),t||e){if(t===e)return Xr(t),e=Dr(t.site),Qc.insert(c,e),c.edge=e.edge=Jr(t.site,c.site),Vr(t),void Vr(e);if(!e)return void(c.edge=Jr(t.site,c.site));Xr(t),Xr(e);var l=t.site,s=l.x,f=l.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};Kr(e.edge,l,p,x),c.edge=Jr(l,n,null,x),e.edge=Jr(n,p,null,x),Vr(t),Vr(e)}}function Fr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var s=a-r,f=1/i-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+u-i/2)))/f+r:(r+a)/2}function Hr(n,t){var e=n.N;if(e)return Fr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Or(n){this.site=n,this.edges=[]}function Ir(n){for(var t,e,r,u,i,o,a,c,l,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Kc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)s=a[o].end(),r=s.x,u=s.y,l=a[++o%c].start(),t=l.x,e=l.y,(ga(r-t)>Ca||ga(u-e)>Ca)&&(a.splice(o,0,new Qr(Gr(i.site,s,ga(r-f)<Ca&&p-u>Ca?{x:f,y:ga(t-f)<Ca?e:p}:ga(u-p)<Ca&&h-r>Ca?{x:ga(e-p)<Ca?t:h,y:p}:ga(r-h)<Ca&&u-g>Ca?{x:h,y:ga(t-h)<Ca?e:g}:ga(u-g)<Ca&&r-f>Ca?{x:ga(e-g)<Ca?t:f,y:g}:null),i.site,null)),++c)}function Yr(n,t){return t.angle-n.angle}function Zr(){tu(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vr(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,l=r.y-a,s=i.x-o,f=i.y-a,h=2*(c*f-l*s);if(!(h>=-za)){var g=c*c+l*l,p=s*s+f*f,v=(f*g-l*p)/h,d=(c*p-s*g)/h,f=d+a,m=rl.pop()||new Zr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=tl._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}tl.insert(y,m),y||(nl=m)}}}}function Xr(n){var t=n.circle;t&&(t.P||(nl=t.N),tl.remove(t),rl.push(t),tu(t),n.circle=null)}function $r(n){for(var t,e=Gc,r=Oe(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Br(t,n)||!r(t)||ga(t.a.x-t.b.x)<Ca&&ga(t.a.y-t.b.y)<Ca)&&(t.a=t.b=null,e.splice(u,1))}function Br(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],l=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=l)return}else i={x:d,y:c};e={x:d,y:l}}else{if(i){if(i.y<c)return}else i={x:d,y:l};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else{if(i){if(i.y<c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Wr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Jr(n,t,e,r){var u=new Wr(n,t);return Gc.push(u),e&&Kr(u,n,t,e),r&&Kr(u,t,n,r),Kc[n.i].edges.push(new Qr(u,n,t)),Kc[t.i].edges.push(new Qr(u,t,n)),u}function Gr(n,t,e){var r=new Wr(n,null);return r.a=t,r.b=e,Gc.push(r),r}function Kr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Qr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function nu(){this._=null}function tu(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function eu(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ru(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function uu(n){for(;n.L;)n=n.L;return n}function iu(n,t){var e,r,u,i=n.sort(ou).pop();for(Gc=[],Kc=new Array(n.length),Qc=new nu,tl=new nu;;)if(u=nl,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(Kc[i.i]=new Or(i),jr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;Ur(u.arc)}t&&($r(t),Ir(t));var o={cells:Kc,edges:Gc};return Qc=tl=Gc=Kc=null,o}function ou(n,t){return t.y-n.y||t.x-n.x}function au(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function cu(n){return n.x}function lu(n){return n.y}function su(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function fu(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&fu(n,c[0],e,r,o,a),c[1]&&fu(n,c[1],o,r,u,a),c[2]&&fu(n,c[2],e,a,o,i),c[3]&&fu(n,c[3],o,a,u,i)}}function hu(n,t,e,r,u,i,o){var a,c=1/0;return function l(n,s,f,h,g){if(!(s>i||f>o||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(c>m){var y=Math.sqrt(c=m);r=t-y,u=e-y,i=t+y,o=e+y,a=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:l(n,s,f,x,b);break;case 1:l(n,x,f,h,b);break;case 2:l(n,s,b,x,g);break;case 3:l(n,x,b,h,g)}}}(n,r,u,i,o),a}function gu(n,t){n=ta.rgb(n),t=ta.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+xt(Math.round(e+i*n))+xt(Math.round(r+o*n))+xt(Math.round(u+a*n))}}function pu(n,t){var e,r={},u={};for(e in n)e in t?r[e]=mu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function vu(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function du(n,t){var e,r,u,i=il.lastIndex=ol.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=il.exec(n))&&(r=ol.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:vu(e,r)})),i=ol.lastIndex;return i<t.length&&(u=t.slice(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function mu(n,t){for(var e,r=ta.interpolators.length;--r>=0&&!(e=ta.interpolators[r](n,t)););return e}function yu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(mu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function Mu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function xu(n){return function(t){return 1-n(1-t)}}function bu(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function _u(n){return n*n}function wu(n){return n*n*n}function Su(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function ku(n){return function(t){return Math.pow(t,n)}}function Eu(n){return 1-Math.cos(n*Ra)}function Au(n){return Math.pow(2,10*(n-1))}function Nu(n){return 1-Math.sqrt(1-n*n)}function Cu(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/La*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*La/t)}}function zu(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function qu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Lu(n,t){n=ta.hcl(n),t=ta.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return st(e+i*n,r+o*n,u+a*n)+""}}function Tu(n,t){n=ta.hsl(n),t=ta.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function Ru(n,t){n=ta.lab(n),t=ta.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ht(e+i*n,r+o*n,u+a*n)+""}}function Du(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Pu(n){var t=[n.a,n.b],e=[n.c,n.d],r=ju(t),u=Uu(t,e),i=ju(Fu(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Pa,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Pa:0}function Uu(n,t){return n[0]*t[0]+n[1]*t[1]}function ju(n){var t=Math.sqrt(Uu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Fu(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Hu(n,t){var e,r=[],u=[],i=ta.transform(n),o=ta.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:vu(a[0],c[0])},{i:3,x:vu(a[1],c[1])})):r.push(c[0]||c[1]?"translate("+c+")":""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:vu(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:vu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:vu(g[0],p[0])},{i:e-2,x:vu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Ou(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Iu(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Yu(n){for(var t=n.source,e=n.target,r=Vu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Zu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Vu(n,t){if(n===t)return n;for(var e=Zu(n),r=Zu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function Xu(n){n.fixed|=2}function $u(n){n.fixed&=-7}function Bu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Wu(n){n.fixed&=-5}function Ju(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Ju(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*e[n.point.index];n.charge+=n.pointCharge=l,r+=l*n.point.x,u+=l*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Gu(n,t){return ta.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=ri,n}function Ku(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function Qu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function ni(n){return n.children}function ti(n){return n.value}function ei(n,t){return t.value-n.value}function ri(n){return ta.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ui(n){return n.x}function ii(n){return n.y}function oi(n,t,e){n.y0=t,n.y=e}function ai(n){return ta.range(n.length)}function ci(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function li(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function si(n){return n.reduce(fi,0)}function fi(n,t){return n+t[1]}function hi(n,t){return gi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function gi(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function pi(n){return[ta.min(n),ta.max(n)]}function vi(n,t){return n.value-t.value}function di(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function mi(n,t){n._pack_next=t,t._pack_prev=n}function yi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Mi(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(xi),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],wi(r,u,i),t(i),di(r,i),r._pack_prev=i,di(i,u),u=r._pack_next,o=3;l>o;o++){wi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(yi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!yi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?mi(r,u=a):mi(r=c,u),o--):(di(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(bi)}}function xi(n){n._pack_next=n._pack_prev=n}function bi(n){delete n._pack_next,delete n._pack_prev}function _i(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)_i(u[i],t,e,r)}function wi(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+l*i,e.y=n.y+c*i-l*u}else e.x=n.x+r,e.y=n.y}function Si(n,t){return n.parent==t.parent?1:2}function ki(n){var t=n.children;return t.length?t[0]:n.t}function Ei(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ai(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Ni(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Ci(n,t,e){return n.a.parent===t.parent?n.a:e}function zi(n){return 1+ta.max(n,function(n){return n.y})}function qi(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Li(n){var t=n.children;return t&&t.length?Li(t[0]):n}function Ti(n){var t,e=n.children;return e&&(t=e.length)?Ti(e[t-1]):n}function Ri(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Di(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Pi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ui(n){return n.rangeExtent?n.rangeExtent():Pi(n.range())}function ji(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Fi(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Hi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ml}function Oi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=ta.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ii(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Oi:ji,c=r?Iu:Ou;return o=u(n,t,c,e),a=u(t,n,c,mu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Du)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Xi(n,t)},i.tickFormat=function(t,e){return $i(n,t,e)},i.nice=function(t){return Zi(n,t),u()},i.copy=function(){return Ii(n,t,e,r)},u()}function Yi(n,t){return ta.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Zi(n,t){return Fi(n,Hi(Vi(n,t)[2]))}function Vi(n,t){null==t&&(t=10);var e=Pi(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Xi(n,t){return ta.range.apply(ta,Vi(n,t))}function $i(n,t,e){var r=Vi(n,t);if(e){var u=ic.exec(e);if(u.shift(),"s"===u[8]){var i=ta.formatPrefix(Math.max(ga(r[0]),ga(r[1])));return u[7]||(u[7]="."+Bi(i.scale(r[2]))),u[8]="f",e=ta.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Wi(u[8],r)),e=u.join("")}else e=",."+Bi(r[2])+"f";return ta.format(e)}function Bi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Wi(n,t){var e=Bi(t[2]);return n in yl?Math.abs(e-Bi(Math.max(ga(t[0]),ga(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Ji(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Fi(r.map(u),e?Math:xl);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Pi(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return Ml;arguments.length<2?t=Ml:"function"!=typeof t&&(t=ta.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Ji(n.copy(),t,e,r)},Yi(o,n)}function Gi(n,t,e){function r(t){return n(u(t))}var u=Ki(t),i=Ki(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Xi(e,n)},r.tickFormat=function(n,t){return $i(e,n,t)},r.nice=function(n){return r.domain(Zi(e,n))},r.exponent=function(o){return arguments.length?(u=Ki(t=o),i=Ki(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Gi(n.copy(),t,e)},Yi(r,n)}function Ki(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Qi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return ta.range(n.length).map(function(n){return t+e*n})}var u,i,o;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new l;for(var i,o=-1,a=r.length;++o<a;)u.has(i=r[o])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,o=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=(c+l)/2,0):(l-c)/(n.length-1+a);return i=r(c+s*a/2,s),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=l=Math.round((c+l)/2),0):(l-c)/(n.length-1+a)|0;return i=r(c+Math.round(s*a/2+(l-c-(n.length-1+a)*s)/2),s),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-a+2*c);return i=r(s+h*c,h),l&&i.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-a+2*c));return i=r(s+Math.round((f-s-(n.length-a)*h)/2),h),l&&i.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Pi(t.a[0])},e.copy=function(){return Qi(n,t)},e.domain(n)}function no(n,t){function i(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ta.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ta.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(u).sort(e),i()):n},o.range=function(n){return arguments.length?(t=n,i()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[0/0,0/0]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return no(n,t)},i()}function to(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return to(n,t,e)},u()}function eo(n,t){function e(e){return e>=e?t[ta.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return eo(n,t)},e}function ro(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Xi(n,t)},t.tickFormat=function(t,e){return $i(n,t,e)},t.copy=function(){return ro(n)},t}function uo(){return 0}function io(n){return n.innerRadius}function oo(n){return n.outerRadius}function ao(n){return n.startAngle}function co(n){return n.endAngle}function lo(n){return n&&n.padAngle}function so(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function fo(n,t,e,r,u){var i=n[0]-t[0],o=n[1]-t[1],a=(u?r:-r)/Math.sqrt(i*i+o*o),c=a*o,l=-a*i,s=n[0]+c,f=n[1]+l,h=t[0]+c,g=t[1]+l,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(M*M*y-x*x),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,E=_-p,A=w-v,N=S-p,C=k-v;return E*E+A*A>N*N+C*C&&(_=S,w=k),[[_-c,w-l],[_*e/M,w*e/M]]}function ho(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=Et(e),p=Et(r);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var e=Ar,r=Nr,u=Ne,i=go,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=El.get(n)||go).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function go(n){return n.join("L")}function po(n){return go(n)+"Z"}function vo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function yo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function Mo(n,t){return n.length<4?go(n):n[1]+_o(n.slice(1,-1),wo(n,t))}function xo(n,t){return n.length<3?go(n):n[0]+_o((n.push(n[0]),n),wo([n[n.length-2]].concat(n,[n[1]]),t))}function bo(n,t){return n.length<3?go(n):n[0]+_o(n,wo(n,t))}function _o(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return go(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var s=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function wo(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function So(n){if(n.length<3)return go(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",No(Cl,o),",",No(Cl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Co(c,o,a);return n.pop(),c.push("L",r),c.join("")}function ko(n){if(n.length<4)return go(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(No(Cl,i)+","+No(Cl,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Co(e,i,o);return e.join("")}function Eo(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[No(Cl,o),",",No(Cl,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Co(t,o,a);return t.join("")}function Ao(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,l=-1;++l<=e;)r=n[l],u=l/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return So(n)}function No(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Co(n,t,e){n.push("C",No(Al,t),",",No(Al,e),",",No(Nl,t),",",No(Nl,e),",",No(Cl,t),",",No(Cl,e))}function zo(n,t){return(t[1]-n[1])/(t[0]-n[0])}function qo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=zo(u,i);++t<e;)r[t]=(o+(o=zo(u=i,i=n[t+1])))/2;return r[t]=o,r}function Lo(n){for(var t,e,r,u,i=[],o=qo(n),a=-1,c=n.length-1;++a<c;)t=zo(n[a],n[a+1]),ga(t)<Ca?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function To(n){return n.length<3?go(n):n[0]+_o(n,Lo(n))}function Ro(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-Ra,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Do(n){function t(t){function c(){v.push("M",a(n(m),f),s,l(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=Et(e),b=Et(u),_=e===r?function(){return g}:Et(r),w=u===i?function(){return p}:Et(i);++y<M;)o.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=Ar,r=Ar,u=0,i=Nr,o=Ne,a=go,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r |
| 937 |
},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=El.get(n)||go).key,l=a.reverse||a,s=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Po(n){return n.radius}function Uo(n){return[n.x,n.y]}function jo(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Ra;return[e*Math.cos(r),e*Math.sin(r)]}}function Fo(){return 64}function Ho(){return"circle"}function Oo(n){var t=Math.sqrt(n/qa);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Io(n){return function(){var t,e;(t=this[n])&&(e=t[t.active])&&(--t.count?delete t[t.active]:delete this[n],t.active+=.5,e.event&&e.event.interrupt.call(this,this.__data__,e.index))}}function Yo(n,t,e){return ya(n,Pl),n.namespace=t,n.id=e,n}function Zo(n,t,e,r){var u=n.id,i=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[i][u].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Vo(n){return null==n&&(n=""),function(){this.textContent=n}}function Xo(n){return null==n?"__transition__":"__transition_"+n+"__"}function $o(n,t,e,r,u){var i=n[e]||(n[e]={active:0,count:0}),o=i[r];if(!o){var a=u.time;o=i[r]={tween:new l,time:a,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++i.count,ta.timer(function(u){function c(e){if(i.active>r)return s();var u=i[i.active];u&&(--i.count,delete i[i.active],u.event&&u.event.interrupt.call(n,n.__data__,u.index)),i.active=r,o.event&&o.event.start.call(n,n.__data__,t),o.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&v.push(r)}),h=o.ease,f=o.duration,ta.timer(function(){return p.c=l(e||1)?Ne:l,1},0,a)}function l(e){if(i.active!==r)return 1;for(var u=e/f,a=h(u),c=v.length;c>0;)v[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,n.__data__,t),s()):void 0}function s(){return--i.count?delete i[r]:delete n[e],1}var f,h,g=o.delay,p=ec,v=[];return p.t=g+a,u>=g?c(u-g):void(p.c=c)},0,a)}}function Bo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Wo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function Jo(n){return n.toISOString()}function Go(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ta.bisect(Vl,u);return i==Vl.length?[t.year,Vi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Vl[i-1]<Vl[i]/u?i-1:i]:[Bl,Vi(n,e)[2]]}return r.invert=function(t){return Ko(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Ko)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Ko(+e+1),t).length}var i=r.domain(),o=Pi(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Fi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ko(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Pi(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Ko(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Go(n.copy(),t,e)},Yi(r,n)}function Ko(n){return new Date(n)}function Qo(n){return JSON.parse(n.responseText)}function na(n){var t=ua.createRange();return t.selectNode(ua.body),t.createContextualFragment(n.responseText)}var ta={version:"3.5.6"},ea=[].slice,ra=function(n){return ea.call(n)},ua=this.document;if(ua)try{ra(ua.documentElement.childNodes)[0].nodeType}catch(ia){ra=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),ua)try{ua.createElement("DIV").style.setProperty("opacity",0,"")}catch(oa){var aa=this.Element.prototype,ca=aa.setAttribute,la=aa.setAttributeNS,sa=this.CSSStyleDeclaration.prototype,fa=sa.setProperty;aa.setAttribute=function(n,t){ca.call(this,n,t+"")},aa.setAttributeNS=function(n,t,e){la.call(this,n,t,e+"")},sa.setProperty=function(n,t,e){fa.call(this,n,t+"",e)}}ta.ascending=e,ta.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ta.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},ta.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},ta.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},ta.sum=function(n,t){var e,r=0,i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)u(e=+n[o])&&(r+=e);else for(;++o<i;)u(e=+t.call(n,n[o],o))&&(r+=e);return r},ta.mean=function(n,t){var e,i=0,o=n.length,a=-1,c=o;if(1===arguments.length)for(;++a<o;)u(e=r(n[a]))?i+=e:--c;else for(;++a<o;)u(e=r(t.call(n,n[a],a)))?i+=e:--c;return c?i/c:void 0},ta.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},ta.median=function(n,t){var i,o=[],a=n.length,c=-1;if(1===arguments.length)for(;++c<a;)u(i=r(n[c]))&&o.push(i);else for(;++c<a;)u(i=r(t.call(n,n[c],c)))&&o.push(i);return o.length?ta.quantile(o.sort(e),.5):void 0},ta.variance=function(n,t){var e,i,o=n.length,a=0,c=0,l=-1,s=0;if(1===arguments.length)for(;++l<o;)u(e=r(n[l]))&&(i=e-a,a+=i/++s,c+=i*(e-a));else for(;++l<o;)u(e=r(t.call(n,n[l],l)))&&(i=e-a,a+=i/++s,c+=i*(e-a));return s>1?c/(s-1):void 0},ta.deviation=function(){var n=ta.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ha=i(e);ta.bisectLeft=ha.left,ta.bisect=ta.bisectRight=ha.right,ta.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},ta.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},ta.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ta.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},ta.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=ta.min(arguments,o),e=new Array(t);++n<t;)for(var r,u=-1,i=e[n]=new Array(r);++u<r;)i[u]=arguments[u][n];return e},ta.transpose=function(n){return ta.zip.apply(ta,n)},ta.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ta.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ta.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ta.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ga=Math.abs;ta.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=a(ga(e)),o=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++o)>t;)u.push(r/i);else for(;(r=n+e*++o)<t;)u.push(r/i);return u},ta.map=function(n,t){var e=new l;if(n instanceof l)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var o in n)e.set(o,n[o]);return e};var pa="__proto__",va="\x00";c(l,{has:h,get:function(n){return this._[s(n)]},set:function(n,t){return this._[s(n)]=t},remove:g,keys:p,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:f(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t),this._[t])}}),ta.nest=function(){function n(t,o,a){if(a>=i.length)return r?r.call(u,o):e?o.sort(e):o;for(var c,s,f,h,g=-1,p=o.length,v=i[a++],d=new l;++g<p;)(h=d.get(c=v(s=o[g])))?h.push(s):d.set(c,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,a))}):(s={},f=function(e,r){s[e]=n(t,r,a)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},c(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=M(n,t,t[e]);return n};var da=["webkit","ms","moz","Moz","o","O"];ta.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(ma,"\\$&")};var ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ya={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ma=function(n,t){return t.querySelector(n)},xa=function(n,t){return t.querySelectorAll(n)},ba=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(ba=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Ma=function(n,t){return Sizzle(n,t)[0]||null},xa=Sizzle,ba=Sizzle.matchesSelector),ta.selection=function(){return ta.select(ua.documentElement)};var _a=ta.selection.prototype=[];_a.select=function(n){var t,e,r,u,i=[];n=N(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,l=r.length;++c<l;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return A(i)},_a.selectAll=function(n){var t,e,r=[];n=C(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=ra(n.call(e,e.__data__,a,u))),t.parentNode=e);return A(r)};var wa={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/"};ta.ns={prefix:wa,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.slice(0,t),n=n.slice(t+1)),wa.hasOwnProperty(e)?{space:wa[e],local:n}:n}},_a.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},_a.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!L(n[u]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},_a.style=function(n,e,r){var u=arguments.length;if(3>u){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},_a.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},_a.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},_a.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},_a.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},_a.insert=function(n,t){return n=j(n),t=N(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},_a.remove=function(){return this.each(F)},_a.data=function(n,t){function e(n,e){var r,u,i,o=n.length,f=e.length,h=Math.min(o,f),g=new Array(f),p=new Array(f),v=new Array(o);if(t){var d,m=new l,y=new Array(o);for(r=-1;++r<o;)m.has(d=t.call(u=n[r],u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d;for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=H(i),m.set(d,!0);for(r=-1;++r<o;)m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=H(i);for(;f>r;++r)p[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,a.push(p),c.push(g),s.push(v)}var r,u,i=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++i<o;)(u=r[i])&&(n[i]=u.__data__);return n}var a=Z([]),c=A([]),s=A([]);if("function"==typeof n)for(;++i<o;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<o;)e(r=this[i],n);return c.enter=function(){return a},c.exit=function(){return s},c},_a.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},_a.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return A(u)},_a.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},_a.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},_a.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},_a.call=function(n){var t=ra(arguments);return n.apply(t[0]=this,t),this},_a.empty=function(){return!this.node()},_a.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},_a.size=function(){var n=0;return Y(this,function(){++n}),n};var Sa=[];ta.selection.enter=Z,ta.selection.enter.prototype=Sa,Sa.append=_a.append,Sa.empty=_a.empty,Sa.node=_a.node,Sa.call=_a.call,Sa.size=_a.size,Sa.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(r[l]=e=n.call(u.parentNode,i.__data__,l,a)),e.__data__=i.__data__):t.push(null)}return A(o)},Sa.insert=function(n,t){return arguments.length<2&&(t=V(this)),_a.insert.call(this,n,t)},ta.select=function(t){var e;return"string"==typeof t?(e=[Ma(t,ua)],e.parentNode=ua.documentElement):(e=[t],e.parentNode=n(t)),A([e])},ta.selectAll=function(n){var t;return"string"==typeof n?(t=ra(xa(n,ua)),t.parentNode=ua.documentElement):(t=n,t.parentNode=null),A([t])},_a.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var ka=ta.map({mouseenter:"mouseover",mouseleave:"mouseout"});ua&&ka.forEach(function(n){"on"+n in ua&&ka.remove(n)});var Ea,Aa=0;ta.mouse=function(n){return J(n,k())};var Na=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ta.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},ta.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function e(n,t,e,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&ta.event.target===f),g({type:"dragend"}))}var l,s=this,f=ta.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=ta.select(e(f)).on(i+d,a).on(o+d,c),y=W(f),M=t(h,v);u?(l=u.apply(s,arguments),l=[l.x-M[0],l.y-M[1]]):l=[0,0],g({type:"dragstart"})}}var r=E(n,"drag","dragstart","dragend"),u=null,i=e(b,ta.mouse,t,"mousemove","mouseup"),o=e(G,ta.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},ta.rebind(n,r,"on")},ta.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ra(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Ca=1e-6,za=Ca*Ca,qa=Math.PI,La=2*qa,Ta=La-Ca,Ra=qa/2,Da=qa/180,Pa=180/qa,Ua=Math.SQRT2,ja=2,Fa=4;ta.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=rt(v),o=i/(ja*h)*(e*ut(Ua*t+v)-et(v));return[r+o*l,u+o*s,i*e/rt(Ua*t+v)]}return[r+n*l,u+n*s,i*Math.exp(Ua*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+Fa*f)/(2*i*ja*h),p=(c*c-i*i-Fa*f)/(2*c*ja*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Ua;return e.duration=1e3*y,e},ta.behavior.zoom=function(){function n(n){n.on(q,f).on(Oa+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(N[0],Math.min(N[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,o)),i(d=e,r),t=ta.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function c(n){z++||n({type:"zoomstart"})}function l(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){f=1,i(ta.mouse(u),g),l(a)}function r(){h.on(L,null).on(T,null),p(f&&ta.event.target===o),s(a)}var u=this,o=ta.event.target,a=D.of(u,arguments),f=0,h=ta.select(t(u)).on(L,n).on(T,r),g=e(ta.mouse(u)),p=W(u);Dl.call(u),c(a)}function h(){function n(){var n=ta.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ta.event.target;ta.select(t).on(x,r).on(b,a),_.push(t);for(var e=ta.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var c=n(),l=Date.now();if(1===c.length){if(500>l-M){var s=c[0];o(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=l}else if(c.length>1){var s=c[0],f=c[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,o=ta.touches(p);Dl.call(p);for(var a=0,c=o.length;c>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),l(v)}function a(){if(ta.event.touches.length){for(var t=ta.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}ta.selectAll(_).on(y,null),w.on(q,f).on(R,h),E(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+ta.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=ta.select(p),E=W(p);t(),c(v),w.on(q,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Dl.call(this),v=e(d=m||ta.mouse(this)),c(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Ha())*k.k),i(d,v),l(n)}function p(){var n=ta.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ta.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},A=[960,500],N=Ia,C=250,z=0,q="mousedown.zoom",L="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=E(n,"zoomstart","zoom","zoomend");return Oa||(Oa="onwheel"in ua?(Ha=function(){return-ta.event.deltaY*(ta.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ua?(Ha=function(){return ta.event.wheelDelta},"mousewheel"):(Ha=function(){return-ta.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Tl?ta.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},c(n)}).tween("zoom:zoom",function(){var e=A[0],r=A[1],u=d?d[0]:e/2,i=d?d[1]:r/2,o=ta.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:u-r[0]*a,y:i-r[1]*a,k:a},l(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,c(n),l(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(N=null==t?Ia:[+t[0],+t[1]],n):N},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(A=t&&[+t[0],+t[1]],n):A},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ta.rebind(n,D,"on")};var Ha,Oa,Ia=[0,1/0];ta.color=ot,ot.prototype.toString=function(){return this.rgb()+""},ta.hsl=at;var Ya=at.prototype=new ot;Ya.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,this.l/n)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,n*this.l)},Ya.rgb=function(){return ct(this.h,this.s,this.l)},ta.hcl=lt;var Za=lt.prototype=new ot;Za.brighter=function(n){return new lt(this.h,this.c,Math.min(100,this.l+Va*(arguments.length?n:1)))},Za.darker=function(n){return new lt(this.h,this.c,Math.max(0,this.l-Va*(arguments.length?n:1)))},Za.rgb=function(){return st(this.h,this.c,this.l).rgb()},ta.lab=ft;var Va=18,Xa=.95047,$a=1,Ba=1.08883,Wa=ft.prototype=new ot;Wa.brighter=function(n){return new ft(Math.min(100,this.l+Va*(arguments.length?n:1)),this.a,this.b)},Wa.darker=function(n){return new ft(Math.max(0,this.l-Va*(arguments.length?n:1)),this.a,this.b)},Wa.rgb=function(){return ht(this.l,this.a,this.b)},ta.rgb=mt;var Ja=mt.prototype=new ot;Ja.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new mt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mt(u,u,u)},Ja.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mt(n*this.r,n*this.g,n*this.b)},Ja.hsl=function(){return _t(this.r,this.g,this.b)},Ja.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ga=ta.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});Ga.forEach(function(n,t){Ga.set(n,yt(t))}),ta.functor=Et,ta.xhr=At(y),ta.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=Nt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=l)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<l;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;l>s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==c)continue;return n.slice(t,s-a)}return n.slice(t)}for(var r,u,i={},o={},a=[],l=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,f++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},ta.csv=ta.dsv(",","text/csv"),ta.tsv=ta.dsv(" ","text/tab-separated-values");var Ka,Qa,nc,tc,ec,rc=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ta.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Qa?Qa.n=i:Ka=i,Qa=i,nc||(tc=clearTimeout(tc),nc=1,rc(qt))},ta.timer.flush=function(){Lt(),Tt()},ta.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var uc=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Dt);ta.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=ta.round(n,Rt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),uc[8+e/3]};var ic=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oc=ta.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ta.round(n,Rt(n,t))).toFixed(Math.max(0,Math.min(20,Rt(n*(1+1e-15),t))))}}),ac=ta.time={},cc=Date;jt.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(){lc.setUTCDate.apply(this._,arguments)},setDay:function(){lc.setUTCDay.apply(this._,arguments)},setFullYear:function(){lc.setUTCFullYear.apply(this._,arguments)},setHours:function(){lc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lc.setUTCSeconds.apply(this._,arguments)},setTime:function(){lc.setTime.apply(this._,arguments)}};var lc=Date.prototype;ac.year=Ft(function(n){return n=ac.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ac.years=ac.year.range,ac.years.utc=ac.year.utc.range,ac.day=Ft(function(n){var t=new cc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ac.days=ac.day.range,ac.days.utc=ac.day.utc.range,ac.dayOfYear=function(n){var t=ac.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ac[n]=Ft(function(n){return(n=ac.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ac[n+"s"]=e.range,ac[n+"s"].utc=e.utc.range,ac[n+"OfYear"]=function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)}}),ac.week=ac.sunday,ac.weeks=ac.sunday.range,ac.weeks.utc=ac.sunday.utc.range,ac.weekOfYear=ac.sundayOfYear;var sc={"-":"",_:" ",0:"0"},fc=/^\s*\d+/,hc=/^%/;ta.locale=function(n){return{numberFormat:Pt(n),timeFormat:Ot(n)}};var gc=ta.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"]});ta.format=gc.numberFormat,ta.geo={},ce.prototype={s:0,t:0,add:function(n){le(n,this.t,pc),le(pc.s,this.s,this),this.s?this.t+=pc.t:this.s=pc.t |
| 938 |
},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var pc=new ce;ta.geo.stream=function(n,t){n&&vc.hasOwnProperty(n.type)?vc[n.type](n,t):se(n,t)};var vc={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)se(e[r].geometry,t)}},dc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){fe(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)fe(e[r],t,0)},Polygon:function(n,t){he(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)he(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)se(e[r],t)}};ta.geo.area=function(n){return mc=0,ta.geo.stream(n,Mc),mc};var mc,yc=new ce,Mc={sphere:function(){mc+=4*qa},point:b,lineStart:b,lineEnd:b,polygonStart:function(){yc.reset(),Mc.lineStart=ge},polygonEnd:function(){var n=2*yc;mc+=0>n?4*qa+n:n,Mc.lineStart=Mc.lineEnd=Mc.point=b}};ta.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=pe([t*Da,e*Da]);if(m){var u=de(m,r),i=[u[1],-u[0],0],o=de(i,u);Me(o),o=xe(o);var c=t-p,l=c>0?1:-1,v=o[0]*Pa*l,d=ga(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Pa;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Pa;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ga(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Mc.point(n,e),t(n,e)}function i(){Mc.lineStart()}function o(){u(v,d),Mc.lineEnd(),ga(y)>Ca&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,Mc.polygonStart()},polygonEnd:function(){Mc.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>yc?(s=-(h=180),f=-(g=90)):y>Ca?g=90:-Ca>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ta.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ta.geo.centroid=function(n){xc=bc=_c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,qc);var t=Nc,e=Cc,r=zc,u=t*t+e*e+r*r;return za>u&&(t=kc,e=Ec,r=Ac,Ca>bc&&(t=_c,e=wc,r=Sc),u=t*t+e*e+r*r,za>u)?[0/0,0/0]:[Math.atan2(e,t)*Pa,tt(r/Math.sqrt(u))*Pa]};var xc,bc,_c,wc,Sc,kc,Ec,Ac,Nc,Cc,zc,qc={sphere:b,point:_e,lineStart:Se,lineEnd:ke,polygonStart:function(){qc.lineStart=Ee},polygonEnd:function(){qc.lineStart=Se}},Lc=Le(Ne,Pe,je,[-qa,-qa/2]),Tc=1e9;ta.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ie(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ta.geo.conicEqualArea=function(){return Ye(Ze)}).raw=Ze,ta.geo.albers=function(){return ta.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ta.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ta.geo.albers(),o=ta.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ta.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Ca,f+.12*l+Ca],[s-.214*l-Ca,f+.234*l-Ca]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Ca,f+.166*l+Ca],[s-.115*l-Ca,f+.234*l-Ca]]).stream(c).point,n},n.scale(1070)};var Rc,Dc,Pc,Uc,jc,Fc,Hc={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Dc=0,Hc.lineStart=Ve},polygonEnd:function(){Hc.lineStart=Hc.lineEnd=Hc.point=b,Rc+=ga(Dc/2)}},Oc={point:Xe,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ic={point:We,lineStart:Je,lineEnd:Ge,polygonStart:function(){Ic.lineStart=Ke},polygonEnd:function(){Ic.point=We,Ic.lineStart=Je,Ic.lineEnd=Ge}};ta.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ta.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Rc=0,ta.geo.stream(n,u(Hc)),Rc},n.centroid=function(n){return _c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,u(Ic)),zc?[Nc/zc,Cc/zc]:Ac?[kc/Ac,Ec/Ac]:Sc?[_c/Sc,wc/Sc]:[0/0,0/0]},n.bounds=function(n){return jc=Fc=-(Pc=Uc=1/0),ta.geo.stream(n,u(Oc)),[[Pc,Uc],[jc,Fc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||tr(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new $e:new Qe(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ta.geo.albersUsa()).context(null)},ta.geo.transform=function(n){return{stream:function(t){var e=new er(t);for(var r in n)e[r]=n[r];return e}}},er.prototype={point:function(n,t){this.stream.point(n,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()}},ta.geo.projection=ur,ta.geo.projectionMutator=ir,(ta.geo.equirectangular=function(){return ur(ar)}).raw=ar.invert=ar,ta.geo.rotation=function(n){function t(t){return t=n(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t}return n=lr(n[0]%360*Da,n[1]*Da,n.length>2?n[2]*Da:0),t.invert=function(t){return t=n.invert(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t},t},cr.invert=ar,ta.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=lr(-n[0]*Da,-n[1]*Da,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Pa,n[1]*=Pa}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=gr((t=+r)*Da,u*Da),n):t},n.precision=function(r){return arguments.length?(e=gr(t*Da,(u=+r)*Da),n):u},n.angle(90)},ta.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Da,u=n[1]*Da,i=t[1]*Da,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},ta.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ta.range(Math.ceil(i/d)*d,u,d).map(h).concat(ta.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ta.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ga(n%d)>Ca}).map(s)).concat(ta.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ga(n%m)>Ca}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=vr(a,o,90),f=dr(r,e,y),h=vr(l,c,90),g=dr(i,u,y),n):y},n.majorExtent([[-180,-90+Ca],[180,90-Ca]]).minorExtent([[-180,-80-Ca],[180,80+Ca]])},ta.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=mr,u=yr;return n.distance=function(){return ta.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ta.geo.interpolate=function(n,t){return Mr(n[0]*Da,n[1]*Da,t[0]*Da,t[1]*Da)},ta.geo.length=function(n){return Yc=0,ta.geo.stream(n,Zc),Yc};var Yc,Zc={sphere:b,point:b,lineStart:xr,lineEnd:b,polygonStart:b,polygonEnd:b},Vc=br(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ta.geo.azimuthalEqualArea=function(){return ur(Vc)}).raw=Vc;var Xc=br(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(ta.geo.azimuthalEquidistant=function(){return ur(Xc)}).raw=Xc,(ta.geo.conicConformal=function(){return Ye(_r)}).raw=_r,(ta.geo.conicEquidistant=function(){return Ye(wr)}).raw=wr;var $c=br(function(n){return 1/n},Math.atan);(ta.geo.gnomonic=function(){return ur($c)}).raw=$c,Sr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ra]},(ta.geo.mercator=function(){return kr(Sr)}).raw=Sr;var Bc=br(function(){return 1},Math.asin);(ta.geo.orthographic=function(){return ur(Bc)}).raw=Bc;var Wc=br(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ta.geo.stereographic=function(){return ur(Wc)}).raw=Wc,Er.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ra]},(ta.geo.transverseMercator=function(){var n=kr(Er),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Er,ta.geom={},ta.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=Et(e),i=Et(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(zr),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=Cr(a),s=Cr(c),f=s[0]===l[0],h=s[s.length-1]===l[l.length-1],g=[];for(t=l.length-1;t>=0;--t)g.push(n[a[l[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[a[s[t]][2]]);return g}var e=Ar,r=Nr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ta.geom.polygon=function(n){return ya(n,Jc),n};var Jc=ta.geom.polygon.prototype=[];Jc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},Jc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},Jc.clip=function(n){for(var t,e,r,u,i,o,a=Tr(n),c=-1,l=this.length-Tr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],qr(o,s,u)?(qr(i,s,u)||n.push(Lr(i,o,s,u)),n.push(o)):qr(i,s,u)&&n.push(Lr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n};var Gc,Kc,Qc,nl,tl,el=[],rl=[];Or.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Yr),t.length},Qr.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}},nu.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=uu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(eu(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ru(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(ru(this,e),n=e,e=n.U),e.C=!1,r.C=!0,eu(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?uu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,eu(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ru(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,eu(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,ru(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,eu(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,ru(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},ta.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return iu(e(n),a).cells.forEach(function(e,a){var c=e.edges,l=e.site,s=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):l.x>=r&&l.x<=i&&l.y>=u&&l.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];s.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ca)*Ca,y:Math.round(o(n,t)/Ca)*Ca,i:t}})}var r=Ar,u=Nr,i=r,o=u,a=ul;return n?t(n):(t.links=function(n){return iu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return iu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Yr),c=-1,l=a.length,s=a[l-1].edge,f=s.l===o?s.r:s.l;++c<l;)u=s,i=f,s=a[c].edge,f=s.l===o?s.r:s.l,r<i.i&&r<f.i&&au(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=Et(r=n),t):r},t.y=function(n){return arguments.length?(o=Et(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?ul:n,t):a===ul?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===ul?null:a&&a[1]},t)};var ul=[[-1e6,-1e6],[1e6,1e6]];ta.geom.delaunay=function(n){return ta.geom.voronoi().triangles(n)},ta.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(ga(c-e)+ga(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=su()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,v,d,m,y,M=Et(a),x=Et(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=su();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){fu(n,k,v,d,m,y)},k.find=function(n){return hu(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var o,a=Ar,c=Nr;return(o=arguments.length)?(a=cu,c=lu,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},ta.interpolateRgb=gu,ta.interpolateObject=pu,ta.interpolateNumber=vu,ta.interpolateString=du;var il=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ol=new RegExp(il.source,"g");ta.interpolate=mu,ta.interpolators=[function(n,t){var e=typeof t;return("string"===e?Ga.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?gu:du:t instanceof ot?gu:Array.isArray(t)?yu:"object"===e&&isNaN(t)?pu:vu)(n,t)}],ta.interpolateArray=yu;var al=function(){return y},cl=ta.map({linear:al,poly:ku,quad:function(){return _u},cubic:function(){return wu},sin:function(){return Eu},exp:function(){return Au},circle:function(){return Nu},elastic:Cu,back:zu,bounce:function(){return qu}}),ll=ta.map({"in":y,out:xu,"in-out":bu,"out-in":function(n){return bu(xu(n))}});ta.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=cl.get(e)||al,r=ll.get(r)||y,Mu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Lu,ta.interpolateHsl=Tu,ta.interpolateLab=Ru,ta.interpolateRound=Du,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Pu(e?e.matrix:sl)})(n)},Pu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Hu,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Yu(n[e]));return t}},ta.layout.chord=function(){function n(){var n,l,f,h,g,p={},v=[],d=ta.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];v.push(l),m.push(ta.range(i)),n+=l}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(La-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},ta.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var l=t.charge/c;n.px-=i*l,n.py-=o*l}return!0}if(t.point&&c&&p>c){var l=t.pointCharge/c;n.px-=i*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=ta.event.x,n.py=ta.event.y,a.resume()}var e,r,u,i,o,a={},c=ta.dispatch("start","tick","end"),l=[1,1],s=.9,f=fl,h=hl,g=-30,p=gl,v=.1,d=.64,m=[],M=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,y,x,b=m.length,_=M.length;for(e=0;_>e;++e)a=M[e],f=a.source,h=a.target,y=h.x-f.x,x=h.y-f.y,(p=y*y+x*x)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,y*=p,x*=p,h.x-=y*(d=f.weight/(h.weight+f.weight)),h.y-=x*d,f.x+=y*(d=1-d),f.y+=x*d);if((d=r*v)&&(y=l[0]/2,x=l[1]/2,e=-1,d))for(;++e<b;)a=m[e],a.x+=(y-a.x)*d,a.y+=(x-a.y)*d;if(g)for(Ju(t=ta.geom.quadtree(m),r,o),e=-1;++e<b;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(M=n,a):M},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),ta.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=M[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,l=o.length;++a<l;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,s=M.length,p=l[0],v=l[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;s>t;++t)r=M[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;s>t;++t)u[t]=+f.call(this,M[t],t);else for(t=0;s>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;s>t;++t)i[t]=+h.call(this,M[t],t);else for(t=0;s>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=ta.behavior.drag().origin(y).on("dragstart.force",Xu).on("drag.force",t).on("dragend.force",$u)),arguments.length?void this.on("mouseover.force",Bu).on("mouseout.force",Wu).call(e):e},ta.rebind(a,c,"on")};var fl=20,hl=1,gl=1/0;ta.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(l=e.call(n,i,i.depth))&&(c=l.length)){for(var c,l,s;--c>=0;)o.push(s=l[c]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Qu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=ei,e=ni,r=ti;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ku(t,function(n){n.children&&(n.value=0)}),Qu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ta.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=ta.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Gu(e,r)},ta.layout.pie=function(){function n(o){var a,c=o.length,l=o.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/c,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=(f-c*g)/ta.sum(l),v=ta.range(c),d=[];return null!=e&&v.sort(e===pl?function(n,t){return l[t]-l[n]}:function(n,t){return e(o[n],o[t])}),v.forEach(function(n){d[n]={data:o[n],value:a=l[n],startAngle:s,endAngle:s+=a*p+g,padAngle:h}}),d}var t=Number,e=pl,r=0,u=La,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var pl={};ta.layout.stack=function(){function n(a,c){if(!(h=a.length))return a;var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=ta.permute(l,f),s=ta.permute(s,f);var h,g,p,v,d=r.call(n,s,c),m=l[0].length;for(p=0;m>p;++p)for(u.call(n,l[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,l[g][p],v+=s[g-1][p][1],s[g][p][1]);return a}var t=y,e=ai,r=ci,u=oi,i=ui,o=ii;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:vl.get(t)||ai,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:dl.get(t)||ci,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var vl=ta.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(li),i=n.map(si),o=ta.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return ta.range(n.length).reverse()},"default":ai}),dl=ta.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ci});ta.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[ta.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=pi,u=hi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=Et(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return gi(n,t)}:Et(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ta.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Qu(a,function(n){n.r=+s(n.value)}),Qu(a,Mi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Qu(a,function(n){n.r+=f}),Qu(a,Mi),Qu(a,function(n){n.r-=f})}return _i(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=ta.layout.hierarchy().sort(vi),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Gu(n,e)},ta.layout.tree=function(){function n(n,u){var s=o.call(this,n,u),f=s[0],h=t(f);if(Qu(h,e),h.parent.m=-h.z,Ku(h,r),l)Ku(f,i);else{var g=f,p=f,v=f;Ku(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);Ku(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Ni(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],l=u.m,s=i.m,f=o.m,h=c.m;o=Ei(o),u=ki(u),o&&u;)c=ki(c),i=Ei(i),i.a=n,r=o.z+f-u.z-l+a(o._,u._),r>0&&(Ai(Ci(o,n,e),n,r),l+=r,s+=r),f+=o.m,l+=u.m,h+=c.m,s+=i.m;o&&!Ei(i)&&(i.t=o,i.m+=f-s),u&&!ki(c)&&(c.t=u,c.m+=l-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=ta.layout.hierarchy().sort(null).value(null),a=Si,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?i:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:i,n):l?c:null},Gu(n,o)},ta.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Qu(c,function(n){var t=n.children;t&&t.length?(n.x=qi(t),n.y=zi(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Li(c),f=Ti(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Qu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=ta.layout.hierarchy().sort(null).value(null),e=Si,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Gu(n,t)},ta.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,v))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,v,l,!1),v=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=ta.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Ri,h=!1,g="squarify",p=.5*(1+Math.sqrt(5)); |
| 939 |
return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ri(t):Di(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Di(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Ri:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Gu(i,a)},ta.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ta.random.normal.apply(ta,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ta.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ta.scale={};var ml={floor:y,ceil:y};ta.scale.linear=function(){return Ii([0,1],[0,1],mu,!1)};var yl={s:1,g:1,p:1,r:1,e:1};ta.scale.log=function(){return Ji(ta.scale.linear().domain([0,1]),10,!0,[1,10])};var Ml=ta.format(".0e"),xl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ta.scale.pow=function(){return Gi(ta.scale.linear(),1,[0,1])},ta.scale.sqrt=function(){return ta.scale.pow().exponent(.5)},ta.scale.ordinal=function(){return Qi([],{t:"range",a:[[]]})},ta.scale.category10=function(){return ta.scale.ordinal().range(bl)},ta.scale.category20=function(){return ta.scale.ordinal().range(_l)},ta.scale.category20b=function(){return ta.scale.ordinal().range(wl)},ta.scale.category20c=function(){return ta.scale.ordinal().range(Sl)};var bl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),_l=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),wl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ta.scale.quantile=function(){return no([],[])},ta.scale.quantize=function(){return to(0,1,[0,1])},ta.scale.threshold=function(){return eo([.5],[0,1])},ta.scale.identity=function(){return ro([0,1])},ta.svg={},ta.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-Ra,f=a.apply(this,arguments)-Ra,h=Math.abs(f-s),g=s>f?0:1;if(n>l&&(p=l,l=n,n=p),h>=Ta)return t(l,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+c.apply(this,arguments)||0)/2)&&(d=i===kl?Math.sqrt(n*n+l*l):+i.apply(this,arguments),g||(A*=-1),l&&(A=tt(d/l*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),l){y=l*Math.cos(s+A),M=l*Math.sin(s+A),x=l*Math.cos(f-A),b=l*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=qa?0:1;if(A&&so(y,M,x,b)===g^C){var z=(s+f)/2;y=l*Math.cos(z),M=l*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var q=Math.abs(s-f+2*E)<=qa?0:1;if(E&&so(_,w,S,k)===1-g^q){var L=(s+f)/2;_=n*Math.cos(L),w=n*Math.sin(L),S=k=null}}else _=w=0;if((p=Math.min(Math.abs(l-n)/2,+u.apply(this,arguments)))>.001){v=l>n^g?0:1;var T=null==S?[_,w]:null==x?[y,M]:Lr([y,M],[S,k],[x,b],[_,w]),R=y-T[0],D=M-T[1],P=x-T[0],U=b-T[1],j=1/Math.sin(Math.acos((R*P+D*U)/(Math.sqrt(R*R+D*D)*Math.sqrt(P*P+U*U)))/2),F=Math.sqrt(T[0]*T[0]+T[1]*T[1]);if(null!=x){var H=Math.min(p,(l-F)/(j+1)),O=fo(null==S?[_,w]:[S,k],[y,M],l,H,g),I=fo([x,b],[_,w],l,H,g);p===H?N.push("M",O[0],"A",H,",",H," 0 0,",v," ",O[1],"A",l,",",l," 0 ",1-g^so(O[1][0],O[1][1],I[1][0],I[1][1]),",",g," ",I[1],"A",H,",",H," 0 0,",v," ",I[0]):N.push("M",O[0],"A",H,",",H," 0 1,",v," ",I[0])}else N.push("M",y,",",M);if(null!=S){var Y=Math.min(p,(n-F)/(j-1)),Z=fo([y,M],[S,k],n,-Y,g),V=fo([_,w],null==x?[y,M]:[x,b],n,-Y,g);p===Y?N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^so(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",Y,",",Y," 0 0,",v," ",Z[0]):N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",Z[0])}else N.push("L",_,",",w)}else N.push("M",y,",",M),null!=x&&N.push("A",l,",",l," 0 ",C,",",g," ",x,",",b),N.push("L",_,",",w),null!=S&&N.push("A",n,",",n," 0 ",q,",",1-g," ",S,",",k);return N.push("Z"),N.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=io,r=oo,u=uo,i=kl,o=ao,a=co,c=lo;return n.innerRadius=function(t){return arguments.length?(e=Et(t),n):e},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=Et(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==kl?kl:Et(t),n):i},n.startAngle=function(t){return arguments.length?(o=Et(t),n):o},n.endAngle=function(t){return arguments.length?(a=Et(t),n):a},n.padAngle=function(t){return arguments.length?(c=Et(t),n):c},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Ra;return[Math.cos(t)*n,Math.sin(t)*n]},n};var kl="auto";ta.svg.line=function(){return ho(y)};var El=ta.map({linear:go,"linear-closed":po,step:vo,"step-before":mo,"step-after":yo,basis:So,"basis-open":ko,"basis-closed":Eo,bundle:Ao,cardinal:bo,"cardinal-open":Mo,"cardinal-closed":xo,monotone:To});El.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Al=[0,2/3,1/3,0],Nl=[0,1/3,2/3,0],Cl=[0,1/6,2/3,1/6];ta.svg.line.radial=function(){var n=ho(Ro);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},mo.reverse=yo,yo.reverse=mo,ta.svg.area=function(){return Do(y)},ta.svg.area.radial=function(){var n=Do(Ro);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ta.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)-Ra,s=l.call(n,u,r)-Ra;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>qa)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=mr,o=yr,a=Po,c=ao,l=co;return n.radius=function(t){return arguments.length?(a=Et(t),n):a},n.source=function(t){return arguments.length?(i=Et(t),n):i},n.target=function(t){return arguments.length?(o=Et(t),n):o},n.startAngle=function(t){return arguments.length?(c=Et(t),n):c},n.endAngle=function(t){return arguments.length?(l=Et(t),n):l},n},ta.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=mr,e=yr,r=Uo;return n.source=function(e){return arguments.length?(t=Et(e),n):t},n.target=function(t){return arguments.length?(e=Et(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ta.svg.diagonal.radial=function(){var n=ta.svg.diagonal(),t=Uo,e=n.projection;return n.projection=function(n){return arguments.length?e(jo(t=n)):t},n},ta.svg.symbol=function(){function n(n,r){return(zl.get(t.call(this,n,r))||Oo)(e.call(this,n,r))}var t=Ho,e=Fo;return n.type=function(e){return arguments.length?(t=Et(e),n):t},n.size=function(t){return arguments.length?(e=Et(t),n):e},n};var zl=ta.map({circle:Oo,cross:function(n){var t=Math.sqrt(n/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(n){var t=Math.sqrt(n/(2*Ll)),e=t*Ll;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ta.svg.symbolTypes=zl.keys();var ql=Math.sqrt(3),Ll=Math.tan(30*Da);_a.transition=function(n){for(var t,e,r=Tl||++Ul,u=Xo(n),i=[],o=Rl||{time:Date.now(),ease:Su,delay:0,duration:250},a=-1,c=this.length;++a<c;){i.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(e=l[s])&&$o(e,s,u,r,o),t.push(e)}return Yo(i,u,r)},_a.interrupt=function(n){return this.each(null==n?Dl:Io(Xo(n)))};var Tl,Rl,Dl=Io(Xo()),Pl=[],Ul=0;Pl.call=_a.call,Pl.empty=_a.empty,Pl.node=_a.node,Pl.size=_a.size,ta.transition=function(n,t){return n&&n.transition?Tl?n.transition(t):n:ta.selection().transition(n)},ta.transition.prototype=Pl,Pl.select=function(n){var t,e,r,u=this.id,i=this.namespace,o=[];n=N(n);for(var a=-1,c=this.length;++a<c;){o.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(r=l[s])&&(e=n.call(r,r.__data__,s,a))?("__data__"in r&&(e.__data__=r.__data__),$o(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Yo(o,i,u)},Pl.selectAll=function(n){var t,e,r,u,i,o=this.id,a=this.namespace,c=[];n=C(n);for(var l=-1,s=this.length;++l<s;)for(var f=this[l],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[a][o],e=n.call(r,r.__data__,h,l),c.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&$o(u,p,a,o,i),t.push(u)}return Yo(c,a,o)},Pl.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return Yo(u,this.namespace,this.id)},Pl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Pl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Hu:mu,a=ta.ns.qualify(n);return Zo(this,"attr."+n,t,a.local?i:u)},Pl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=ta.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Pl.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=mu(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Zo(this,"style."+n,e,i)},Pl.styleTween=function(n,e,r){function u(u,i){var o=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Pl.text=function(n){return Zo(this,"text",n,Vo)},Pl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Pl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ta.ease.apply(ta,arguments)),Y(this,function(r){r[e][t].ease=n}))},Pl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Pl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Pl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Rl,i=Tl;try{Tl=e,Y(this,function(t,u,i){Rl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Rl=u,Tl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=ta.dispatch("start","end","interrupt"))).on(n,t)});return this},Pl.transition=function(){for(var n,t,e,r,u=this.id,i=++Ul,o=this.namespace,a=[],c=0,l=this.length;l>c;c++){a.push(n=[]);for(var t=this[c],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[o][u],$o(e,s,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Yo(a,o,i)},ta.svg.axis=function(){function n(n){n.each(function(){var n,l=ta.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):y:t,p=l.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ca),d=ta.transition(p.exit()).style("opacity",Ca).remove(),m=ta.transition(p.order()).style("opacity",1),M=Math.max(u,0)+o,x=Ui(f),b=l.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ta.transition(b));v.append("line"),v.append("text");var w,S,k,E,A=v.select("line"),N=m.select("line"),C=p.select("text").text(g),z=v.select("text"),q=m.select("text"),L="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=Bo,w="x",k="y",S="x2",E="y2",C.attr("dy",0>L?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+L*i+"V0H"+x[1]+"V"+L*i)):(n=Wo,w="y",k="x",S="y2",E="x2",C.attr("dy",".32em").style("text-anchor",0>L?"end":"start"),_.attr("d","M"+L*i+","+x[0]+"H0V"+x[1]+"H"+L*i)),A.attr(E,L*u),z.attr(k,L*M),N.attr(S,0).attr(E,L*u),q.attr(w,0).attr(k,L*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=ta.scale.linear(),r=jl,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Fl?t+"":jl,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var jl="bottom",Fl={top:1,right:1,bottom:1,left:1};ta.svg.brush=function(){function n(t){t.each(function(){var t=ta.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,y);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Hl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var c,f=ta.transition(t),h=ta.transition(o);l&&(c=Ui(l),h.attr("x",c[0]).attr("width",c[1]-c[0]),r(f)),s&&(c=Ui(s),h.attr("y",c[0]).attr("height",c[1]-c[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==ta.event.keyCode&&(C||(M=null,q[0]-=f[1],q[1]-=h[1],C=2),S())}function v(){32==ta.event.keyCode&&2==C&&(q[0]+=f[1],q[1]+=h[1],C=0,S())}function d(){var n=ta.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ta.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),q[0]=f[+(n[0]<M[0])],q[1]=h[+(n[1]<M[1])]):M=null),A&&m(n,l,0)&&(r(k),t=!0),N&&m(n,s,1)&&(u(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function m(n,t,e){var r,u,i=Ui(t),c=i[0],l=i[1],s=q[e],v=e?h:f,d=v[1]-v[0];return C&&(c-=s,l-=d+s),r=(e?p:g)?Math.max(c,Math.min(l,n[e])):n[e],C?u=(r+=s)+d:(M&&(s=Math.max(c,Math.min(l,2*M[e]-r))),r>s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?a=null:o=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ta.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ta.select(ta.event.target),w=c.of(b,arguments),k=ta.select(b),E=_.datum(),A=!/^(n|s)$/.test(E)&&l,N=!/^(e|w)$/.test(E)&&s,C=_.classed("extent"),z=W(b),q=ta.mouse(b),L=ta.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(ta.event.changedTouches?L.on("touchmove.brush",d).on("touchend.brush",y):L.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)q[0]=f[0]-q[0],q[1]=h[0]-q[1];else if(E){var T=+/w$/.test(E),R=+/^n/.test(E);x=[f[1-T]-q[0],h[1-R]-q[1]],q[0]=f[T],q[1]=h[R]}else ta.event.altKey&&(M=q.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ta.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,c=E(n,"brushstart","brush","brushend"),l=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=Ol[0];return n.event=function(n){n.each(function(){var n=c.of(this,arguments),t={x:f,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Tl?ta.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=yu(f,t.x),r=yu(h,t.y);return o=a=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(l=t,v=Ol[!l<<1|!s],n):l},n.y=function(t){return arguments.length?(s=t,v=Ol[!l<<1|!s],n):s},n.clamp=function(t){return arguments.length?(l&&s?(g=!!t[0],p=!!t[1]):l?g=!!t:s&&(p=!!t),n):l&&s?[g,p]:l?g:s?p:null},n.extent=function(t){var e,r,u,i,c;return arguments.length?(l&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),o=[e,r],l.invert&&(e=l(e),r=l(r)),e>r&&(c=e,e=r,r=c),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],l&&(u=u[1],i=i[1]),a=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(c=u,u=i,i=c),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(l&&(o?(e=o[0],r=o[1]):(e=f[0],r=f[1],l.invert&&(e=l.invert(e),r=l.invert(r)),e>r&&(c=e,e=r,r=c))),s&&(a?(u=a[0],i=a[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(c=u,u=i,i=c))),l&&s?[[e,u],[r,i]]:l?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!l&&f[0]==f[1]||!!s&&h[0]==h[1]},ta.rebind(n,c,"on")};var Hl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ol=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Il=ac.format=gc.timeFormat,Yl=Il.utc,Zl=Yl("%Y-%m-%dT%H:%M:%S.%LZ");Il.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Jo:Zl,Jo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Jo.toString=Zl.toString,ac.second=Ft(function(n){return new cc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ac.seconds=ac.second.range,ac.seconds.utc=ac.second.utc.range,ac.minute=Ft(function(n){return new cc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ac.minutes=ac.minute.range,ac.minutes.utc=ac.minute.utc.range,ac.hour=Ft(function(n){var t=n.getTimezoneOffset()/60;return new cc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ac.hours=ac.hour.range,ac.hours.utc=ac.hour.utc.range,ac.month=Ft(function(n){return n=ac.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ac.months=ac.month.range,ac.months.utc=ac.month.utc.range;var Vl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xl=[[ac.second,1],[ac.second,5],[ac.second,15],[ac.second,30],[ac.minute,1],[ac.minute,5],[ac.minute,15],[ac.minute,30],[ac.hour,1],[ac.hour,3],[ac.hour,6],[ac.hour,12],[ac.day,1],[ac.day,2],[ac.week,1],[ac.month,1],[ac.month,3],[ac.year,1]],$l=Il.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Ne]]),Bl={range:function(n,t,e){return ta.range(Math.ceil(n/e)*e,+t,e).map(Ko)},floor:y,ceil:y};Xl.year=ac.year,ac.scale=function(){return Go(ta.scale.linear(),Xl,$l)};var Wl=Xl.map(function(n){return[n[0].utc,n[1]]}),Jl=Yl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Ne]]);Wl.year=ac.year.utc,ac.scale.utc=function(){return Go(ta.scale.linear(),Wl,Jl)},ta.text=At(function(n){return n.responseText}),ta.json=function(n,t){return Nt(n,"application/json",Qo,t)},ta.html=function(n,t){return Nt(n,"text/html",na,t)},ta.xml=At(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(ta):"object"==typeof module&&module.exports&&(module.exports=ta),this.d3=ta}();</script> |
| 940 |
<style type="text/css">.profvis { |
| 941 |
position: relative; |
| 942 |
} |
| 943 |
.profvis * { |
| 944 |
|
| 945 |
-webkit-box-sizing: content-box; |
| 946 |
-moz-box-sizing: content-box; |
| 947 |
box-sizing: content-box; |
| 948 |
} |
| 949 |
.profvis-footer .info-label { |
| 950 |
cursor: default; |
| 951 |
} |
| 952 |
.profvis-panel1 { |
| 953 |
left: 0px; |
| 954 |
top: 23px; |
| 955 |
position: absolute; |
| 956 |
} |
| 957 |
.profvis-panel1-vertical { |
| 958 |
bottom: 0px; |
| 959 |
width: 500px; |
| 960 |
margin-bottom: 20px; |
| 961 |
} |
| 962 |
.profvis-panel1-horizontal { |
| 963 |
height: 378px; |
| 964 |
right: 0px; |
| 965 |
} |
| 966 |
.profvis-panel2 { |
| 967 |
position: absolute; |
| 968 |
right: 0px; |
| 969 |
bottom: 0px; |
| 970 |
} |
| 971 |
.profvis-panel2-vertical { |
| 972 |
top: 23px; |
| 973 |
left: 508px; |
| 974 |
margin-bottom: 20px; |
| 975 |
} |
| 976 |
.profvis-panel2-horizontal { |
| 977 |
left: 0px; |
| 978 |
top: 408px; |
| 979 |
margin-bottom: 20px; |
| 980 |
} |
| 981 |
.profvis-splitbar { |
| 982 |
position: absolute; |
| 983 |
background-color: rgb(224, 224, 224); |
| 984 |
border-color: #ddd; |
| 985 |
border-style: solid; |
| 986 |
background-repeat: no-repeat; |
| 987 |
background-position: center; |
| 988 |
} |
| 989 |
.profvis-splitbar-vertical { |
| 990 |
cursor: col-resize; |
| 991 |
left: 500px; |
| 992 |
width: 8px; |
| 993 |
top: 23px; |
| 994 |
bottom: 0px; |
| 995 |
border-width: 0 1px; |
| 996 |
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAHCAYAAADNufepAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADdJREFUeNpMi7ENADAIwwz/H8TEhMQz/JAupWqmyHGI7JoZIrscxMbBbhX+MMbTpG+x/UgCgzMA+a4RzyZ2yIIAAAAASUVORK5CYII='); |
| 997 |
} |
| 998 |
.profvis-splitbar-horizontal { |
| 999 |
cursor: row-resize; |
| 1000 |
top: 400px; |
| 1001 |
height: 8px; |
| 1002 |
left: 0px; |
| 1003 |
right: 0px; |
| 1004 |
border-width: 0px 0; |
| 1005 |
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAADCAYAAABfwxXFAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADZJREFUeNpi3LHv+BEGBgYGBob/EIqBkQEGGN+8ecOADfz//5+B5cylW0cgqjF1AgAAAP//AwCtfA4GqIXcdgAAAABJRU5ErkJggg=='); |
| 1006 |
} |
| 1007 |
.profvis-status-bar { |
| 1008 |
position: absolute; |
| 1009 |
padding: 0px 0px; |
| 1010 |
top: 0; |
| 1011 |
left: 0; |
| 1012 |
right: 0; |
| 1013 |
height: 22px; |
| 1014 |
line-height: 18px; |
| 1015 |
border-bottom: 1px solid rgb(196, 201, 204); |
| 1016 |
background-color: rgb(248, 249, 248); |
| 1017 |
color: #444; |
| 1018 |
font-family: "Lucida Sans", "DejaVu Sans", "Lucida Grande", "Segoe UI", Verdana, Helvetica, sans-serif; |
| 1019 |
font-size: 11px; |
| 1020 |
-webkit-user-select: none; |
| 1021 |
-moz-user-select: none; |
| 1022 |
-ms-user-select: none; |
| 1023 |
user-select: none; |
| 1024 |
overflow: hidden; |
| 1025 |
} |
| 1026 |
.profvis-footer { |
| 1027 |
position: absolute; |
| 1028 |
padding: 0px 0px; |
| 1029 |
bottom: 0px; |
| 1030 |
left: 0; |
| 1031 |
right: 0; |
| 1032 |
height: 19px; |
| 1033 |
line-height: 18px; |
| 1034 |
border-top: 1px solid rgb(196, 201, 204); |
| 1035 |
background-color: rgb(248, 249, 248); |
| 1036 |
color: #444; |
| 1037 |
font-family: "Lucida Sans", "DejaVu Sans", "Lucida Grande", "Segoe UI", Verdana, Helvetica, sans-serif; |
| 1038 |
font-size: 11px; |
| 1039 |
-webkit-user-select: none; |
| 1040 |
-moz-user-select: none; |
| 1041 |
-ms-user-select: none; |
| 1042 |
user-select: none; |
| 1043 |
overflow: hidden; |
| 1044 |
} |
| 1045 |
.profvis-status-bar .info-block { |
| 1046 |
display: inline-block; |
| 1047 |
vertical-align: top; |
| 1048 |
width: 140px; |
| 1049 |
padding: 2px 11px 2px 11px; |
| 1050 |
} |
| 1051 |
.profvis-footer .info-block { |
| 1052 |
display: inline-block; |
| 1053 |
vertical-align: top; |
| 1054 |
padding: 1px 11px 1px 11px; |
| 1055 |
} |
| 1056 |
.profvis-footer .info-block-right { |
| 1057 |
display: inline-block; |
| 1058 |
vertical-align: top; |
| 1059 |
padding: 1px 11px 1px 11px; |
| 1060 |
float: right; |
| 1061 |
} |
| 1062 |
.profvis-status-bar .result-block { |
| 1063 |
width: auto; |
| 1064 |
cursor: pointer; |
| 1065 |
} |
| 1066 |
.profvis-status-bar .result-block-active { |
| 1067 |
width: auto; |
| 1068 |
background: rgb(227, 229, 230); |
| 1069 |
} |
| 1070 |
.profvis-status-bar .spacing-block { |
| 1071 |
display: inline-block; |
| 1072 |
width: 25px; |
| 1073 |
} |
| 1074 |
.profvis-status-bar .separator-block { |
| 1075 |
display: inline-block; |
| 1076 |
width: 1px; |
| 1077 |
text-align: center; |
| 1078 |
} |
| 1079 |
.profvis-status-bar .separator-block .separator-image { |
| 1080 |
width: 2px; |
| 1081 |
height: 26px; |
| 1082 |
margin-top: -2px; |
| 1083 |
} |
| 1084 |
.profvis-status-bar .options-button { |
| 1085 |
float: right; |
| 1086 |
color: #444; |
| 1087 |
text-decoration: none; |
| 1088 |
cursor: pointer; |
| 1089 |
padding: 2px 11px 2px 11px; |
| 1090 |
} |
| 1091 |
.profvis-options-panel { |
| 1092 |
float: left; |
| 1093 |
position: absolute; |
| 1094 |
right: 0; |
| 1095 |
top: 21px; |
| 1096 |
padding: 3px 6px; |
| 1097 |
border: 1px solid #999; |
| 1098 |
background-color: #fff; |
| 1099 |
font-family: "Lucida Sans", "DejaVu Sans", "Lucida Grande", "Segoe UI", Verdana, Helvetica, sans-serif; |
| 1100 |
font-size: 11px; |
| 1101 |
line-height: 170%; |
| 1102 |
-webkit-user-select: none; |
| 1103 |
-moz-user-select: none; |
| 1104 |
-ms-user-select: none; |
| 1105 |
user-select: none; |
| 1106 |
cursor: pointer; |
| 1107 |
} |
| 1108 |
.profvis-code { |
| 1109 |
position: absolute; |
| 1110 |
top: 0px; |
| 1111 |
left: 0; |
| 1112 |
bottom: 0; |
| 1113 |
right: 0; |
| 1114 |
overflow-y: auto; |
| 1115 |
border: 0px solid #ddd; |
| 1116 |
} |
| 1117 |
.profvis-flamegraph { |
| 1118 |
position: absolute; |
| 1119 |
right: 0; |
| 1120 |
top: 0; |
| 1121 |
bottom: 0; |
| 1122 |
left: 0; |
| 1123 |
overflow: hidden; |
| 1124 |
border: 0px solid #ddd; |
| 1125 |
background: rgb(249, 249, 250); |
| 1126 |
} |
| 1127 |
table.profvis-table { |
| 1128 |
border-collapse: collapse; |
| 1129 |
font-family: "Lucida Sans", "DejaVu Sans", "Lucida Grande", "Segoe UI", Verdana, Helvetica, sans-serif; |
| 1130 |
font-size: 11px; |
| 1131 |
width: 100%; |
| 1132 |
text-align: left; |
| 1133 |
cursor: default; |
| 1134 |
} |
| 1135 |
table.profvis-table th { |
| 1136 |
background-color: rgb(249, 249, 250); |
| 1137 |
width: 14%; |
| 1138 |
} |
| 1139 |
table.profvis-table th.spacing { |
| 1140 |
width: 20px; |
| 1141 |
} |
| 1142 |
table.profvis-table th.filename { |
| 1143 |
font-family: monospace; |
| 1144 |
padding-left: 10px; |
| 1145 |
width: auto; |
| 1146 |
} |
| 1147 |
table.profvis-table th.percent { |
| 1148 |
text-align: center; |
| 1149 |
} |
| 1150 |
table.profvis-table tr { |
| 1151 |
border-top: 1px solid transparent; |
| 1152 |
border-bottom: 1px solid transparent; |
| 1153 |
vertical-align: top; |
| 1154 |
} |
| 1155 |
|
| 1156 |
table.profvis-table tr.locked > td { |
| 1157 |
border-top: 1px solid #444; |
| 1158 |
border-bottom: 1px solid #444; |
| 1159 |
} |
| 1160 |
table.profvis-table tr > td { |
| 1161 |
padding-top: 0; |
| 1162 |
padding-bottom: 0; |
| 1163 |
} |
| 1164 |
table.profvis-table tr.active { |
| 1165 |
background-color: #fdb; |
| 1166 |
} |
| 1167 |
table.profvis-table .linenum { |
| 1168 |
color: #aaa; |
| 1169 |
padding: 0 15px; |
| 1170 |
font-family: monospace; |
| 1171 |
width: 25px; |
| 1172 |
} |
| 1173 |
|
| 1174 |
table.profvis-table [data-pseudo-content]::before { |
| 1175 |
content: attr(data-pseudo-content); |
| 1176 |
} |
| 1177 |
table.profvis-table .code { |
| 1178 |
white-space: pre-wrap; |
| 1179 |
margin: 0; |
| 1180 |
min-height: 1.25em; |
| 1181 |
line-height: 1.25; |
| 1182 |
width: auto; |
| 1183 |
font-family: monospace; |
| 1184 |
background: transparent; |
| 1185 |
} |
| 1186 |
table.profvis-table .time, table.profvis-table .percent { |
| 1187 |
padding: 0 5px; |
| 1188 |
text-align: right; |
| 1189 |
min-width: 2em; |
| 1190 |
max-width: 2em; |
| 1191 |
overflow: hidden; |
| 1192 |
padding-right: 10px; |
| 1193 |
} |
| 1194 |
table.profvis-table .memory { |
| 1195 |
padding-right: 5px; |
| 1196 |
} |
| 1197 |
table.profvis-table th.time { |
| 1198 |
text-align: center; |
| 1199 |
} |
| 1200 |
table.profvis-table .memory { |
| 1201 |
padding: 0 5px; |
| 1202 |
text-align: right; |
| 1203 |
min-width: 2em; |
| 1204 |
max-width: 4em; |
| 1205 |
overflow: hidden; |
| 1206 |
padding-right: 10px; |
| 1207 |
} |
| 1208 |
table.profvis-table .memory-right { |
| 1209 |
text-align: left; |
| 1210 |
} |
| 1211 |
table.profvis-table th.memory { |
| 1212 |
text-align: center; |
| 1213 |
} |
| 1214 |
table.profvis-table .timebar-cell { |
| 1215 |
padding-left: 0; |
| 1216 |
border-left: 1px solid #444; |
| 1217 |
min-width: 3em; |
| 1218 |
width: 3em; |
| 1219 |
} |
| 1220 |
table.profvis-table .timebar-cell > .timebar { |
| 1221 |
background-color: #5A5A5A; |
| 1222 |
border-radius: 0px 2px 2px 0px; |
| 1223 |
line-height: 15px; |
| 1224 |
} |
| 1225 |
table.profvis-table .membar-left-cell { |
| 1226 |
padding-left: 0; |
| 1227 |
padding-right: 0; |
| 1228 |
border-left: 0px solid black; |
| 1229 |
min-width: 0.5em; |
| 1230 |
width: 0.5em; |
| 1231 |
} |
| 1232 |
table.profvis-table .membar-left-cell > .membar { |
| 1233 |
background-color: #A7A7A7; |
| 1234 |
float: right; |
| 1235 |
border-radius: 2px 0px 0px 2px; |
| 1236 |
line-height: 15px; |
| 1237 |
} |
| 1238 |
table.profvis-table .membar-right-cell { |
| 1239 |
padding-left: 0; |
| 1240 |
border-left: 1px solid black; |
| 1241 |
min-width: 1em; |
| 1242 |
width: 1em; |
| 1243 |
} |
| 1244 |
table.profvis-table .membar-right-cell > .membar { |
| 1245 |
background-color: #5A5A5A; |
| 1246 |
border-radius: 0px 2px 2px 0px; |
| 1247 |
line-height: 15px; |
| 1248 |
} |
| 1249 |
.profvis-flamegraph .background { |
| 1250 |
fill: rgb(249, 249, 250); |
| 1251 |
} |
| 1252 |
.profvis-flamegraph .cell .rect { |
| 1253 |
stroke: #000; |
| 1254 |
stroke-width: 0.25px; |
| 1255 |
fill: #fff; |
| 1256 |
} |
| 1257 |
.profvis-flamegraph .cell.active .rect { |
| 1258 |
stroke-width: 0.75px; |
| 1259 |
fill: #ddd; |
| 1260 |
} |
| 1261 |
.profvis-flamegraph .cell.highlighted .rect { |
| 1262 |
fill: #ffc; |
| 1263 |
} |
| 1264 |
.profvis-flamegraph .cell.highlighted.active .rect { |
| 1265 |
fill: #fdb; |
| 1266 |
} |
| 1267 |
.profvis-flamegraph .cell.output .rect { |
| 1268 |
fill: #eef; |
| 1269 |
} |
| 1270 |
.profvis-flamegraph .cell.gc .rect { |
| 1271 |
fill: #ccc; |
| 1272 |
} |
| 1273 |
.profvis-flamegraph .cell.stacktrace .rect { |
| 1274 |
fill: #eee; |
| 1275 |
} |
| 1276 |
.profvis-flamegraph .cell.stacktrace .profvis-label { |
| 1277 |
fill: #666; |
| 1278 |
} |
| 1279 |
.profvis-flamegraph .cell.locked { |
| 1280 |
font-weight: bold; |
| 1281 |
} |
| 1282 |
.profvis-flamegraph .cell.locked .rect { |
| 1283 |
stroke-width: 2px; |
| 1284 |
} |
| 1285 |
.profvis-flamegraph .cell .profvis-label { |
| 1286 |
font-family: monospace; |
| 1287 |
font-size: 11px; |
| 1288 |
cursor: default; |
| 1289 |
} |
| 1290 |
.profvis-flamegraph .axis text { |
| 1291 |
font: 10px sans-serif; |
| 1292 |
} |
| 1293 |
.profvis-flamegraph .axis path, |
| 1294 |
.profvis-flamegraph .axis line { |
| 1295 |
fill: none; |
| 1296 |
stroke: #000; |
| 1297 |
shape-rendering: crispEdges; |
| 1298 |
} |
| 1299 |
.profvis-flamegraph .profvis-tooltip rect { |
| 1300 |
fill: rgb(249, 249, 250); |
| 1301 |
stroke: #000; |
| 1302 |
opacity: 0.75; |
| 1303 |
stroke-opacity: 0.75; |
| 1304 |
stroke-width: 0.5; |
| 1305 |
} |
| 1306 |
.profvis-flamegraph .profvis-tooltip text { |
| 1307 |
text-anchor: middle; |
| 1308 |
font-family: monospace; |
| 1309 |
font-size: 11px; |
| 1310 |
} |
| 1311 |
.profvis-infobox { |
| 1312 |
position: absolute; |
| 1313 |
left: 8px; |
| 1314 |
top: 8px; |
| 1315 |
opacity: 0.8; |
| 1316 |
border-radius: 3px; |
| 1317 |
color: #f8f8f8; |
| 1318 |
background-color: #333; |
| 1319 |
padding: 5px 10px; |
| 1320 |
font-family: "Lucida Sans", "DejaVu Sans", "Lucida Grande", "Segoe UI", Verdana, Helvetica, sans-serif; |
| 1321 |
font-size: 11px; |
| 1322 |
line-height: 100%; |
| 1323 |
pointer-events: none; |
| 1324 |
min-width: 280px; |
| 1325 |
} |
| 1326 |
.profvis-infobox table { |
| 1327 |
border-collapse: separate; |
| 1328 |
border-spacing: 2px; |
| 1329 |
} |
| 1330 |
.profvis-infobox table td { |
| 1331 |
padding: 1px; |
| 1332 |
} |
| 1333 |
.profvis-infobox .infobox-title { |
| 1334 |
font-weight: bold; |
| 1335 |
} |
| 1336 |
.profvis-message { |
| 1337 |
width: 100%; |
| 1338 |
height: 100%; |
| 1339 |
display: -ms-flexbox; |
| 1340 |
display: -webkit-flex; |
| 1341 |
display: flex; |
| 1342 |
-ms-flex-pack: center; |
| 1343 |
-webkit-justify-content: center; |
| 1344 |
justify-content: center; |
| 1345 |
-ms-flex-align: center; |
| 1346 |
-webkit-align-items: center; |
| 1347 |
align-items: center; |
| 1348 |
font-family: "Lucida Sans", "DejaVu Sans", "Lucida Grande", "Segoe UI", Verdana, Helvetica, sans-serif; |
| 1349 |
font-size: 11px; |
| 1350 |
} |
| 1351 |
.profvis-message div { |
| 1352 |
color: #444; |
| 1353 |
height: 25%; |
| 1354 |
} |
| 1355 |
.profvis-treetable { |
| 1356 |
top: 0px; |
| 1357 |
bottom: 0px; |
| 1358 |
left: 0px; |
| 1359 |
right: 0px; |
| 1360 |
position: absolute; |
| 1361 |
margin-top: 23px; |
| 1362 |
margin-bottom: 21px; |
| 1363 |
margin-right: 0px; |
| 1364 |
overflow: hidden; |
| 1365 |
font: 10px sans-serif; |
| 1366 |
color: #161616; |
| 1367 |
font-family: "Lucida Sans", "DejaVu Sans", "Lucida Grande", "Segoe UI", Verdana, Helvetica, sans-serif; |
| 1368 |
font-size: 11px; |
| 1369 |
overflow-y: auto; |
| 1370 |
} |
| 1371 |
.profvis-treetable .results { |
| 1372 |
width: 100%; |
| 1373 |
table-layout: fixed; |
| 1374 |
} |
| 1375 |
.profvis-treetable th { |
| 1376 |
font-weight: normal; |
| 1377 |
height: 18px; |
| 1378 |
background-color: #F8F9F8; |
| 1379 |
border-bottom: solid 1px #E4E4E4; |
| 1380 |
border-right: solid 1px #E4E4E4; |
| 1381 |
padding-left: 3px; |
| 1382 |
padding-right: 3px; |
| 1383 |
} |
| 1384 |
.profvis-treetable td { |
| 1385 |
height: 18px; |
| 1386 |
border-bottom: solid 1px #E4E4E4; |
| 1387 |
border-right: solid 1px #E4E4E4; |
| 1388 |
padding-left: 3px; |
| 1389 |
padding-right: 3px; |
| 1390 |
overflow: hidden; |
| 1391 |
text-overflow: ellipsis; |
| 1392 |
} |
| 1393 |
.profvis-treetable .action { |
| 1394 |
width: 18px; |
| 1395 |
} |
| 1396 |
.profvis-treetable .memory { |
| 1397 |
width: 100px; |
| 1398 |
text-align: right; |
| 1399 |
} |
| 1400 |
.profvis-treetable th { |
| 1401 |
cursor: default; |
| 1402 |
-webkit-user-select: none; |
| 1403 |
-moz-user-select: none; |
| 1404 |
-ms-user-select: none; |
| 1405 |
user-select: none; |
| 1406 |
overflow: hidden; |
| 1407 |
} |
| 1408 |
.profvis-treetable th.memory { |
| 1409 |
text-align: center; |
| 1410 |
} |
| 1411 |
.profvis-treetable .time { |
| 1412 |
width: 100px; |
| 1413 |
text-align: right; |
| 1414 |
} |
| 1415 |
.profvis-treetable th.time { |
| 1416 |
text-align: center; |
| 1417 |
} |
| 1418 |
.profvis-treetable .count { |
| 1419 |
text-align: right; |
| 1420 |
} |
| 1421 |
.profvis-treetable th.count { |
| 1422 |
text-align: center; |
| 1423 |
} |
| 1424 |
.profvis-treetable th.code-label { |
| 1425 |
text-align: left; |
| 1426 |
padding-left: 5px; |
| 1427 |
} |
| 1428 |
.profvis-treetable td.label-pointer { |
| 1429 |
cursor: pointer; |
| 1430 |
} |
| 1431 |
.profvis-treetable .label-text { |
| 1432 |
display: inline-block; |
| 1433 |
-webkit-user-select: none; |
| 1434 |
-khtml-user-select: none; |
| 1435 |
-moz-user-select: none; |
| 1436 |
-ms-user-select: none; |
| 1437 |
user-select: none; |
| 1438 |
} |
| 1439 |
.profvis-treetable .path { |
| 1440 |
text-align: left; |
| 1441 |
} |
| 1442 |
.profvis-treetable .treetable-expand > div { |
| 1443 |
display: inline-block; |
| 1444 |
width: 15px; |
| 1445 |
} |
| 1446 |
.profvis-treetable .treetable-expand > div > div{ |
| 1447 |
width: 0px; |
| 1448 |
height: 0px; |
| 1449 |
margin-left: 3px; |
| 1450 |
margin-right: 6px; |
| 1451 |
border-top: 4px solid transparent; |
| 1452 |
border-left: 6px solid #161616; |
| 1453 |
border-bottom: 4px solid transparent; |
| 1454 |
} |
| 1455 |
.profvis-treetable .treetable-collapse > div { |
| 1456 |
display: inline-block; |
| 1457 |
width: 15px; |
| 1458 |
} |
| 1459 |
.profvis-treetable .treetable-collapse > div > div { |
| 1460 |
width: 0px; |
| 1461 |
height: 0px; |
| 1462 |
margin-left: 3px; |
| 1463 |
margin-right: 6px; |
| 1464 |
border-right: 4px solid transparent; |
| 1465 |
border-top: 6px solid #161616; |
| 1466 |
border-left: 4px solid transparent; |
| 1467 |
display: inline-block; |
| 1468 |
} |
| 1469 |
.profvis-treetable .time-info { |
| 1470 |
padding: 0px; |
| 1471 |
padding-right: 2px; |
| 1472 |
text-align: right; |
| 1473 |
} |
| 1474 |
.profvis-treetable .timebar { |
| 1475 |
width: 0px; |
| 1476 |
height: 14px; |
| 1477 |
background-color: #5A5A5A; |
| 1478 |
float: left; |
| 1479 |
border-radius: 2px 2px 2px 2px; |
| 1480 |
padding-top: 0px; |
| 1481 |
margin-top: 1px; |
| 1482 |
} |
| 1483 |
.profvis-treetable .timecell { |
| 1484 |
padding-top: 2px; |
| 1485 |
padding-right: 3px; |
| 1486 |
} |
| 1487 |
.profvis-treetable .memory-info { |
| 1488 |
padding-left: 0px; |
| 1489 |
padding-right: 2px; |
| 1490 |
text-align: right; |
| 1491 |
} |
| 1492 |
.profvis-treetable .memory-info-right { |
| 1493 |
padding-left: 2px; |
| 1494 |
padding-right: 0px; |
| 1495 |
text-align: left; |
| 1496 |
} |
| 1497 |
.profvis-treetable .memory-leftbar-wrapper { |
| 1498 |
float: left; |
| 1499 |
height: 14px; |
| 1500 |
width: 5px; |
| 1501 |
} |
| 1502 |
.profvis-treetable .memory-leftbar { |
| 1503 |
width: 2px; |
| 1504 |
height: 14px; |
| 1505 |
background-color: #A7A7A7; |
| 1506 |
float: right; |
| 1507 |
border-radius: 1px 0px 0px 1px; |
| 1508 |
} |
| 1509 |
.profvis-treetable .memory-rightbar { |
| 1510 |
width: 2px; |
| 1511 |
float: left; |
| 1512 |
height: 14px; |
| 1513 |
background-color: #5A5A5A; |
| 1514 |
border-radius: 0px 1px 1px 0px; |
| 1515 |
} |
| 1516 |
.profvis-treetable .memory-cell { |
| 1517 |
} |
| 1518 |
.profvis-treetable .memory-bar-container { |
| 1519 |
margin-right: 3px; |
| 1520 |
} |
| 1521 |
.profvis-treetable .time-bar-container { |
| 1522 |
margin-right: 3px; |
| 1523 |
} |
| 1524 |
</style> |
| 1525 |
<script>/*jshint |
| 1526 |
undef:true, |
| 1527 |
browser:true, |
| 1528 |
devel: true, |
| 1529 |
jquery:true, |
| 1530 |
strict:false, |
| 1531 |
curly:false, |
| 1532 |
indent:2 |
| 1533 |
*/ |
| 1534 |
/*global profvis:true, d3, hljs */ |
| 1535 |
|
| 1536 |
profvis = (function() { |
| 1537 |
var profvis = {}; |
| 1538 |
|
| 1539 |
profvis.render = function(el, message) { |
| 1540 |
|
| 1541 |
function generateStatusBarButton(id, caption, active) { |
| 1542 |
var spacerImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAUCAYAAACnOeyiAAAAXklEQVR42mNgAIL///8zMYSGhjIDGYIMIiIMvECGMwMDN4M4kFEDUqIIZKwDMdSBjAsghj6Q8QPEMAAy/lOBoQekv4AYKkDGfgZeXl4RICOLQUtLiw3IUAJJMQIZ7AC2tU2tXJxOYgAAAABJRU5ErkJggg=='; |
| 1543 |
|
| 1544 |
var buttonHtml = |
| 1545 |
'<div id="' + id + '" class="info-block ' + |
| 1546 |
(active ? 'result-block-active' : 'result-block') + |
| 1547 |
'"><span class="info-label">' + caption + '</span></div>' + |
| 1548 |
'<div class="separator-block"><img class="separator-image" src="' + spacerImage + '"></div>'; |
| 1549 |
|
| 1550 |
return buttonHtml; |
| 1551 |
} |
| 1552 |
|
| 1553 |
function generateStatusBar(el, onToogle) { |
| 1554 |
var $el = $(el); |
| 1555 |
|
| 1556 |
el.innerHTML = |
| 1557 |
generateStatusBarButton('flameGraphButton', 'Flame Graph', true) + |
| 1558 |
generateStatusBarButton('treetableButton', 'Data', false) + |
| 1559 |
'<span role="button" class="options-button">Options ▾</span>'; |
| 1560 |
|
| 1561 |
$el.find("span.options-button").on("click", function(e) { |
| 1562 |
e.preventDefault(); |
| 1563 |
e.stopPropagation(); |
| 1564 |
|
| 1565 |
vis.optionsPanel.toggleVisibility(); |
| 1566 |
}); |
| 1567 |
|
| 1568 |
var setStatusBarButtons = function(e) { |
| 1569 |
$(".info-block").removeClass("result-block-active"); |
| 1570 |
$(".info-block").addClass("result-block"); |
| 1571 |
e.addClass("result-block-active"); |
| 1572 |
}; |
| 1573 |
|
| 1574 |
$el.find("#flameGraphButton").on("click", function() { |
| 1575 |
setStatusBarButtons($(this)); |
| 1576 |
onToogle("flamegraph"); |
| 1577 |
}); |
| 1578 |
|
| 1579 |
$el.find("#treetableButton").on("click", function() { |
| 1580 |
setStatusBarButtons($(this)); |
| 1581 |
onToogle("treetable"); |
| 1582 |
}); |
| 1583 |
|
| 1584 |
return { |
| 1585 |
el: el |
| 1586 |
}; |
| 1587 |
} |
| 1588 |
|
| 1589 |
function generateFooter(el, onToogle) { |
| 1590 |
var $el = $(el); |
| 1591 |
|
| 1592 |
el.innerHTML = |
| 1593 |
'<div class="info-block"><span class="info-label">Sample Interval: ' + |
| 1594 |
vis.interval + 'ms</span></div>' + |
| 1595 |
'<div class="info-block-right">' + |
| 1596 |
// '<span class="info-label" title="Peak memory allocation">' + (Math.round(vis.totalMem * 100) / 100) + 'MB</span>' + |
| 1597 |
// ' / ' + |
| 1598 |
'<span class="info-label" title="Total time">' + vis.totalTime + 'ms</span>' + |
| 1599 |
'</div>'; |
| 1600 |
|
| 1601 |
return { |
| 1602 |
el: el |
| 1603 |
}; |
| 1604 |
} |
| 1605 |
|
| 1606 |
function generateOptionsPanel(el, onOptionsChange) { |
| 1607 |
var $el = $(el); |
| 1608 |
|
| 1609 |
el.innerHTML = |
| 1610 |
'<div role="button" class="split-horizontal">' + |
| 1611 |
'<span class="options-checkbox" data-checked="1">' + |
| 1612 |
(vis.splitDir === "h" ? '☒' : '☐') + |
| 1613 |
'</span> Split horizontally' + |
| 1614 |
'</div>' + |
| 1615 |
'<div role="button" class="hide-internal">' + |
| 1616 |
'<span class="options-checkbox" data-checked="1">☒</span> Hide internal function calls' + |
| 1617 |
'</div>' + |
| 1618 |
'<div role="button" class="hide-zero-row">' + |
| 1619 |
'<span class="options-checkbox" data-checked="0">☐</span> Hide lines of code with zero time' + |
| 1620 |
'</div>' + |
| 1621 |
'<div role="button" class="hide-memory">' + |
| 1622 |
'<span class="options-checkbox" data-checked="0">☐</span> Hide memory results' + |
| 1623 |
'</div>'; |
| 1624 |
|
| 1625 |
// Toggle the appearance of a checkbox and return the new checked state. |
| 1626 |
function toggleCheckbox($checkbox) { |
| 1627 |
// Use attr() instead of data(), because the latter tries to coerce to |
| 1628 |
// numbers, which complicates our comparisons. |
| 1629 |
var checked = $checkbox.attr("data-checked"); |
| 1630 |
|
| 1631 |
if (checked === "0") { |
| 1632 |
$checkbox.attr("data-checked", "1"); |
| 1633 |
$checkbox.html("☒"); |
| 1634 |
return true; |
| 1635 |
|
| 1636 |
} else { |
| 1637 |
$checkbox.attr("data-checked", "0"); |
| 1638 |
$checkbox.html("☐"); |
| 1639 |
return false; |
| 1640 |
} |
| 1641 |
} |
| 1642 |
|
| 1643 |
$el.find(".split-horizontal") |
| 1644 |
.on("click", function() { |
| 1645 |
var checked = toggleCheckbox($(this).find(".options-checkbox")); |
| 1646 |
onOptionsChange("split", checked); |
| 1647 |
}); |
| 1648 |
|
| 1649 |
$el.find(".hide-internal") |
| 1650 |
.on("click", function() { |
| 1651 |
var checked = toggleCheckbox($(this).find(".options-checkbox")); |
| 1652 |
onOptionsChange("internals", checked); |
| 1653 |
}); |
| 1654 |
|
| 1655 |
$el.find(".hide-memory") |
| 1656 |
.on("click", function() { |
| 1657 |
var checked = toggleCheckbox($(this).find(".options-checkbox")); |
| 1658 |
onOptionsChange("memory", checked); |
| 1659 |
}); |
| 1660 |
|
| 1661 |
// Make the "hide internal" option available or unavailable to users |
| 1662 |
function enableHideInternal() { |
| 1663 |
$el.find(".hide-internal").css("display", ""); |
| 1664 |
} |
| 1665 |
function disableHideInternal() { |
| 1666 |
$el.find(".hide-internal").css("display", "none"); |
| 1667 |
} |
| 1668 |
// By default, start with it unavailable; it's only relevant for Shiny |
| 1669 |
// apps. |
| 1670 |
disableHideInternal(); |
| 1671 |
|
| 1672 |
|
| 1673 |
$el.find(".hide-zero-row") |
| 1674 |
.on("click", function() { |
| 1675 |
var checked = toggleCheckbox($(this).find(".options-checkbox")); |
| 1676 |
|
| 1677 |
if (checked) { |
| 1678 |
vis.codeTable.hideZeroTimeRows(); |
| 1679 |
} else { |
| 1680 |
vis.codeTable.showZeroTimeRows(); |
| 1681 |
} |
| 1682 |
}); |
| 1683 |
|
| 1684 |
el.style.visibility = "hidden"; |
| 1685 |
function toggleVisibility(offset) { |
| 1686 |
if (el.style.visibility === "visible") { |
| 1687 |
el.style.visibility = "hidden"; |
| 1688 |
} else { |
| 1689 |
el.style.visibility = "visible"; |
| 1690 |
$(document).on("click", hideOnClickOutside); |
| 1691 |
} |
| 1692 |
} |
| 1693 |
|
| 1694 |
// Hide the panel when a click happens outside. This handler also removes |
| 1695 |
// itself after it fires. |
| 1696 |
function hideOnClickOutside(e) { |
| 1697 |
var $el = $(el); |
| 1698 |
if (!$el.is(e.target) && $el.has(e.target).length === 0) { |
| 1699 |
el.style.visibility = "hidden"; |
| 1700 |
// Unregister this event listener |
| 1701 |
$(document).off("click", hideOnClickOutside); |
| 1702 |
} |
| 1703 |
} |
| 1704 |
|
| 1705 |
return { |
| 1706 |
el: el, |
| 1707 |
toggleVisibility: toggleVisibility, |
| 1708 |
enableHideInternal: enableHideInternal, |
| 1709 |
disableHideInternal: disableHideInternal |
| 1710 |
}; |
| 1711 |
} |
| 1712 |
|
| 1713 |
function notifySourceFileMessage(d, details) { |
| 1714 |
if (window.parent.postMessage) { |
| 1715 |
window.parent.postMessage({ |
| 1716 |
source: "profvis", |
| 1717 |
message: "sourcefile", |
| 1718 |
file: d.filename, |
| 1719 |
normpath: d.normpath ? d.normpath : getNormPath(vis.files, d.filename), |
| 1720 |
line: d.linenum, |
| 1721 |
details: details |
| 1722 |
}, window.location.origin); |
| 1723 |
} |
| 1724 |
} |
| 1725 |
|
| 1726 |
function roundOneDecimalNum(number, decimals) { |
| 1727 |
return Math.round(number * 10) / 10; |
| 1728 |
} |
| 1729 |
|
| 1730 |
function roundOneDecimal(number, decimals) { |
| 1731 |
if (!number) return 0; |
| 1732 |
return roundOneDecimalNum(number).toFixed(1); |
| 1733 |
} |
| 1734 |
|
| 1735 |
// Generate the code table ---------------------------------------- |
| 1736 |
function generateCodeTable(el) { |
| 1737 |
var useMemory = false; |
| 1738 |
var content = d3.select(el); |
| 1739 |
|
| 1740 |
if (vis.fileLineStats.length === 0) { |
| 1741 |
content.append("div") |
| 1742 |
.attr("class", "profvis-message") |
| 1743 |
.append("div") |
| 1744 |
.text("(Sources not available)"); |
| 1745 |
} |
| 1746 |
|
| 1747 |
// One table for each file |
| 1748 |
var tables = content.selectAll("table") |
| 1749 |
.data(vis.fileLineStats) |
| 1750 |
.enter() |
| 1751 |
.append("table") |
| 1752 |
.attr("class", "profvis-table"); |
| 1753 |
|
| 1754 |
// Table headers |
| 1755 |
var headerRows = tables.append("tr"); |
| 1756 |
headerRows.append("th") |
| 1757 |
.attr("colspan", "2") |
| 1758 |
.attr("class", "filename") |
| 1759 |
.text(function(d) { return d.filename; }); |
| 1760 |
|
| 1761 |
var percentTooltip = "Percentage of tracked execution time"; |
| 1762 |
var percentMemTooltip = "Percentage of peak memory deallocation and allocation"; |
| 1763 |
|
| 1764 |
headerRows.append("th") |
| 1765 |
.attr("class", "table-memory memory") |
| 1766 |
.attr("colspan", "4") |
| 1767 |
.text("Memory"); |
| 1768 |
|
| 1769 |
headerRows.append("th") |
| 1770 |
.attr("class", "time") |
| 1771 |
.attr("colspan", "2") |
| 1772 |
.text("Time"); |
| 1773 |
|
| 1774 |
headerRows.append("th") |
| 1775 |
.attr("class", "spacing") |
| 1776 |
.attr("data-pseudo-content", "\u00a0"); |
| 1777 |
|
| 1778 |
// Insert each line of code |
| 1779 |
var rows = tables.selectAll("tr.code-row") |
| 1780 |
.data(function(d) { return d.lineData; }) |
| 1781 |
.enter() |
| 1782 |
.append("tr") |
| 1783 |
.attr("class", "code-row"); |
| 1784 |
|
| 1785 |
// Use pseudo-content and CSS content rule to make text unselectable and |
| 1786 |
// uncopyable. See https://danoc.me/blog/css-prevent-copy/ |
| 1787 |
rows.append("td") |
| 1788 |
.attr("class", "linenum") |
| 1789 |
.attr("data-pseudo-content", function(d) { return d.linenum; }); |
| 1790 |
|
| 1791 |
rows.append("td") |
| 1792 |
.attr("class", "code r") |
| 1793 |
.text(function(d) { return d.content; }) |
| 1794 |
.each(function() { hljs.highlightElement(this); }); |
| 1795 |
|
| 1796 |
rows.append("td") |
| 1797 |
.attr("class", "table-memory memory") |
| 1798 |
.attr("title", "Memory deallocation (MB)") |
| 1799 |
.attr("data-pseudo-content", |
| 1800 |
function(d) { return roundOneDecimalNum(d.sumMemDealloc) !== 0 ? roundOneDecimal(d.sumMemDealloc) : ""; }); |
| 1801 |
|
| 1802 |
rows.append("td") |
| 1803 |
.attr("class", "table-memory membar-left-cell") |
| 1804 |
.append("div") |
| 1805 |
.attr("class", "membar") |
| 1806 |
.attr("title", percentMemTooltip) |
| 1807 |
.style("width", function(d) { |
| 1808 |
var p = Math.min(Math.abs(Math.min(Math.round(d.propMemDealloc * 100), 0)), 100); |
| 1809 |
|
| 1810 |
// 8% is the minimal size that looks visually appealing while drawing an almost empty bar |
| 1811 |
p = roundOneDecimalNum(d.sumMemDealloc) !== 0 ? Math.max(p, 8) : 0; |
| 1812 |
return p + "%"; |
| 1813 |
}) |
| 1814 |
// Add the equivalent of to be added with CSS content |
| 1815 |
.attr("data-pseudo-content", "\u00a0"); |
| 1816 |
|
| 1817 |
rows.append("td") |
| 1818 |
.attr("class", "table-memory membar-right-cell") |
| 1819 |
.append("div") |
| 1820 |
.attr("class", "membar") |
| 1821 |
.attr("title", percentMemTooltip) |
| 1822 |
.style("width", function(d) { |
| 1823 |
var p = Math.min(Math.max(Math.round(d.propMemAlloc * 100), 0), 100); |
| 1824 |
|
| 1825 |
// 4% is the minimal size that looks visually appealing while drawing an almost empty bar |
| 1826 |
p = roundOneDecimalNum(d.sumMemAlloc) !== 0 ? Math.max(p, 4) : 0; |
| 1827 |
return p + "%"; |
| 1828 |
}) |
| 1829 |
// Add the equivalent of to be added with CSS content |
| 1830 |
.attr("data-pseudo-content", "\u00a0"); |
| 1831 |
|
| 1832 |
rows.append("td") |
| 1833 |
.attr("class", "table-memory memory memory-right") |
| 1834 |
.attr("title", "Memory allocation (MB)") |
| 1835 |
.attr("data-pseudo-content", |
| 1836 |
function(d) { return roundOneDecimalNum(d.sumMemAlloc) !== 0 ? roundOneDecimal(d.sumMemAlloc) : ""; }); |
| 1837 |
|
| 1838 |
rows.append("td") |
| 1839 |
.attr("class", "time") |
| 1840 |
.attr("title", "Total time (ms)") |
| 1841 |
.attr("data-pseudo-content", |
| 1842 |
function(d) { return Math.round(d.sumTime * 100) !== 0 ? (Math.round(d.sumTime * 100) / 100) : ""; }); |
| 1843 |
|
| 1844 |
rows.append("td") |
| 1845 |
.attr("class", "timebar-cell") |
| 1846 |
.append("div") |
| 1847 |
.attr("class", "timebar") |
| 1848 |
.attr("title", percentTooltip) |
| 1849 |
.style("width", function(d) { |
| 1850 |
return Math.round(d.propTime * 100) + "%"; |
| 1851 |
}) |
| 1852 |
// Add the equivalent of to be added with CSS content |
| 1853 |
.attr("data-pseudo-content", "\u00a0"); |
| 1854 |
|
| 1855 |
rows.append("td") |
| 1856 |
.attr("class", "spacing") |
| 1857 |
.attr("data-pseudo-content", "\u00a0"); |
| 1858 |
|
| 1859 |
rows |
| 1860 |
.on("click", function(d) { |
| 1861 |
// Info box is only relevant when mousing over flamegraph |
| 1862 |
vis.infoBox.hide(); |
| 1863 |
highlighter.click(d); |
| 1864 |
notifySourceFileMessage(d, "select"); |
| 1865 |
}) |
| 1866 |
.on("mouseover", function(d) { |
| 1867 |
if (highlighter.isLocked()) return; |
| 1868 |
|
| 1869 |
// Info box is only relevant when mousing over flamegraph |
| 1870 |
vis.infoBox.hide(); |
| 1871 |
highlighter.hover(d); |
| 1872 |
}) |
| 1873 |
.on("mouseout", function(d) { |
| 1874 |
if (highlighter.isLocked()) return; |
| 1875 |
|
| 1876 |
highlighter.hover(null); |
| 1877 |
}) |
| 1878 |
.on("dblclick", function(d) { |
| 1879 |
notifySourceFileMessage(d, "open"); |
| 1880 |
}); |
| 1881 |
|
| 1882 |
function hideZeroTimeRows() { |
| 1883 |
rows |
| 1884 |
.filter(function(d) { return d.sumTime === 0; }) |
| 1885 |
.style("display", "none"); |
| 1886 |
} |
| 1887 |
|
| 1888 |
function showZeroTimeRows() { |
| 1889 |
rows |
| 1890 |
.filter(function(d) { return d.sumTime === 0; }) |
| 1891 |
.style("display", ""); |
| 1892 |
} |
| 1893 |
|
| 1894 |
function addLockHighlight(d) { |
| 1895 |
var target = d; |
| 1896 |
rows |
| 1897 |
.filter(function(d) { return d === target; } ) |
| 1898 |
.classed({ locked: true }); |
| 1899 |
} |
| 1900 |
|
| 1901 |
function clearLockHighlight() { |
| 1902 |
rows |
| 1903 |
.filter(".locked") |
| 1904 |
.classed({ locked: false }); |
| 1905 |
} |
| 1906 |
|
| 1907 |
function addActiveHighlight(d) { |
| 1908 |
// If we have filename and linenum, search for cells that match, and |
| 1909 |
// set them as "active". |
| 1910 |
var target = d; |
| 1911 |
if (target.filename && target.linenum) { |
| 1912 |
var tr = rows |
| 1913 |
.filter(function(d) { |
| 1914 |
return d.linenum === target.linenum && |
| 1915 |
d.filename === target.filename; |
| 1916 |
}) |
| 1917 |
.classed({ active: true }); |
| 1918 |
|
| 1919 |
tr.node().scrollIntoViewIfNeeded(); |
| 1920 |
} |
| 1921 |
} |
| 1922 |
|
| 1923 |
function clearActiveHighlight() { |
| 1924 |
rows |
| 1925 |
.filter(".active") |
| 1926 |
.classed({ active: false }); |
| 1927 |
} |
| 1928 |
|
| 1929 |
function enableScroll() { |
| 1930 |
// TODO: implement this |
| 1931 |
} |
| 1932 |
|
| 1933 |
function disableScroll() { |
| 1934 |
} |
| 1935 |
|
| 1936 |
function useMemoryResults() { |
| 1937 |
d3.selectAll(".table-memory").style("display", vis.hideMemory ? "none" : ""); |
| 1938 |
} |
| 1939 |
|
| 1940 |
return { |
| 1941 |
el: el, |
| 1942 |
hideZeroTimeRows: hideZeroTimeRows, |
| 1943 |
showZeroTimeRows: showZeroTimeRows, |
| 1944 |
addLockHighlight: addLockHighlight, |
| 1945 |
clearLockHighlight: clearLockHighlight, |
| 1946 |
addActiveHighlight: addActiveHighlight, |
| 1947 |
clearActiveHighlight: clearActiveHighlight, |
| 1948 |
enableScroll: enableScroll, |
| 1949 |
disableScroll: disableScroll, |
| 1950 |
useMemoryResults: useMemoryResults |
| 1951 |
}; |
| 1952 |
} |
| 1953 |
|
| 1954 |
|
| 1955 |
var highlighter = (function() { |
| 1956 |
// D3 data objects for the currently locked and active items |
| 1957 |
var lockItem = null; |
| 1958 |
var activeItem = null; |
| 1959 |
|
| 1960 |
function isLocked() { |
| 1961 |
return lockItem !== null; |
| 1962 |
} |
| 1963 |
|
| 1964 |
function currentLock() { |
| 1965 |
return lockItem; |
| 1966 |
} |
| 1967 |
|
| 1968 |
function currentActive() { |
| 1969 |
return activeItem; |
| 1970 |
} |
| 1971 |
|
| 1972 |
|
| 1973 |
// This is called when a flamegraph cell or a line of code is clicked on. |
| 1974 |
// Clicks also should trigger hover events. |
| 1975 |
function click(d) { |
| 1976 |
// If d is null (background is clicked), or if locked and this click |
| 1977 |
// is on the currently locked selection, just unlock and return. |
| 1978 |
if (d === null || (lockItem && d === lockItem)) { |
| 1979 |
lockItem = null; |
| 1980 |
vis.flameGraph.clearLockHighlight(); |
| 1981 |
vis.codeTable.clearLockHighlight(); |
| 1982 |
return; |
| 1983 |
} |
| 1984 |
|
| 1985 |
// If nothing currently locked, or if locked and this click is on |
| 1986 |
// something other than the currently locked selection, then lock the |
| 1987 |
// current selection. |
| 1988 |
lockItem = d; |
| 1989 |
|
| 1990 |
vis.flameGraph.clearLockHighlight(); |
| 1991 |
vis.codeTable.clearLockHighlight(); |
| 1992 |
hover(null); |
| 1993 |
|
| 1994 |
vis.flameGraph.addLockHighlight(d); |
| 1995 |
vis.codeTable.addLockHighlight(d); |
| 1996 |
hover(d); |
| 1997 |
} |
| 1998 |
|
| 1999 |
|
| 2000 |
function hover(d) { |
| 2001 |
activeItem = d; |
| 2002 |
|
| 2003 |
if (activeItem) { |
| 2004 |
vis.flameGraph.addActiveHighlight(activeItem); |
| 2005 |
vis.codeTable.addActiveHighlight(activeItem); |
| 2006 |
return; |
| 2007 |
} |
| 2008 |
|
| 2009 |
vis.flameGraph.clearActiveHighlight(); |
| 2010 |
vis.codeTable.clearActiveHighlight(); |
| 2011 |
} |
| 2012 |
|
| 2013 |
return { |
| 2014 |
isLocked: isLocked, |
| 2015 |
currentLock: currentLock, |
| 2016 |
currentActive: currentActive, |
| 2017 |
|
| 2018 |
click: click, |
| 2019 |
hover: hover |
| 2020 |
}; |
| 2021 |
})(); |
| 2022 |
|
| 2023 |
|
| 2024 |
// Generate the flame graph ----------------------------------------------- |
| 2025 |
function generateFlameGraph(el) { |
| 2026 |
el.innerHTML = ""; |
| 2027 |
|
| 2028 |
var stackHeight = 15; // Height of each layer on the stack, in pixels |
| 2029 |
var zoomMargin = 0.02; // Extra margin on sides when zooming to fit |
| 2030 |
|
| 2031 |
// Dimensions ----------------------------------------------------------- |
| 2032 |
|
| 2033 |
// Margin inside the svg where the plotting occurs |
| 2034 |
var dims = { |
| 2035 |
margin: { top: 0, right: 0, left: 0, bottom: 30 } |
| 2036 |
}; |
| 2037 |
dims.width = el.clientWidth - dims.margin.left - dims.margin.right; |
| 2038 |
dims.height = el.clientHeight - dims.margin.top - dims.margin.bottom; |
| 2039 |
|
| 2040 |
var domains = { |
| 2041 |
x: [ |
| 2042 |
d3.min(vis.prof, function(d) { return d.startTime; }), |
| 2043 |
d3.max(vis.prof, function(d) { return d.endTime; }) |
| 2044 |
], |
| 2045 |
y: [ |
| 2046 |
d3.min(vis.prof, function(d) { return d.depth; }) - 1, |
| 2047 |
d3.max(vis.prof, function(d) { return d.depth; }) |
| 2048 |
] |
| 2049 |
}; |
| 2050 |
// Slightly expand x domain |
| 2051 |
domains.x = expandRange(domains.x, zoomMargin); |
| 2052 |
|
| 2053 |
// Scales --------------------------------------------------------------- |
| 2054 |
var scales = { |
| 2055 |
x: d3.scale.linear() |
| 2056 |
.domain(domains.x) |
| 2057 |
.range([0, dims.width]), |
| 2058 |
|
| 2059 |
y: d3.scale.linear() |
| 2060 |
.domain(domains.y) |
| 2061 |
.range([dims.height, dims.height - (domains.y[1] - domains.y[0]) * stackHeight]), |
| 2062 |
|
| 2063 |
// This will be a function that, given a data point, returns the depth. |
| 2064 |
// This function can change; sometimes it returns the original depth, |
| 2065 |
// and sometimes it returns the collapsed depth. This isn't exactly a |
| 2066 |
// scale function, but it's close enough for our purposes. |
| 2067 |
getDepth: null |
| 2068 |
}; |
| 2069 |
|
| 2070 |
function useCollapsedDepth() { |
| 2071 |
scales.getDepth = function(d) { return d.depthCollapsed; }; |
| 2072 |
} |
| 2073 |
function useUncollapsedDepth() { |
| 2074 |
scales.getDepth = function(d) { return d.depth; }; |
| 2075 |
} |
| 2076 |
|
| 2077 |
useCollapsedDepth(); |
| 2078 |
|
| 2079 |
// SVG container objects ------------------------------------------------ |
| 2080 |
var svg = d3.select(el).append('svg'); |
| 2081 |
|
| 2082 |
var clipRect = svg.append("clipPath") |
| 2083 |
.attr("id", "clip-" + vis.el.id) |
| 2084 |
.append("rect"); |
| 2085 |
|
| 2086 |
var container = svg.append('g') |
| 2087 |
.attr("transform", "translate(" + dims.margin.left + "," + dims.margin.top + ")") |
| 2088 |
.attr("clip-path", "url(" + urlNoHash() + "#clip-" + vis.el.id + ")"); |
| 2089 |
|
| 2090 |
// Add a background rect so we have something to grab for zooming/panning |
| 2091 |
var backgroundRect = container.append("rect") |
| 2092 |
.attr("class", "background"); |
| 2093 |
|
| 2094 |
// Axes ------------------------------------------------------------ |
| 2095 |
var xAxis = d3.svg.axis() |
| 2096 |
.scale(scales.x) |
| 2097 |
.orient("bottom"); |
| 2098 |
|
| 2099 |
svg.append("g") |
| 2100 |
.attr("class", "x axis") |
| 2101 |
.call(xAxis); |
| 2102 |
|
| 2103 |
// Container sizing ----------------------------------------------------- |
| 2104 |
// Update dimensions of various container elements, based on the overall |
| 2105 |
// dimensions of the containing div. |
| 2106 |
function updateContainerSize() { |
| 2107 |
dims.width = el.clientWidth - dims.margin.left - dims.margin.right; |
| 2108 |
dims.height = el.clientHeight - dims.margin.top - dims.margin.bottom; |
| 2109 |
|
| 2110 |
svg |
| 2111 |
.attr('width', dims.width + dims.margin.left + dims.margin.right) |
| 2112 |
.attr('height', dims.height + dims.margin.top + dims.margin.bottom); |
| 2113 |
|
| 2114 |
clipRect |
| 2115 |
.attr("x", dims.margin.left) |
| 2116 |
.attr("y", dims.margin.top) |
| 2117 |
.attr("width", dims.width) |
| 2118 |
.attr("height", dims.height); |
| 2119 |
|
| 2120 |
backgroundRect |
| 2121 |
.attr("width", dims.width) |
| 2122 |
.attr("height", dims.height); |
| 2123 |
|
| 2124 |
svg.select(".x.axis") |
| 2125 |
.attr("transform", "translate(" + dims.margin.left + "," + dims.height + ")"); |
| 2126 |
} |
| 2127 |
|
| 2128 |
|
| 2129 |
// Redrawing ------------------------------------------------------------ |
| 2130 |
|
| 2131 |
// Redrawing is a little complicated. For performance reasons, the |
| 2132 |
// flamegraph cells that are offscreen aren't rendered; they're removed |
| 2133 |
// from the D3 selection of cells. However, when transitions are |
| 2134 |
// involved, it may be necssary to add objects in their correct |
| 2135 |
// off-screen starting locations before the transition, and then do the |
| 2136 |
// transition. Similarly, it may be necssary to transition objects to |
| 2137 |
// their correct off-screen ending positions. |
| 2138 |
// |
| 2139 |
// In order to handle this, whenever there's a transition, we need to |
| 2140 |
// have the scales for before the transition, and after. When a function |
| 2141 |
// invokes a transition, it will generally do the following: (1) save the |
| 2142 |
// previous scales, (2) modify the current scales, (3) call a redraw |
| 2143 |
// function. The redraw functions are customized for different types of |
| 2144 |
// transitions, and they will use the saved previous scales to position |
| 2145 |
// objects correctly for the transition. When there's no transition, the |
| 2146 |
// previous scales aren't needed, and the redrawImmediate() function |
| 2147 |
// should be used. |
| 2148 |
|
| 2149 |
// Cache cells for faster access (avoid a d3.select()) |
| 2150 |
var cells; |
| 2151 |
|
| 2152 |
// For a data element, return identifying key |
| 2153 |
function dataKey(d) { |
| 2154 |
return d.depth + "-" + d.startTime + "-" + d.endTime; |
| 2155 |
} |
| 2156 |
|
| 2157 |
// For transitions with animation, we need to have a copy of the previous |
| 2158 |
// scales in addition to the current ones. |
| 2159 |
var prevScales = {}; |
| 2160 |
function savePrevScales() { |
| 2161 |
prevScales = { |
| 2162 |
x: scales.x.copy(), |
| 2163 |
y: scales.y.copy(), |
| 2164 |
getDepth: scales.getDepth |
| 2165 |
}; |
| 2166 |
} |
| 2167 |
savePrevScales(); |
| 2168 |
|
| 2169 |
|
| 2170 |
// Returns a D3 selection of the cells that are within the plotting |
| 2171 |
// region, using a set of scales. |
| 2172 |
function selectActiveCells(scales) { |
| 2173 |
var xScale = scales.x; |
| 2174 |
var yScale = scales.y; |
| 2175 |
var depth = scales.getDepth; |
| 2176 |
var width = dims.width; |
| 2177 |
var height = dims.height; |
| 2178 |
|
| 2179 |
var data = vis.prof.filter(function(d) { |
| 2180 |
var depthVal = depth(d); |
| 2181 |
return !(xScale(d.endTime) < 0 || |
| 2182 |
xScale(d.startTime) > width || |
| 2183 |
depthVal === null || |
| 2184 |
yScale(depthVal - 1) < 0 || |
| 2185 |
yScale(depthVal) > height); |
| 2186 |
}); |
| 2187 |
|
| 2188 |
cells = container.selectAll("g.cell").data(data, dataKey); |
| 2189 |
|
| 2190 |
return cells; |
| 2191 |
} |
| 2192 |
|
| 2193 |
// Given an enter selection, add the rect and text objects, but don't |
| 2194 |
// position them. Returns a selection of the new <g> elements. |
| 2195 |
// This should usually be called with addItems(sel.enter()) instead |
| 2196 |
// of sel.enter().call(addItems), because the latter returns the original |
| 2197 |
// enter selection, not the selection of <g> elements, and can't be |
| 2198 |
// used for chaining more function calls on the <g> selection. |
| 2199 |
function addItems(enterSelection) { |
| 2200 |
var cells = enterSelection.append("g") |
| 2201 |
.attr("class", "cell") |
| 2202 |
.classed("highlighted", function(d) { return d.filename !== null; }) |
| 2203 |
.call(addMouseEventHandlers); |
| 2204 |
|
| 2205 |
// Add CSS classes for highlighting cells with labels that match particular |
| 2206 |
// regex patterns. |
| 2207 |
var highlightPatterns = d3.entries(message.highlight); |
| 2208 |
highlightPatterns.map(function(item) { |
| 2209 |
var cssClass = item.key; |
| 2210 |
var regexp = new RegExp(item.value); |
| 2211 |
|
| 2212 |
cells.classed(cssClass, function(d) { |
| 2213 |
return d.label.search(regexp) !== -1; |
| 2214 |
}); |
| 2215 |
}); |
| 2216 |
|
| 2217 |
cells.append("rect") |
| 2218 |
.attr("class", "rect"); |
| 2219 |
|
| 2220 |
cells.append("text") |
| 2221 |
.attr("class", "profvis-label") |
| 2222 |
.text(function(d) { return d.label; }); |
| 2223 |
|
| 2224 |
return cells; |
| 2225 |
} |
| 2226 |
|
| 2227 |
// Given a selection, position the rects and labels, using a set of |
| 2228 |
// scales. |
| 2229 |
function positionItems(cells, scales) { |
| 2230 |
var xScale = scales.x; |
| 2231 |
var yScale = scales.y; |
| 2232 |
var depth = scales.getDepth; |
| 2233 |
|
| 2234 |
cells.select("rect") |
| 2235 |
.attr("width", function(d) { |
| 2236 |
return xScale(d.endTime) - xScale(d.startTime); |
| 2237 |
}) |
| 2238 |
.attr("height", yScale(0) - yScale(1)) |
| 2239 |
.attr("x", function(d) { return xScale(d.startTime); }) |
| 2240 |
.attr("y", function(d) { return yScale(depth(d)); }); |
| 2241 |
|
| 2242 |
cells.select("text") |
| 2243 |
.attr("x", function(d) { |
| 2244 |
// To place the labels, check if there's enough space to fit the |
| 2245 |
// label plus padding in the rect. (We already know the label fits |
| 2246 |
// without padding if we got here.) |
| 2247 |
// * If there's not enough space, simply center the label in the |
| 2248 |
// rect. |
| 2249 |
// * If there is enough space, keep the label within the rect, with |
| 2250 |
// padding. Try to left-align, keeping the label within the |
| 2251 |
// viewing area if possible. |
| 2252 |
|
| 2253 |
// Padding on left and right |
| 2254 |
var pad = 2; |
| 2255 |
|
| 2256 |
var textWidth = getLabelWidth(this, d.label.length); |
| 2257 |
var rectWidth = xScale(d.endTime) - xScale(d.startTime); |
| 2258 |
|
| 2259 |
if (textWidth + pad*2 > rectWidth) { |
| 2260 |
return xScale(d.startTime) + (rectWidth - textWidth) / 2; |
| 2261 |
} else { |
| 2262 |
return Math.min( |
| 2263 |
Math.max(0, xScale(d.startTime)) + pad, |
| 2264 |
xScale(d.endTime) - textWidth - pad |
| 2265 |
); |
| 2266 |
} |
| 2267 |
}) |
| 2268 |
.attr("y", function(d) { return yScale(depth(d) - 0.8); }); |
| 2269 |
|
| 2270 |
return cells; |
| 2271 |
} |
| 2272 |
|
| 2273 |
|
| 2274 |
// Redraw without a transition (regular panning and zooming) |
| 2275 |
function redrawImmediate() { |
| 2276 |
cells = selectActiveCells(scales); |
| 2277 |
|
| 2278 |
cells.exit().remove(); |
| 2279 |
addItems(cells.enter()) |
| 2280 |
.call(addLockHighlightSelection, highlighter.currentLock()) |
| 2281 |
.call(addActiveHighlightSelection, highlighter.currentActive()); |
| 2282 |
cells.call(positionItems, scales); |
| 2283 |
cells.select('text') |
| 2284 |
.call(updateLabelVisibility); |
| 2285 |
svg.select(".x.axis").call(xAxis); |
| 2286 |
} |
| 2287 |
|
| 2288 |
// Redraw for double-click zooming, where there's a transition |
| 2289 |
function redrawZoom(duration) { |
| 2290 |
// Figure out if we're zooming in or out. This will determine when we |
| 2291 |
// recalculate the label visibility: before or after the transition. |
| 2292 |
var prevExtent = prevScales.x.domain()[1] - prevScales.x.domain()[0]; |
| 2293 |
var curExtent = scales.x.domain()[1] - scales.x.domain()[0]; |
| 2294 |
var zoomIn = curExtent < prevExtent; |
| 2295 |
|
| 2296 |
cells = selectActiveCells(scales); |
| 2297 |
|
| 2298 |
// Phase 1 |
| 2299 |
// Add the enter items, highlight them, and position them using the |
| 2300 |
// previous scales |
| 2301 |
addItems(cells.enter()) |
| 2302 |
.call(addLockHighlightSelection, highlighter.currentLock()) |
| 2303 |
.call(addActiveHighlightSelection, highlighter.currentActive()) |
| 2304 |
.call(positionItems, prevScales); |
| 2305 |
|
| 2306 |
// If zooming out, update label visibility. This will hide some labels |
| 2307 |
// now, before the transition, ensuring that they will never be larger |
| 2308 |
// than the box. |
| 2309 |
if (!zoomIn) { |
| 2310 |
cells.select('text') |
| 2311 |
.call(updateLabelVisibility); |
| 2312 |
} |
| 2313 |
|
| 2314 |
// Phase 2 |
| 2315 |
// Position the update (and enter) items using the new scales |
| 2316 |
cells |
| 2317 |
.transition().duration(duration) |
| 2318 |
.call(positionItems, scales); |
| 2319 |
|
| 2320 |
// Position the exit items using the new scales |
| 2321 |
cells.exit() |
| 2322 |
.transition().duration(duration) |
| 2323 |
.call(positionItems, scales); |
| 2324 |
|
| 2325 |
// Update x axis |
| 2326 |
svg.select(".x.axis") |
| 2327 |
.transition().duration(duration) |
| 2328 |
.call(xAxis); |
| 2329 |
|
| 2330 |
// Phase 3 |
| 2331 |
// If zooming in, update label visibility. This will hide some labels |
| 2332 |
// now, after the transition, ensuring that they will never be larger |
| 2333 |
// than the box. |
| 2334 |
if (zoomIn) { |
| 2335 |
cells.select('text') |
| 2336 |
.transition().delay(duration) |
| 2337 |
.call(updateLabelVisibility); |
| 2338 |
} |
| 2339 |
|
| 2340 |
// Remove the exit items |
| 2341 |
cells.exit() |
| 2342 |
.transition().delay(duration) |
| 2343 |
.remove(); |
| 2344 |
} |
| 2345 |
|
| 2346 |
// Redraw when internal functions are hidden |
| 2347 |
function redrawCollapse(exitDuration, updateDuration) { |
| 2348 |
cells = selectActiveCells(scales); |
| 2349 |
|
| 2350 |
// There are two subsets of the exit items: |
| 2351 |
// 1. Those that exit because depth is null. These should fade out. |
| 2352 |
// 2. Those that exit because they move off screen. These should wait |
| 2353 |
// for subset 1 to fade out, then move with a transition. |
| 2354 |
var fadeOutCells = cells.exit() |
| 2355 |
.filter(function(d) { return scales.getDepth(d) === null; }); |
| 2356 |
var moveOutCells = cells.exit() |
| 2357 |
.filter(function(d) { return scales.getDepth(d) !== null; }); |
| 2358 |
|
| 2359 |
// Phase 1 |
| 2360 |
// Add the enter items, highlight them, and position them using the |
| 2361 |
// previous scales |
| 2362 |
addItems(cells.enter()) |
| 2363 |
.call(addLockHighlightSelection, highlighter.currentLock()) |
| 2364 |
.call(addActiveHighlightSelection, highlighter.currentActive()) |
| 2365 |
.call(positionItems, prevScales); |
| 2366 |
|
| 2367 |
cells.select('text') |
| 2368 |
.call(updateLabelVisibility); |
| 2369 |
|
| 2370 |
// Phase 2 |
| 2371 |
// Fade out the items that have a null depth |
| 2372 |
fadeOutCells |
| 2373 |
.transition().duration(exitDuration) |
| 2374 |
.style("opacity", 0); |
| 2375 |
|
| 2376 |
// Phase 3 |
| 2377 |
// Position the update (and enter) items using the new scales |
| 2378 |
cells |
| 2379 |
.transition().delay(exitDuration).duration(updateDuration) |
| 2380 |
.call(positionItems, scales); |
| 2381 |
|
| 2382 |
// Position the exit items that move out, using the new scales |
| 2383 |
moveOutCells |
| 2384 |
.transition().delay(exitDuration).duration(updateDuration) |
| 2385 |
.call(positionItems, scales); |
| 2386 |
|
| 2387 |
// Phase 4 |
| 2388 |
// Remove all the exit items |
| 2389 |
cells.exit() |
| 2390 |
.transition().delay(exitDuration + updateDuration) |
| 2391 |
.remove(); |
| 2392 |
} |
| 2393 |
|
| 2394 |
// Redraw when internal functions are un-hidden |
| 2395 |
function redrawUncollapse(updateDuration, enterDuration) { |
| 2396 |
cells = selectActiveCells(scales); |
| 2397 |
|
| 2398 |
var enterCells = addItems(cells.enter()); |
| 2399 |
// There are two subsets of the enter items: |
| 2400 |
// 1. Those that enter because they move on screen (but the previous |
| 2401 |
// depth was not null). These should move with a transition. |
| 2402 |
// 2. Those that enter because the previous depth was null. These |
| 2403 |
// should wait for subset 1 to move, then fade in. |
| 2404 |
var moveInCells = enterCells |
| 2405 |
.filter(function(d) { return prevScales.getDepth(d) !== null; }); |
| 2406 |
var fadeInCells = enterCells |
| 2407 |
.filter(function(d) { return prevScales.getDepth(d) === null; }); |
| 2408 |
|
| 2409 |
// Phase 1 |
| 2410 |
// Highlight and position the move-in items with the old scales |
| 2411 |
moveInCells |
| 2412 |
.call(addLockHighlightSelection, highlighter.currentLock()) |
| 2413 |
.call(addActiveHighlightSelection, highlighter.currentActive()) |
| 2414 |
.call(positionItems, prevScales); |
| 2415 |
|
| 2416 |
cells.select('text') |
| 2417 |
.call(updateLabelVisibility); |
| 2418 |
|
| 2419 |
// Phase 2 |
| 2420 |
// Position the move-in, update, and exit items with a transition |
| 2421 |
moveInCells |
| 2422 |
.transition().duration(updateDuration) |
| 2423 |
.call(positionItems, scales); |
| 2424 |
cells |
| 2425 |
.transition().duration(updateDuration) |
| 2426 |
.call(positionItems, scales); |
| 2427 |
cells.exit() |
| 2428 |
.transition().duration(updateDuration) |
| 2429 |
.call(positionItems, scales); |
| 2430 |
|
| 2431 |
// Phase 3 |
| 2432 |
// Highlight and position the fade-in items, then fade in |
| 2433 |
fadeInCells |
| 2434 |
.call(addLockHighlightSelection, highlighter.currentLock()) |
| 2435 |
.call(addActiveHighlightSelection, highlighter.currentActive()) |
| 2436 |
.call(positionItems, scales) |
| 2437 |
.style("opacity", 0) |
| 2438 |
.transition().delay(updateDuration).duration(enterDuration) |
| 2439 |
.style("opacity", 1); |
| 2440 |
|
| 2441 |
// Phase 4 |
| 2442 |
// Remove the exit items |
| 2443 |
cells.exit() |
| 2444 |
.transition().delay(updateDuration + enterDuration) |
| 2445 |
.remove(); |
| 2446 |
} |
| 2447 |
|
| 2448 |
|
| 2449 |
// Calculate whether to display label in each cell ---------------------- |
| 2450 |
|
| 2451 |
// Finding the dimensions of SVG elements is expensive. We'll reduce the |
| 2452 |
// calls getBoundingClientRect() by caching the dimensions. |
| 2453 |
|
| 2454 |
// Cache the width of labels. This is a lookup table which, given the |
| 2455 |
// number of characters, gives the number of pixels. The label width |
| 2456 |
// never changes, so we can keep it outside of updateLabelVisibility(). |
| 2457 |
var labelWidthTable = {}; |
| 2458 |
function getLabelWidth(el, nchar) { |
| 2459 |
// Add entry if it doesn't already exist |
| 2460 |
if (labelWidthTable[nchar] === undefined) { |
| 2461 |
// If the text isn't displayed, then we can't get its width. Make |
| 2462 |
// sure it's visible, get the width, and then restore original |
| 2463 |
// display state. |
| 2464 |
var oldDisplay = el.style.display; |
| 2465 |
el.style.display = "inline"; |
| 2466 |
labelWidthTable[nchar] = el.getBoundingClientRect().width; |
| 2467 |
el.style.display = oldDisplay; |
| 2468 |
} |
| 2469 |
return labelWidthTable[nchar]; |
| 2470 |
} |
| 2471 |
|
| 2472 |
// Show labels that fit in the corresponding rectangle, and hide others. |
| 2473 |
function updateLabelVisibility(labels) { |
| 2474 |
// Cache the width of rects. This is a lookup table which, given the |
| 2475 |
// timespan (width in data), gives the number of pixels. The width of |
| 2476 |
// rects changes with the x scale, so we have to rebuild the table each |
| 2477 |
// time the scale changes. |
| 2478 |
var rectWidthTable = {}; |
| 2479 |
var x0 = scales.x(0); |
| 2480 |
function getRectWidth(time) { |
| 2481 |
// Add entry if it doesn't already exist |
| 2482 |
if (rectWidthTable[time] === undefined) { |
| 2483 |
rectWidthTable[time] = scales.x(time) - x0; |
| 2484 |
} |
| 2485 |
return rectWidthTable[time]; |
| 2486 |
} |
| 2487 |
|
| 2488 |
// Now calculate text and rect width for each cell. |
| 2489 |
labels.style("display", function(d) { |
| 2490 |
var labelWidth = getLabelWidth(this, d.label.length); |
| 2491 |
var boxWidth = getRectWidth(d.endTime - d.startTime); |
| 2492 |
|
| 2493 |
return (labelWidth <= boxWidth) ? "" : "none"; |
| 2494 |
}); |
| 2495 |
|
| 2496 |
return labels; |
| 2497 |
} |
| 2498 |
|
| 2499 |
|
| 2500 |
function onResize() { |
| 2501 |
updateContainerSize(); |
| 2502 |
|
| 2503 |
scales.x.range([0, dims.width]); |
| 2504 |
zoom.x(scales.x); |
| 2505 |
|
| 2506 |
// Preserve distance from bottom, instead of from top (which is the |
| 2507 |
// default behavior). |
| 2508 |
scales.y.range([ |
| 2509 |
dims.height, |
| 2510 |
dims.height - (domains.y[1] - domains.y[0]) * stackHeight |
| 2511 |
]); |
| 2512 |
redrawImmediate(); |
| 2513 |
} |
| 2514 |
|
| 2515 |
// Attach mouse event handlers ------------------------------------ |
| 2516 |
var dragging = false; |
| 2517 |
|
| 2518 |
function addMouseEventHandlers(cells) { |
| 2519 |
cells |
| 2520 |
.on("mouseup", function(d) { |
| 2521 |
if (dragging) return; |
| 2522 |
|
| 2523 |
// If it wasn't a drag, treat it as a click |
| 2524 |
vis.infoBox.show(d); |
| 2525 |
highlighter.click(d); |
| 2526 |
notifySourceFileMessage(d, "select"); |
| 2527 |
}) |
| 2528 |
.on("mouseover", function(d) { |
| 2529 |
if (dragging) return; |
| 2530 |
|
| 2531 |
// If no label currently shown, display a tooltip |
| 2532 |
var label = this.querySelector(".profvis-label"); |
| 2533 |
if (label.style.display === "none") { |
| 2534 |
var box = this.getBBox(); |
| 2535 |
showTooltip( |
| 2536 |
d.label, |
| 2537 |
box.x + box.width / 2, |
| 2538 |
box.y - box.height |
| 2539 |
); |
| 2540 |
} |
| 2541 |
|
| 2542 |
if (!highlighter.isLocked()) { |
| 2543 |
vis.infoBox.show(d); |
| 2544 |
highlighter.hover(d); |
| 2545 |
} |
| 2546 |
}) |
| 2547 |
.on("mouseout", function(d) { |
| 2548 |
if (dragging) return; |
| 2549 |
|
| 2550 |
hideTooltip(); |
| 2551 |
|
| 2552 |
if (!highlighter.isLocked()) { |
| 2553 |
vis.infoBox.hide(); |
| 2554 |
highlighter.hover(null); |
| 2555 |
} |
| 2556 |
}) |
| 2557 |
.on("dblclick.zoomcell", function(d) { |
| 2558 |
// When a cell is double-clicked, zoom x to that cell's width. |
| 2559 |
savePrevScales(); |
| 2560 |
|
| 2561 |
scales.x.domain(expandRange([d.startTime, d.endTime], zoomMargin)); |
| 2562 |
zoom.x(scales.x); |
| 2563 |
|
| 2564 |
redrawZoom(250); |
| 2565 |
|
| 2566 |
notifySourceFileMessage(d, "open"); |
| 2567 |
}); |
| 2568 |
|
| 2569 |
return cells; |
| 2570 |
} |
| 2571 |
|
| 2572 |
// Tooltip -------------------------------------------------------- |
| 2573 |
function showTooltip(label, x, y) { |
| 2574 |
var tooltip = container.append("g").attr("class", "profvis-tooltip"); |
| 2575 |
var tooltipRect = tooltip.append("rect"); |
| 2576 |
var tooltipLabel = tooltip.append("text") |
| 2577 |
.text(label) |
| 2578 |
.attr("x", x) |
| 2579 |
.attr("y", y + stackHeight * 0.2); // Shift down slightly for baseline |
| 2580 |
|
| 2581 |
// Add box around label |
| 2582 |
var labelBox = tooltipLabel.node().getBBox(); |
| 2583 |
var rectWidth = labelBox.width + 10; |
| 2584 |
var rectHeight = labelBox.height + 4; |
| 2585 |
tooltipRect |
| 2586 |
.attr("width", rectWidth) |
| 2587 |
.attr("height", rectHeight) |
| 2588 |
.attr("x", x - rectWidth / 2) |
| 2589 |
.attr("y", y - rectHeight / 2) |
| 2590 |
.attr("rx", 4) // Rounded corners -- can't set this in CSS |
| 2591 |
.attr("ry", 4); |
| 2592 |
} |
| 2593 |
|
| 2594 |
function hideTooltip() { |
| 2595 |
container.select("g.profvis-tooltip").remove(); |
| 2596 |
} |
| 2597 |
|
| 2598 |
|
| 2599 |
// Highlighting --------------------------------------------------------- |
| 2600 |
|
| 2601 |
function addLockHighlight(d) { |
| 2602 |
addLockHighlightSelection(cells, d); |
| 2603 |
} |
| 2604 |
|
| 2605 |
function clearLockHighlight() { |
| 2606 |
cells |
| 2607 |
.filter(".locked") |
| 2608 |
.classed({ locked: false }); |
| 2609 |
} |
| 2610 |
|
| 2611 |
|
| 2612 |
function addActiveHighlight(d) { |
| 2613 |
if (!d) return; |
| 2614 |
addActiveHighlightSelection(cells, d); |
| 2615 |
} |
| 2616 |
|
| 2617 |
function clearActiveHighlight() { |
| 2618 |
cells |
| 2619 |
.filter(".active") |
| 2620 |
.classed({ active: false }); |
| 2621 |
} |
| 2622 |
|
| 2623 |
// These are versions of addLockHighlight and addActiveHighlight which |
| 2624 |
// are only internally visible. It must be passed a selection of cells to |
| 2625 |
// perform the highlighting on. This can be more efficient because it can |
| 2626 |
// operate on just an enter selection instead of all cells. |
| 2627 |
function addLockHighlightSelection(selection, d) { |
| 2628 |
if (!d) return; |
| 2629 |
|
| 2630 |
var target = d; |
| 2631 |
selection |
| 2632 |
.filter(function(d) { return d === target; } ) |
| 2633 |
.classed({ locked: true }) |
| 2634 |
.call(moveToFront); |
| 2635 |
} |
| 2636 |
|
| 2637 |
function addActiveHighlightSelection(selection, d) { |
| 2638 |
if (!d) return; |
| 2639 |
|
| 2640 |
var target = d; |
| 2641 |
if (target.filename && target.linenum) { |
| 2642 |
selection |
| 2643 |
.filter(function(d) { |
| 2644 |
// Check for filename and linenum match, and if provided, a label match. |
| 2645 |
var match = d.filename === target.filename && |
| 2646 |
d.linenum === target.linenum; |
| 2647 |
if (!!target.label) { |
| 2648 |
match = match && (d.label === target.label); |
| 2649 |
} |
| 2650 |
return match; |
| 2651 |
}) |
| 2652 |
.classed({ active: true }); |
| 2653 |
|
| 2654 |
} else if (target.label) { |
| 2655 |
// Don't highlight blocks for these labels |
| 2656 |
var exclusions = ["<Anonymous>", "FUN"]; |
| 2657 |
if (exclusions.some(function(x) { return target.label === x; })) { |
| 2658 |
return; |
| 2659 |
} |
| 2660 |
|
| 2661 |
// If we only have the label, search for cells that match, but make sure |
| 2662 |
// to not select ones that have a filename and linenum. |
| 2663 |
selection |
| 2664 |
.filter(function(d) { |
| 2665 |
return d.label === target.label && |
| 2666 |
d.filename === null && |
| 2667 |
d.linenum === null; |
| 2668 |
}) |
| 2669 |
.classed({ active: true }); |
| 2670 |
} |
| 2671 |
} |
| 2672 |
|
| 2673 |
// Move a D3 selection to front. If this is called on a selection, that |
| 2674 |
// selection should have been created with a data indexing function (e.g. |
| 2675 |
// data(data, function(d) { return ... })). Otherwise, the wrong object |
| 2676 |
// may be moved to the front. |
| 2677 |
function moveToFront(selection) { |
| 2678 |
return selection.each(function() { |
| 2679 |
this.parentNode.appendChild(this); |
| 2680 |
}); |
| 2681 |
} |
| 2682 |
|
| 2683 |
|
| 2684 |
// Panning and zooming -------------------------------------------- |
| 2685 |
// For panning and zooming x, d3.behavior.zoom does most of what we want |
| 2686 |
// automatically. For panning y, we can't use d3.behavior.zoom becuase it |
| 2687 |
// will also automatically add zooming, which we don't want. Instead, we |
| 2688 |
// need to use d3.behavior.drag and set the y domain appropriately. |
| 2689 |
var drag = d3.behavior.drag() |
| 2690 |
.on("drag", function() { |
| 2691 |
dragging = true; |
| 2692 |
var y = scales.y; |
| 2693 |
var ydom = y.domain(); |
| 2694 |
var ydiff = y.invert(d3.event.dy) - y.invert(0); |
| 2695 |
y.domain([ydom[0] - ydiff, ydom[1] - ydiff]); |
| 2696 |
}); |
| 2697 |
|
| 2698 |
|
| 2699 |
// For mousewheel zooming, we need to limit zoom amount. This is needed |
| 2700 |
// because in Firefox, zoom increments are too big. To do this, we limit |
| 2701 |
// scaleExtent before the first zoom event, and after each subsequent |
| 2702 |
// one. |
| 2703 |
// |
| 2704 |
// When zooming out, there's an additional limit: never zoom out past |
| 2705 |
// the original zoom span. The reason it's necessary to calculate this |
| 2706 |
// each time, instead of simply setting the scaleExtent() so that the |
| 2707 |
// lower bound is 1, is because other zoom events (like |
| 2708 |
// dblclick.zoomcell) are able to change the domain of scales.x, without |
| 2709 |
// changing the value of zoom.scale(). This means that the relationship |
| 2710 |
// between the zoom.scale() does not have a fixed linear relationship to |
| 2711 |
// the span of scales.x, and we have to recalculate it. |
| 2712 |
var maxZoomPerStep = 1.1; |
| 2713 |
|
| 2714 |
function zoomOutLimit() { |
| 2715 |
var span = scales.x.domain()[1] - scales.x.domain()[0]; |
| 2716 |
var startSpan = domains.x[1] - domains.x[0]; |
| 2717 |
return Math.min(maxZoomPerStep, startSpan/span); |
| 2718 |
} |
| 2719 |
|
| 2720 |
var zoom = d3.behavior.zoom() |
| 2721 |
.x(scales.x) |
| 2722 |
.on("zoomstart", function() { |
| 2723 |
zoom.scaleExtent([zoom.scale() / zoomOutLimit(), zoom.scale() * maxZoomPerStep]); |
| 2724 |
}) |
| 2725 |
.on("zoom", function(e) { |
| 2726 |
redrawImmediate(); |
| 2727 |
zoom.scaleExtent([zoom.scale() / zoomOutLimit(), zoom.scale() * maxZoomPerStep]); |
| 2728 |
}); |
| 2729 |
|
| 2730 |
// Register drag before zooming, because we need the drag to set the y |
| 2731 |
// scale before the zoom triggers a redraw. |
| 2732 |
svg |
| 2733 |
.on("mouseup", function(d) { |
| 2734 |
dragging = false; |
| 2735 |
}) |
| 2736 |
.call(drag); |
| 2737 |
|
| 2738 |
// Unlock selection when background is clicked, and zoom out when |
| 2739 |
// background is double-clicked. |
| 2740 |
backgroundRect |
| 2741 |
.on("mouseup", function(d) { |
| 2742 |
if (dragging) return; |
| 2743 |
|
| 2744 |
// If it wasn't a drag, hide info box and unlock. |
| 2745 |
vis.infoBox.hide(); |
| 2746 |
highlighter.click(null); |
| 2747 |
}) |
| 2748 |
.on("dblclick.zoombackground", function() { |
| 2749 |
savePrevScales(); |
| 2750 |
|
| 2751 |
scales.x.domain(domains.x); |
| 2752 |
zoom.x(scales.x); |
| 2753 |
|
| 2754 |
redrawZoom(250); |
| 2755 |
}); |
| 2756 |
|
| 2757 |
|
| 2758 |
var zoomEnabled = false; |
| 2759 |
function disableZoom() { |
| 2760 |
if (zoomEnabled) { |
| 2761 |
svg.on(".zoom", null); |
| 2762 |
zoomEnabled = false; |
| 2763 |
} |
| 2764 |
} |
| 2765 |
function enableZoom() { |
| 2766 |
if (!zoomEnabled) { |
| 2767 |
svg |
| 2768 |
.call(zoom) |
| 2769 |
.on("dblclick.zoom", null); // Disable zoom's built-in double-click behavior |
| 2770 |
zoomEnabled = true; |
| 2771 |
} |
| 2772 |
} |
| 2773 |
enableZoom(); |
| 2774 |
|
| 2775 |
onResize(); |
| 2776 |
|
| 2777 |
return { |
| 2778 |
el: el, |
| 2779 |
onResize: onResize, |
| 2780 |
onUpdateInternals: onResize, |
| 2781 |
redrawImmediate: redrawImmediate, |
| 2782 |
redrawZoom: redrawZoom, |
| 2783 |
redrawCollapse: redrawCollapse, |
| 2784 |
redrawUncollapse: redrawUncollapse, |
| 2785 |
savePrevScales: savePrevScales, |
| 2786 |
useCollapsedDepth: useCollapsedDepth, |
| 2787 |
useUncollapsedDepth: useUncollapsedDepth, |
| 2788 |
addLockHighlight: addLockHighlight, |
| 2789 |
clearLockHighlight: clearLockHighlight, |
| 2790 |
addActiveHighlight: addActiveHighlight, |
| 2791 |
clearActiveHighlight: clearActiveHighlight, |
| 2792 |
disableZoom: disableZoom, |
| 2793 |
enableZoom: enableZoom |
| 2794 |
}; |
| 2795 |
} // generateFlameGraph |
| 2796 |
|
| 2797 |
|
| 2798 |
function initInfoBox(el) { |
| 2799 |
|
| 2800 |
function show(d) { |
| 2801 |
var label = d.label ? d.label : ""; |
| 2802 |
var ref = (d.filename && d.linenum) ? |
| 2803 |
(d.filename + "#" + d.linenum) : |
| 2804 |
"(source unavailable)"; |
| 2805 |
|
| 2806 |
el.style.visibility = ""; |
| 2807 |
|
| 2808 |
el.innerHTML = |
| 2809 |
"<table>" + |
| 2810 |
"<tr><td class='infobox-title'>Label</td><td>" + escapeHTML(label) + "</td></tr>" + |
| 2811 |
"<tr><td class='infobox-title'>Called from</td><td>" + escapeHTML(ref) + "</td></tr>" + |
| 2812 |
"<tr><td class='infobox-title'>Total time</td><td>" + (d.endTime - d.startTime) + "ms</td></tr>" + |
| 2813 |
"<tr><td class='infobox-title'>Memory</td><td>" + |
| 2814 |
roundOneDecimal(d.sumMemDealloc) + " / " + roundOneDecimal(d.sumMemAlloc) + |
| 2815 |
" MB</td></tr>" + |
| 2816 |
"<tr><td class='infobox-title'>Agg. total time</td><td>" + vis.aggLabelTimes[label] + "ms</td></tr>" + |
| 2817 |
"<tr><td class='infobox-title'>Call stack depth</td><td>" + d.depth + "</td></tr>" + |
| 2818 |
"</table>"; |
| 2819 |
} |
| 2820 |
|
| 2821 |
function hide() { |
| 2822 |
el.style.visibility = "hidden"; |
| 2823 |
} |
| 2824 |
|
| 2825 |
hide(); |
| 2826 |
|
| 2827 |
return { |
| 2828 |
el: el, |
| 2829 |
show: show, |
| 2830 |
hide: hide |
| 2831 |
}; |
| 2832 |
} |
| 2833 |
|
| 2834 |
// Generate the tree table ---------------------------------------- |
| 2835 |
function generateTreetable(el) { |
| 2836 |
var content = d3.select(el); |
| 2837 |
|
| 2838 |
var table = content.append("table") |
| 2839 |
.attr("class", "results") |
| 2840 |
.attr("cellspacing", "0") |
| 2841 |
.attr("cellpadding", "0"); |
| 2842 |
|
| 2843 |
table.append("col"); |
| 2844 |
table.append("col") |
| 2845 |
.style("width", "120px"); |
| 2846 |
table.append("col") |
| 2847 |
.style("width", "50px") |
| 2848 |
.attr("class", "treetable-memory"); |
| 2849 |
table.append("col") |
| 2850 |
.style("width", "26px") |
| 2851 |
.attr("class", "treetable-memory"); |
| 2852 |
table.append("col") |
| 2853 |
.style("width", "50px") |
| 2854 |
.attr("class", "treetable-memory"); |
| 2855 |
table.append("col") |
| 2856 |
.style("width", "50px"); |
| 2857 |
table.append("col") |
| 2858 |
.style("width", "40px"); |
| 2859 |
|
| 2860 |
var tableBody = table.append("tbody"); |
| 2861 |
|
| 2862 |
var headerRows = tableBody.append("tr"); |
| 2863 |
|
| 2864 |
headerRows.append("th") |
| 2865 |
.attr("class", "code-label") |
| 2866 |
.text("Code"); |
| 2867 |
|
| 2868 |
headerRows.append("th") |
| 2869 |
.attr("class", "path") |
| 2870 |
.text("File"); |
| 2871 |
|
| 2872 |
headerRows.append("th") |
| 2873 |
.attr("class", "treetable-memory memory") |
| 2874 |
.attr("colspan", "3") |
| 2875 |
.text("Memory (MB)"); |
| 2876 |
|
| 2877 |
headerRows.append("th") |
| 2878 |
.attr("class", "time") |
| 2879 |
.attr("colspan", "2") |
| 2880 |
.text("Time (ms)"); |
| 2881 |
|
| 2882 |
// Retrieve all nodes (n), recursevely, where check(n) == true. |
| 2883 |
function allTopNodes(nodes, check) { |
| 2884 |
var included = []; |
| 2885 |
nodes = nodes.slice(); |
| 2886 |
|
| 2887 |
while (nodes.length > 0) { |
| 2888 |
var node = nodes.shift(); |
| 2889 |
|
| 2890 |
if (check(node)) |
| 2891 |
included.push(node); |
| 2892 |
else { |
| 2893 |
node.sumChildren.forEach(function(c1) { |
| 2894 |
nodes.unshift(c1); |
| 2895 |
}); |
| 2896 |
} |
| 2897 |
} |
| 2898 |
return included; |
| 2899 |
} |
| 2900 |
|
| 2901 |
// Is there one node (n), including root, where check(n) == true? |
| 2902 |
function oneNode(root, check) { |
| 2903 |
var nodes = [root]; |
| 2904 |
|
| 2905 |
while (nodes.length > 0) { |
| 2906 |
var n = nodes.shift(); |
| 2907 |
if (check(n)) |
| 2908 |
return true; |
| 2909 |
|
| 2910 |
n.sumChildren.forEach(function(x) { |
| 2911 |
nodes.unshift(x); |
| 2912 |
}); |
| 2913 |
} |
| 2914 |
|
| 2915 |
return false; |
| 2916 |
} |
| 2917 |
|
| 2918 |
function updateRowsDisplay(d) { |
| 2919 |
if (vis.hideInternals && d.isInternal) |
| 2920 |
return "none"; |
| 2921 |
else if (!vis.hideInternals && d.isDescendant) |
| 2922 |
return "none"; |
| 2923 |
|
| 2924 |
var collapsed = false; |
| 2925 |
while (d.parent) { |
| 2926 |
d = d.parent; |
| 2927 |
if (d.collapsed) { |
| 2928 |
collapsed = true; |
| 2929 |
break; |
| 2930 |
} |
| 2931 |
} |
| 2932 |
return collapsed ? "none" : ""; |
| 2933 |
} |
| 2934 |
|
| 2935 |
function toggleTreeNode(d) { |
| 2936 |
if (!d.canExpand) |
| 2937 |
return; |
| 2938 |
|
| 2939 |
var collapsed = d.collapsed; |
| 2940 |
if (collapsed === undefined) { |
| 2941 |
// Create a copy since we might insert the same node twice: once |
| 2942 |
// for the normal leaf the other one for a collapsed node. |
| 2943 |
var sumChildren = d.sumChildren.map(function(x) { |
| 2944 |
return jQuery.extend({}, x); |
| 2945 |
}); |
| 2946 |
|
| 2947 |
var childNodes = sumChildren.filter(function(x) { |
| 2948 |
return x.depthCollapsed !== null; |
| 2949 |
}); |
| 2950 |
|
| 2951 |
childNodes.forEach(function(x) { |
| 2952 |
x.isInternal = d.isInternal ? d.isInternal : false; |
| 2953 |
x.isDescendant = d.isDescendant ? d.isDescendant : false; |
| 2954 |
}); |
| 2955 |
|
| 2956 |
var internalChildNodes = sumChildren.filter(function(x) { |
| 2957 |
return x.depthCollapsed === null; |
| 2958 |
}); |
| 2959 |
|
| 2960 |
internalChildNodes.forEach(function(x) { |
| 2961 |
x.isInternal = true; |
| 2962 |
x.isDescendant = false; |
| 2963 |
}); |
| 2964 |
|
| 2965 |
var notInternalDescendantNodes = []; |
| 2966 |
if (!d.isInternal) { |
| 2967 |
notInternalDescendantNodes = allTopNodes(internalChildNodes, function(x) { |
| 2968 |
return x.depthCollapsed !== null && d.depth < x.depth; |
| 2969 |
}); |
| 2970 |
} |
| 2971 |
|
| 2972 |
notInternalDescendantNodes.forEach(function(x) { |
| 2973 |
x.isInternal = false; |
| 2974 |
x.isDescendant = true; |
| 2975 |
}); |
| 2976 |
|
| 2977 |
childNodes = childNodes.concat(internalChildNodes); |
| 2978 |
childNodes = childNodes.concat(notInternalDescendantNodes); |
| 2979 |
|
| 2980 |
childNodes.forEach(function(n) { |
| 2981 |
n.visualDepth = d.visualDepth + 1; |
| 2982 |
n.parent = d; |
| 2983 |
}); |
| 2984 |
|
| 2985 |
vis.profTable = vis.profTable.concat(childNodes); |
| 2986 |
d.collapsed = false; |
| 2987 |
|
| 2988 |
updateRows(); |
| 2989 |
|
| 2990 |
// Nodes are sorted "heaviest first" |
| 2991 |
if (childNodes.length == 1) toggleTreeNode(childNodes[0]); |
| 2992 |
} |
| 2993 |
else { |
| 2994 |
d.collapsed = !collapsed; |
| 2995 |
updateRows(); |
| 2996 |
} |
| 2997 |
} |
| 2998 |
|
| 2999 |
function updateLabelCells(labelCell) { |
| 3000 |
labelCell |
| 3001 |
.attr("nowrap", "true") |
| 3002 |
.style("padding-left", function(d) { |
| 3003 |
return (8 + 15 * (d.visualDepth - 1)) + "px"; |
| 3004 |
}) |
| 3005 |
.on("click", toggleTreeNode) |
| 3006 |
.attr("class", function(d) { |
| 3007 |
d.canExpand = false; |
| 3008 |
if (d.sumChildren) { |
| 3009 |
d.sumChildren.forEach(function(c) { |
| 3010 |
if (c.sumChildren.length > 0) { |
| 3011 |
if (!vis.hideInternals || oneNode(c, function(c1) { return c1.depthCollapsed !== null; })) |
| 3012 |
d.canExpand = true; |
| 3013 |
} |
| 3014 |
}); |
| 3015 |
} |
| 3016 |
|
| 3017 |
var collapsedClass = ""; |
| 3018 |
if (d.canExpand) |
| 3019 |
collapsedClass = d.collapsed === undefined ? "treetable-expand" : d.collapsed ? "treetable-expand" : "treetable-collapse"; |
| 3020 |
|
| 3021 |
return "code-label " + (d.canExpand ? "label-pointer " + collapsedClass : ""); |
| 3022 |
}); |
| 3023 |
} |
| 3024 |
|
| 3025 |
function updateRows() { |
| 3026 |
var rows = tableBody.selectAll("tr.treetable-row") |
| 3027 |
.data(vis.profTable, function(d) { |
| 3028 |
return d.id; |
| 3029 |
}); |
| 3030 |
|
| 3031 |
rows.exit() |
| 3032 |
.remove(); |
| 3033 |
|
| 3034 |
var updatedRows = rows |
| 3035 |
.style("display", updateRowsDisplay); |
| 3036 |
|
| 3037 |
var updatedLabelCells = updatedRows.selectAll("td.code-label"); |
| 3038 |
updateLabelCells(updatedLabelCells); |
| 3039 |
|
| 3040 |
var newRows = rows.enter() |
| 3041 |
.append("tr") |
| 3042 |
.filter(function(d) { |
| 3043 |
if (vis.hideInternals && d.depthCollapsed === null) |
| 3044 |
return false; |
| 3045 |
|
| 3046 |
return true; |
| 3047 |
}) |
| 3048 |
.on("click", function(d) { |
| 3049 |
table.selectAll("tr") |
| 3050 |
.style("background-color", null); |
| 3051 |
|
| 3052 |
this.style.backgroundColor = "rgb(241, 241, 241)"; |
| 3053 |
notifySourceFileMessage(d, "select"); |
| 3054 |
}) |
| 3055 |
.style("display", updateRowsDisplay); |
| 3056 |
|
| 3057 |
newRows |
| 3058 |
.attr("class", "treetable-row"); |
| 3059 |
|
| 3060 |
var labelCell = newRows.append("td"); |
| 3061 |
updateLabelCells(labelCell); |
| 3062 |
|
| 3063 |
var cellWrapper = labelCell.append("div"); |
| 3064 |
cellWrapper.append("div"); |
| 3065 |
|
| 3066 |
labelCell.append("div") |
| 3067 |
.attr("class", "label-text") |
| 3068 |
.text(function(d) { return d.label; }); |
| 3069 |
|
| 3070 |
newRows.append("td") |
| 3071 |
.attr("class", "path") |
| 3072 |
.text(function(d) { |
| 3073 |
var lastSlash = d.filename ? d.filename.lastIndexOf("/") : -1; |
| 3074 |
if (lastSlash >= 0) |
| 3075 |
return d.filename.substr(lastSlash + 1); |
| 3076 |
|
| 3077 |
return d.filename; |
| 3078 |
}); |
| 3079 |
|
| 3080 |
newRows.append("td") |
| 3081 |
.attr("class", "treetable-memory memory-info") |
| 3082 |
.text(function(d) { |
| 3083 |
return roundOneDecimal(d.sumMemDealloc); |
| 3084 |
}); |
| 3085 |
|
| 3086 |
var memoryBarContainer = newRows.append("td") |
| 3087 |
.attr("class", "treetable-memory memory-bar-container"); |
| 3088 |
|
| 3089 |
var memoryLeftCell = memoryBarContainer.append("div") |
| 3090 |
.attr("class", "memory-leftbar-wrapper"); |
| 3091 |
|
| 3092 |
memoryLeftCell.append("div") |
| 3093 |
.attr("class", "memory-leftbar") |
| 3094 |
.style("width", function(d) { |
| 3095 |
return 1 + Math.min(Math.abs(Math.min(Math.round(d.propMemDealloc * 5), 0)), 5) + "px"; |
| 3096 |
}); |
| 3097 |
|
| 3098 |
memoryBarContainer.append("div") |
| 3099 |
.attr("class", "memory-rightbar") |
| 3100 |
.style("width", function(d) { |
| 3101 |
return 1 + Math.min(Math.max(Math.round(d.propMemAlloc * 13), 0), 13) + "px"; |
| 3102 |
}); |
| 3103 |
|
| 3104 |
newRows.append("td") |
| 3105 |
.attr("class", "treetable-memory memory-info-right") |
| 3106 |
.text(function(d) { |
| 3107 |
return roundOneDecimal(d.sumMemAlloc); |
| 3108 |
}); |
| 3109 |
|
| 3110 |
newRows.append("td") |
| 3111 |
.attr("class", "time-info") |
| 3112 |
.text(function(d) { |
| 3113 |
return d.sumTime; |
| 3114 |
}); |
| 3115 |
|
| 3116 |
var timeCell = newRows.append("td") |
| 3117 |
.attr("class", "time-bar-container"); |
| 3118 |
|
| 3119 |
timeCell.append("div") |
| 3120 |
.attr("class", "timebar") |
| 3121 |
.style("width", function(d) { |
| 3122 |
return Math.round(d.propTime * 20) + "px"; |
| 3123 |
}); |
| 3124 |
|
| 3125 |
var unorderedRows = d3.selectAll("tr.treetable-row") |
| 3126 |
.data(vis.profTable, function(d) { |
| 3127 |
return d.id; |
| 3128 |
}); |
| 3129 |
|
| 3130 |
unorderedRows.sort(function(a,b) { |
| 3131 |
return (a.id < b.id) ? -1 : (a.id == b.id ? 0 : 1); |
| 3132 |
}); |
| 3133 |
|
| 3134 |
useMemoryResults(); |
| 3135 |
} |
| 3136 |
|
| 3137 |
var buildProfTable = function (profTree) { |
| 3138 |
var head = jQuery.extend({}, profTree); |
| 3139 |
var nodes = [head]; |
| 3140 |
|
| 3141 |
var aggregateChildren = function(node) { |
| 3142 |
var nameMap = {}; |
| 3143 |
node.children.forEach(function(c) { |
| 3144 |
var nameMapEntry = nameMap[c.label]; |
| 3145 |
if (!nameMapEntry) { |
| 3146 |
nameMapEntry = jQuery.extend({}, c); |
| 3147 |
nameMapEntry.sumTime = c.endTime - c.startTime; |
| 3148 |
nameMapEntry.sumChildren = []; |
| 3149 |
nameMapEntry.children = []; |
| 3150 |
nameMapEntry.parent = node; |
| 3151 |
nameMapEntry.sumCount = 1; |
| 3152 |
} |
| 3153 |
else { |
| 3154 |
nameMapEntry.sumMem = nameMapEntry.sumMem + c.sumMem; |
| 3155 |
nameMapEntry.sumMemDealloc = nameMapEntry.sumMemDealloc + c.sumMemDealloc; |
| 3156 |
nameMapEntry.sumMemAlloc = nameMapEntry.sumMemAlloc + c.sumMemAlloc; |
| 3157 |
nameMapEntry.sumTime = nameMapEntry.sumTime + (c.endTime - c.startTime); |
| 3158 |
nameMapEntry.sumCount = nameMapEntry.sumCount + 1; |
| 3159 |
} |
| 3160 |
|
| 3161 |
nameMapEntry.propMem = nameMapEntry.sumMem / vis.totalMem; |
| 3162 |
nameMapEntry.propMemDealloc = nameMapEntry.sumMemDealloc / vis.totalMem; |
| 3163 |
nameMapEntry.propMemAlloc = nameMapEntry.sumMemAlloc / vis.totalMem; |
| 3164 |
nameMapEntry.propTime = nameMapEntry.sumTime / vis.totalTime; |
| 3165 |
|
| 3166 |
c.children.forEach(function(e) { |
| 3167 |
nameMapEntry.children.push(e); |
| 3168 |
}); |
| 3169 |
|
| 3170 |
nameMap[c.label] = nameMapEntry; |
| 3171 |
}); |
| 3172 |
|
| 3173 |
var childrenSum = []; |
| 3174 |
for (var label in nameMap) { |
| 3175 |
childrenSum.push(nameMap[label]); |
| 3176 |
} |
| 3177 |
|
| 3178 |
// Sort by time descending |
| 3179 |
childrenSum.sort(function(a, b) { return b.sumTime - a.sumTime }); |
| 3180 |
return childrenSum; |
| 3181 |
}; |
| 3182 |
|
| 3183 |
function addToNodesAt(c, i) { |
| 3184 |
nodes.splice(i, 0, c); |
| 3185 |
} |
| 3186 |
|
| 3187 |
var id = 0; |
| 3188 |
while (nodes.length > 0) { |
| 3189 |
var node = nodes.shift(); |
| 3190 |
|
| 3191 |
node.id = id; |
| 3192 |
id = id + 1; |
| 3193 |
|
| 3194 |
node.sumChildren = aggregateChildren(node); |
| 3195 |
|
| 3196 |
// Processing in order is important to preserve order of IDs! |
| 3197 |
node.sumChildren.forEach(addToNodesAt); |
| 3198 |
} |
| 3199 |
|
| 3200 |
return head.sumChildren; |
| 3201 |
}; |
| 3202 |
|
| 3203 |
function useMemoryResults() { |
| 3204 |
d3.selectAll(".treetable-memory").style("display", vis.hideMemory ? "none" : ""); |
| 3205 |
} |
| 3206 |
|
| 3207 |
vis.profTable = buildProfTable(vis.profTree); |
| 3208 |
vis.profTable.forEach(function(e) { |
| 3209 |
e.visualDepth = 1; |
| 3210 |
}); |
| 3211 |
|
| 3212 |
updateRows(); |
| 3213 |
|
| 3214 |
return { |
| 3215 |
el: el, |
| 3216 |
onResize: updateRows, |
| 3217 |
onOptionsChange: updateRows, |
| 3218 |
onUpdateInternals: function() { |
| 3219 |
|
| 3220 |
}, |
| 3221 |
useMemoryResults: useMemoryResults |
| 3222 |
}; |
| 3223 |
} |
| 3224 |
|
| 3225 |
function enableScroll() { |
| 3226 |
vis.codeTable.enableScroll(); |
| 3227 |
vis.flameGraph.enableZoom(); |
| 3228 |
} |
| 3229 |
|
| 3230 |
function disableScroll() { |
| 3231 |
vis.codeTable.disableScroll(); |
| 3232 |
vis.flameGraph.disableZoom(); |
| 3233 |
} |
| 3234 |
|
| 3235 |
|
| 3236 |
// Set up resizing -------------------------------------------------------- |
| 3237 |
|
| 3238 |
// This is used as a jQuery event namespace so that we can remove the window |
| 3239 |
// resize handler on subsequent calls to initResizing(). Not elegant, but it |
| 3240 |
// gets the job done. |
| 3241 |
var resizeCallbackNamespace = randomString(10); |
| 3242 |
|
| 3243 |
// Resize panel1 and panel2 to 50% of available space and add callback |
| 3244 |
// for window resizing. |
| 3245 |
function initResizing() { |
| 3246 |
var $el = $(vis.el); |
| 3247 |
var $panel1 = $el.children(".profvis-panel1"); |
| 3248 |
var $panel2 = $el.children(".profvis-panel2"); |
| 3249 |
var $splitBar = $el.children(".profvis-splitbar"); |
| 3250 |
var $statusBar = $el.children(".profvis-status-bar"); |
| 3251 |
|
| 3252 |
// Clear any existing positioning that may have happened from previous |
| 3253 |
// calls to this function and the callbacks that it sets up. |
| 3254 |
$panel1.removeAttr("style"); |
| 3255 |
$panel2.removeAttr("style"); |
| 3256 |
$splitBar.removeAttr("style"); |
| 3257 |
$statusBar.removeAttr("style"); |
| 3258 |
|
| 3259 |
// CSS class suffix for split direction |
| 3260 |
var splitClass = (vis.splitDir === "h") ? "horizontal" : "vertical"; |
| 3261 |
|
| 3262 |
// Remove existing horizontal/vertical class and add the correct class back. |
| 3263 |
$panel1.removeClass("profvis-panel1-horizontal profvis-panel1-vertical"); |
| 3264 |
$panel2.removeClass("profvis-panel2-horizontal profvis-panel2-vertical"); |
| 3265 |
$splitBar.removeClass("profvis-splitbar-horizontal profvis-splitbar-vertical"); |
| 3266 |
$panel1.addClass("profvis-panel1-" + splitClass); |
| 3267 |
$panel2.addClass("profvis-panel2-" + splitClass); |
| 3268 |
$splitBar.addClass("profvis-splitbar-" + splitClass); |
| 3269 |
|
| 3270 |
|
| 3271 |
var splitBarGap; |
| 3272 |
var margin; |
| 3273 |
// Record the proportions from the previous call to resizePanels. This is |
| 3274 |
// needed when we resize the window to preserve the same proportions. |
| 3275 |
var lastSplitProportion; |
| 3276 |
|
| 3277 |
if (vis.splitDir === "v") { |
| 3278 |
// Record the gap between the split bar and the objects to left and right |
| 3279 |
splitBarGap = { |
| 3280 |
left: $splitBar.offset().left - offsetRight($panel1), |
| 3281 |
right: $panel2.offset().left - offsetRight($splitBar) |
| 3282 |
}; |
| 3283 |
|
| 3284 |
// Capture the initial distance from the left and right of container element |
| 3285 |
margin = { |
| 3286 |
left: $panel1.position().left, |
| 3287 |
right: $el.innerWidth() - positionRight($panel2) |
| 3288 |
}; |
| 3289 |
|
| 3290 |
} else if (vis.splitDir === "h") { |
| 3291 |
splitBarGap = { |
| 3292 |
top: $splitBar.offset().top - offsetBottom($panel1), |
| 3293 |
bottom: $panel2.offset().top - offsetBottom($splitBar) |
| 3294 |
}; |
| 3295 |
|
| 3296 |
margin = { |
| 3297 |
top: $panel1.position().top, |
| 3298 |
bottom: $el.innerWidth() - positionBottom($panel2) |
| 3299 |
}; |
| 3300 |
} |
| 3301 |
|
| 3302 |
// Resize the panels. splitProportion is a number from 0-1 representing the |
| 3303 |
// horizontal position of the split bar. |
| 3304 |
function resizePanels(splitProportion) { |
| 3305 |
if (!splitProportion) |
| 3306 |
splitProportion = lastSplitProportion; |
| 3307 |
|
| 3308 |
if (vis.splitDir === "v") { |
| 3309 |
var innerWidth = offsetRight($panel2) - $panel1.offset().left; |
| 3310 |
|
| 3311 |
$splitBar.offset({ |
| 3312 |
left: $panel1.offset().left + innerWidth * splitProportion - |
| 3313 |
$splitBar.outerWidth()/2 |
| 3314 |
}); |
| 3315 |
|
| 3316 |
// Size and position the panels |
| 3317 |
$panel1.outerWidth($splitBar.position().left - splitBarGap.left - |
| 3318 |
margin.left); |
| 3319 |
$panel2.offset({ left: offsetRight($splitBar) + splitBarGap.right }); |
| 3320 |
|
| 3321 |
} else if (vis.splitDir === "h") { |
| 3322 |
var innerHeight = offsetBottom($panel2) - $panel1.offset().top; |
| 3323 |
|
| 3324 |
$splitBar.offset({ |
| 3325 |
top: $panel1.offset().top + innerHeight * splitProportion - |
| 3326 |
$splitBar.outerHeight()/2 |
| 3327 |
}); |
| 3328 |
|
| 3329 |
// Size and position the panels |
| 3330 |
$panel1.outerHeight($splitBar.position().top - splitBarGap.top - |
| 3331 |
margin.top); |
| 3332 |
$panel2.offset({ top: offsetBottom($splitBar) + splitBarGap.bottom }); |
| 3333 |
} |
| 3334 |
|
| 3335 |
lastSplitProportion = splitProportion; |
| 3336 |
} |
| 3337 |
|
| 3338 |
// Initially, set widths to 50/50 |
| 3339 |
// For the first sizing, we don't need to call vis.flameGraph.onResize() |
| 3340 |
// because this happens before the flame graph is generated. |
| 3341 |
resizePanels(0.5); |
| 3342 |
|
| 3343 |
var resizePanelsDebounced = debounce(function() { |
| 3344 |
resizePanels(lastSplitProportion); |
| 3345 |
vis.activeViews.forEach(function(e) { |
| 3346 |
if (e.onResize) e.onResize(); |
| 3347 |
}); |
| 3348 |
}, 250); |
| 3349 |
|
| 3350 |
// Clear old resize handler and add new one. We use a namespace for this |
| 3351 |
// visualization to make sure not to delete handlers for other profvis |
| 3352 |
// visualizations on the same page (this can happen with Rmd documents). |
| 3353 |
$(window).off("resize.profvis." + resizeCallbackNamespace); |
| 3354 |
$(window).on("resize.profvis." + resizeCallbackNamespace, resizePanelsDebounced); |
| 3355 |
|
| 3356 |
// Get current proportional position of split bar |
| 3357 |
function splitProportion() { |
| 3358 |
var splitCenter; |
| 3359 |
|
| 3360 |
if (vis.splitDir === "v") { |
| 3361 |
splitCenter = $splitBar.offset().left - $panel1.offset().left + |
| 3362 |
$splitBar.outerWidth()/2; |
| 3363 |
var innerWidth = offsetRight($panel2) - $panel1.offset().left; |
| 3364 |
return splitCenter / innerWidth; |
| 3365 |
|
| 3366 |
} else if (vis.splitDir === "h") { |
| 3367 |
splitCenter = $splitBar.offset().top - $panel1.offset().top + |
| 3368 |
$splitBar.outerHeight()/2; |
| 3369 |
var innerHeight = offsetBottom($panel2) - $panel1.offset().top; |
| 3370 |
return splitCenter / innerHeight; |
| 3371 |
} |
| 3372 |
} |
| 3373 |
|
| 3374 |
function positionRight($el) { |
| 3375 |
return $el.position().left + $el.outerWidth(); |
| 3376 |
} |
| 3377 |
function offsetRight($el) { |
| 3378 |
return $el.offset().left + $el.outerWidth(); |
| 3379 |
} |
| 3380 |
function positionBottom($el) { |
| 3381 |
return $el.position().top + $el.outerHeight(); |
| 3382 |
} |
| 3383 |
function offsetBottom($el) { |
| 3384 |
return $el.offset().top + $el.outerHeight(); |
| 3385 |
} |
| 3386 |
|
| 3387 |
// Enable dragging of the split bar --------------------------------------- |
| 3388 |
(function() { |
| 3389 |
var dragging = false; |
| 3390 |
// For vertical split (left-right dragging) |
| 3391 |
var startDragX; |
| 3392 |
var startOffsetLeft; |
| 3393 |
// For horizontal split (up-down dragging) |
| 3394 |
var startDragY; |
| 3395 |
var startOffsetTop; |
| 3396 |
|
| 3397 |
var stopDrag = function(e) { |
| 3398 |
if (!dragging) return; |
| 3399 |
dragging = false; |
| 3400 |
|
| 3401 |
document.removeEventListener("mousemove", drag); |
| 3402 |
document.removeEventListener("mouseup", stopDrag); |
| 3403 |
|
| 3404 |
$splitBar.css("opacity", ""); |
| 3405 |
|
| 3406 |
if ((vis.splitDir === "v" && e.pageX - startDragX === 0) || |
| 3407 |
(vis.splitDir === "h" && e.pageY - startDragY === 0)) { |
| 3408 |
return; |
| 3409 |
} |
| 3410 |
|
| 3411 |
resizePanels(splitProportion()); |
| 3412 |
vis.flameGraph.onResize(); |
| 3413 |
}; |
| 3414 |
|
| 3415 |
var startDrag = function(e) { |
| 3416 |
// Don't start another drag if we're already in one. |
| 3417 |
if (dragging) return; |
| 3418 |
dragging = true; |
| 3419 |
pauseEvent(e); |
| 3420 |
|
| 3421 |
$splitBar.css("opacity", 0.75); |
| 3422 |
|
| 3423 |
if (vis.splitDir === "v") { |
| 3424 |
startDragX = e.pageX; |
| 3425 |
startOffsetLeft = $splitBar.offset().left; |
| 3426 |
} else { |
| 3427 |
startDragY = e.pageY; |
| 3428 |
startOffsetTop = $splitBar.offset().top; |
| 3429 |
} |
| 3430 |
|
| 3431 |
document.addEventListener("mousemove", drag); |
| 3432 |
document.addEventListener("mouseup", stopDrag); |
| 3433 |
}; |
| 3434 |
|
| 3435 |
var drag = function(e) { |
| 3436 |
if (!dragging) return; |
| 3437 |
pauseEvent(e); |
| 3438 |
|
| 3439 |
if (vis.splitDir === "v") { |
| 3440 |
var dx = e.pageX - startDragX; |
| 3441 |
if (dx === 0) |
| 3442 |
return; |
| 3443 |
|
| 3444 |
// Move the split bar |
| 3445 |
$splitBar.offset({ left: startOffsetLeft + dx }); |
| 3446 |
|
| 3447 |
} else if (vis.splitDir === "h") { |
| 3448 |
var dy = e.pageY - startDragY; |
| 3449 |
if (dy === 0) |
| 3450 |
return; |
| 3451 |
|
| 3452 |
// Move the split bar |
| 3453 |
$splitBar.offset({ top: startOffsetTop + dy }); |
| 3454 |
} |
| 3455 |
}; |
| 3456 |
|
| 3457 |
// Stop propogation so that we don't select text while dragging |
| 3458 |
function pauseEvent(e){ |
| 3459 |
if(e.stopPropagation) e.stopPropagation(); |
| 3460 |
if(e.preventDefault) e.preventDefault(); |
| 3461 |
e.cancelBubble = true; |
| 3462 |
e.returnValue = false; |
| 3463 |
return false; |
| 3464 |
} |
| 3465 |
|
| 3466 |
// Remove existing event listener from previous calls to initResizing(). |
| 3467 |
$splitBar.off("mousedown.profvis"); |
| 3468 |
$splitBar.on("mousedown.profvis", startDrag); |
| 3469 |
})(); |
| 3470 |
|
| 3471 |
|
| 3472 |
return { |
| 3473 |
resizePanels: resizePanels |
| 3474 |
}; |
| 3475 |
} |
| 3476 |
|
| 3477 |
|
| 3478 |
var prof = prepareProfData(message.prof, message.interval); |
| 3479 |
|
| 3480 |
var vis = { |
| 3481 |
el: el, |
| 3482 |
prof: prof, |
| 3483 |
profTree: getProfTree(prof), |
| 3484 |
interval: message.interval, |
| 3485 |
totalTime: getTotalTime(prof), |
| 3486 |
totalMem: getTotalMemory(prof), |
| 3487 |
files: message.files, |
| 3488 |
aggLabelTimes: getAggregatedLabelTimes(prof), |
| 3489 |
fileLineStats: getFileLineStats(prof, message.files), |
| 3490 |
profTable: [], |
| 3491 |
|
| 3492 |
// Objects representing each component |
| 3493 |
statusBar: null, |
| 3494 |
optionsPanel: null, |
| 3495 |
codeTable: null, |
| 3496 |
flameGraph: null, |
| 3497 |
infoBox: null, |
| 3498 |
treetable: null, |
| 3499 |
activeViews: [], |
| 3500 |
|
| 3501 |
// Functions to enable/disable responding to scrollwheel events |
| 3502 |
enableScroll: enableScroll, |
| 3503 |
disableScroll: disableScroll, |
| 3504 |
|
| 3505 |
splitDir: message.split, |
| 3506 |
hideInternals: true, |
| 3507 |
hideMemory: false, |
| 3508 |
|
| 3509 |
resizePanels: null |
| 3510 |
}; |
| 3511 |
|
| 3512 |
|
| 3513 |
// Render the objects --------------------------------------------- |
| 3514 |
|
| 3515 |
var statusBarEl = document.createElement("div"); |
| 3516 |
statusBarEl.className = "profvis-status-bar"; |
| 3517 |
vis.el.appendChild(statusBarEl); |
| 3518 |
|
| 3519 |
// Container panels - top/bottom or left/right |
| 3520 |
var panel1 = document.createElement("div"); |
| 3521 |
panel1.className = "profvis-panel1"; |
| 3522 |
vis.el.appendChild(panel1); |
| 3523 |
|
| 3524 |
var panel2 = document.createElement("div"); |
| 3525 |
panel2.className = "profvis-panel2"; |
| 3526 |
vis.el.appendChild(panel2); |
| 3527 |
|
| 3528 |
var splitBarEl = document.createElement("div"); |
| 3529 |
splitBarEl.className = "profvis-splitbar"; |
| 3530 |
vis.el.appendChild(splitBarEl); |
| 3531 |
|
| 3532 |
var footerEl = document.createElement("div"); |
| 3533 |
footerEl.className = "profvis-footer"; |
| 3534 |
vis.el.appendChild(footerEl); |
| 3535 |
|
| 3536 |
// Items in the panels |
| 3537 |
var codeTableEl = document.createElement("div"); |
| 3538 |
codeTableEl.className = "profvis-code"; |
| 3539 |
panel1.appendChild(codeTableEl); |
| 3540 |
|
| 3541 |
var flameGraphEl = document.createElement("div"); |
| 3542 |
flameGraphEl.className = "profvis-flamegraph"; |
| 3543 |
panel2.appendChild(flameGraphEl); |
| 3544 |
|
| 3545 |
var infoBoxEl = document.createElement("div"); |
| 3546 |
infoBoxEl.className = "profvis-infobox"; |
| 3547 |
panel2.appendChild(infoBoxEl); |
| 3548 |
|
| 3549 |
var treetableEl = document.createElement("div"); |
| 3550 |
treetableEl.className = "profvis-treetable"; |
| 3551 |
treetableEl.style.display = "none"; |
| 3552 |
vis.el.appendChild(treetableEl); |
| 3553 |
|
| 3554 |
var optionsPanelEl = document.createElement("div"); |
| 3555 |
optionsPanelEl.className = "profvis-options-panel"; |
| 3556 |
vis.el.appendChild(optionsPanelEl); |
| 3557 |
|
| 3558 |
// Efficient to properly size panels before the code + flamegraph are |
| 3559 |
// rendered, so that we don't have to re-render. |
| 3560 |
var resize = initResizing(); |
| 3561 |
vis.resizePanels = resize.resizePanels; |
| 3562 |
|
| 3563 |
var hideViews = function() { |
| 3564 |
splitBarEl.style.display = "none"; |
| 3565 |
panel1.style.display = "none"; |
| 3566 |
panel2.style.display = "none"; |
| 3567 |
treetableEl.style.display = "none"; |
| 3568 |
}; |
| 3569 |
|
| 3570 |
var toggleViews = function(view) { |
| 3571 |
hideViews(); |
| 3572 |
|
| 3573 |
switch (view) { |
| 3574 |
case "flamegraph": |
| 3575 |
splitBarEl.style.display = "block"; |
| 3576 |
panel1.style.display = "block"; |
| 3577 |
panel2.style.display = "block"; |
| 3578 |
|
| 3579 |
vis.activeViews = [vis.flameGraph, vis.codeTable]; |
| 3580 |
vis.resizePanels(); |
| 3581 |
break; |
| 3582 |
case "treetable": |
| 3583 |
if (!vis.treetable) { |
| 3584 |
vis.treetable = generateTreetable(treetableEl); |
| 3585 |
} |
| 3586 |
|
| 3587 |
treetableEl.style.display = "block"; |
| 3588 |
|
| 3589 |
vis.activeViews = [vis.treetable]; |
| 3590 |
break; |
| 3591 |
} |
| 3592 |
|
| 3593 |
vis.activeViews.forEach(function(e) { |
| 3594 |
if (e.onResize) e.onResize(); |
| 3595 |
}); |
| 3596 |
}; |
| 3597 |
|
| 3598 |
var onOptionsChange = function(option, checked) { |
| 3599 |
switch (option) |
| 3600 |
{ |
| 3601 |
case "split": { |
| 3602 |
vis.splitDir = checked ? "h" : "v"; |
| 3603 |
// Check that flame graph is visible |
| 3604 |
if ($.inArray(vis.flameGraph, vis.activeViews) !== -1) { |
| 3605 |
initResizing(); |
| 3606 |
vis.flameGraph.onResize(); |
| 3607 |
} |
| 3608 |
break; |
| 3609 |
} |
| 3610 |
case "internals": { |
| 3611 |
vis.flameGraph.savePrevScales(); |
| 3612 |
|
| 3613 |
vis.hideInternals = checked; |
| 3614 |
if (checked) { |
| 3615 |
vis.flameGraph.useCollapsedDepth(); |
| 3616 |
vis.flameGraph.redrawCollapse(400, 400); |
| 3617 |
} else { |
| 3618 |
vis.flameGraph.useUncollapsedDepth(); |
| 3619 |
vis.flameGraph.redrawUncollapse(400, 250); |
| 3620 |
} |
| 3621 |
|
| 3622 |
vis.activeViews.forEach(function(e) { |
| 3623 |
if (e.onOptionsChange) e.onOptionsChange(); |
| 3624 |
}); |
| 3625 |
|
| 3626 |
break; |
| 3627 |
} |
| 3628 |
case "memory": { |
| 3629 |
vis.hideMemory = checked; |
| 3630 |
vis.activeViews.forEach(function(e) { |
| 3631 |
if (e.useMemoryResults) e.useMemoryResults(); |
| 3632 |
}); |
| 3633 |
break; |
| 3634 |
} |
| 3635 |
} |
| 3636 |
}; |
| 3637 |
|
| 3638 |
// Create the UI components |
| 3639 |
vis.statusBar = generateStatusBar(statusBarEl, toggleViews); |
| 3640 |
vis.footer = generateFooter(footerEl); |
| 3641 |
vis.optionsPanel = generateOptionsPanel(optionsPanelEl, onOptionsChange); |
| 3642 |
vis.codeTable = generateCodeTable(codeTableEl); |
| 3643 |
vis.flameGraph = generateFlameGraph(flameGraphEl); |
| 3644 |
vis.infoBox = initInfoBox(infoBoxEl); |
| 3645 |
vis.treetable = null; |
| 3646 |
vis.activeViews = [vis.flameGraph, vis.codeTable]; |
| 3647 |
|
| 3648 |
// If any depth collapsing occured, enable the "hide internal" checkbox. |
| 3649 |
if (prof.some(function(d) { return d.depth !== d.depthCollapsed; })) { |
| 3650 |
vis.optionsPanel.enableHideInternal(); |
| 3651 |
} |
| 3652 |
|
| 3653 |
// Start with scrolling disabled because of mousewheel scrolling issue |
| 3654 |
disableScroll(); |
| 3655 |
|
| 3656 |
// Make the vis object accessible via the DOM element |
| 3657 |
$(el).data("profvis", vis); |
| 3658 |
|
| 3659 |
return vis; |
| 3660 |
}; // profvis.render() |
| 3661 |
|
| 3662 |
// Calculate amount of time spent on each line of code. Returns nested objects |
| 3663 |
// grouped by file, and then by line number. |
| 3664 |
function getFileLineStats(prof, files) { |
| 3665 |
// Drop entries with null or "" filename |
| 3666 |
prof = prof.filter(function(row) { |
| 3667 |
return row.filename !== null && row.filename !== ""; |
| 3668 |
}); |
| 3669 |
|
| 3670 |
// Gather line-by-line file contents |
| 3671 |
var fileLineStats = files.map(function(file) { |
| 3672 |
// Create array of objects with info for each line of code. |
| 3673 |
var lines = file.content.split("\n"); |
| 3674 |
var lineData = []; |
| 3675 |
var filename = file.filename; |
| 3676 |
var normpath = file.normpath; |
| 3677 |
for (var i=0; i<lines.length; i++) { |
| 3678 |
lineData[i] = { |
| 3679 |
filename: filename, |
| 3680 |
normpath: normpath, |
| 3681 |
linenum: i + 1, |
| 3682 |
content: lines[i], |
| 3683 |
sumTime: 0, |
| 3684 |
sumMem: 0, |
| 3685 |
sumMemAlloc: 0, |
| 3686 |
sumMemDealloc: 0 |
| 3687 |
}; |
| 3688 |
} |
| 3689 |
|
| 3690 |
return { |
| 3691 |
filename: filename, |
| 3692 |
lineData: lineData |
| 3693 |
}; |
| 3694 |
}); |
| 3695 |
|
| 3696 |
// Get timing data for each line |
| 3697 |
var statsData = d3.nest() |
| 3698 |
.key(function(d) { return d.filename; }) |
| 3699 |
.key(function(d) { return d.linenum; }) |
| 3700 |
.rollup(function(leaves) { |
| 3701 |
var sumTime = leaves.reduce(function(sum, d) { |
| 3702 |
// Add this node's time only if no ancestor node has the same |
| 3703 |
// filename and linenum. This is to avoid double-counting times for |
| 3704 |
// a line. |
| 3705 |
var incTime = 0; |
| 3706 |
if (!ancestorHasFilenameLinenum(d.filename, d.linenum, d.parent)) { |
| 3707 |
incTime = d.endTime - d.startTime; |
| 3708 |
} |
| 3709 |
return sum + incTime; |
| 3710 |
}, 0); |
| 3711 |
|
| 3712 |
var sumMem = leaves.reduce(function(sum, d) { |
| 3713 |
return sum + d.sumMem; |
| 3714 |
}, 0); |
| 3715 |
|
| 3716 |
var sumMemDealloc = leaves.reduce(function(sum, d) { |
| 3717 |
return sum + d.sumMemDealloc; |
| 3718 |
}, 0); |
| 3719 |
|
| 3720 |
var sumMemAlloc = leaves.reduce(function(sum, d) { |
| 3721 |
return sum + d.sumMemAlloc; |
| 3722 |
}, 0); |
| 3723 |
|
| 3724 |
return { |
| 3725 |
filename: leaves[0].filename, |
| 3726 |
linenum: leaves[0].linenum, |
| 3727 |
sumTime: sumTime, |
| 3728 |
sumMem: sumMem, |
| 3729 |
sumMemAlloc: sumMemAlloc, |
| 3730 |
sumMemDealloc: sumMemDealloc |
| 3731 |
}; |
| 3732 |
}) |
| 3733 |
.entries(prof); |
| 3734 |
|
| 3735 |
// Insert the sumTimes into line content data |
| 3736 |
statsData.forEach(function(fileInfo) { |
| 3737 |
// Find item in fileTimes that matches the file of this fileInfo object |
| 3738 |
var fileLineData = fileLineStats.filter(function(d) { |
| 3739 |
return d.filename === fileInfo.key; |
| 3740 |
})[0].lineData; |
| 3741 |
|
| 3742 |
fileInfo.values.forEach(function(lineInfo) { |
| 3743 |
lineInfo = lineInfo.values; |
| 3744 |
fileLineData[lineInfo.linenum - 1].sumTime = lineInfo.sumTime; |
| 3745 |
fileLineData[lineInfo.linenum - 1].sumMem = lineInfo.sumMem; |
| 3746 |
fileLineData[lineInfo.linenum - 1].sumMemDealloc = lineInfo.sumMemDealloc; |
| 3747 |
fileLineData[lineInfo.linenum - 1].sumMemAlloc = lineInfo.sumMemAlloc; |
| 3748 |
}); |
| 3749 |
}); |
| 3750 |
|
| 3751 |
// Calculate proportional times, relative to the longest time in the data |
| 3752 |
// set. Modifies data in place. |
| 3753 |
var fileMaxTimes = fileLineStats.map(function(lines) { |
| 3754 |
var lineTimes = lines.lineData.map(function(x) { return x.sumTime; }); |
| 3755 |
return d3.max(lineTimes); |
| 3756 |
}); |
| 3757 |
|
| 3758 |
var maxTime = d3.max(fileMaxTimes); |
| 3759 |
|
| 3760 |
fileLineStats.map(function(lines) { |
| 3761 |
lines.lineData.map(function(line) { |
| 3762 |
line.propTime = line.sumTime / maxTime; |
| 3763 |
}); |
| 3764 |
}); |
| 3765 |
|
| 3766 |
var totalMem = getTotalMemory(prof); |
| 3767 |
|
| 3768 |
fileLineStats.map(function(lines) { |
| 3769 |
lines.lineData.map(function(line) { |
| 3770 |
line.propMem = line.sumMem / totalMem; |
| 3771 |
line.propMemDealloc = line.sumMemDealloc / totalMem; |
| 3772 |
line.propMemAlloc = line.sumMemAlloc / totalMem; |
| 3773 |
}); |
| 3774 |
}); |
| 3775 |
|
| 3776 |
return fileLineStats; |
| 3777 |
|
| 3778 |
// Returns true if the given node or one of its ancestors has the given |
| 3779 |
// filename and linenum; false otherwise. |
| 3780 |
function ancestorHasFilenameLinenum(filename, linenum, node) { |
| 3781 |
if (!node) { |
| 3782 |
return false; |
| 3783 |
} |
| 3784 |
if (node.filename === filename && node.linenum === linenum) { |
| 3785 |
return true; |
| 3786 |
} |
| 3787 |
return ancestorHasFilenameLinenum(filename, linenum, node.parent); |
| 3788 |
} |
| 3789 |
} |
| 3790 |
|
| 3791 |
function prepareProfData(prof, interval) { |
| 3792 |
// Convert object-with-arrays format prof data to array-of-objects format |
| 3793 |
var data = colToRows(prof); |
| 3794 |
data = addParentChildLinks(data); |
| 3795 |
data = consolidateRuns(data); |
| 3796 |
data = applyInterval(data, interval); |
| 3797 |
data = findCollapsedDepths(data); |
| 3798 |
|
| 3799 |
return data; |
| 3800 |
} |
| 3801 |
|
| 3802 |
// Given the raw profiling data, convert `time` and `lastTime` fields to |
| 3803 |
// `startTime` and `endTime`, and use the supplied interval. Modifies data |
| 3804 |
// in place. |
| 3805 |
function applyInterval(prof, interval) { |
| 3806 |
prof.forEach(function(d) { |
| 3807 |
d.startTime = interval * (d.time - 1); |
| 3808 |
d.endTime = interval * (d.lastTime); |
| 3809 |
delete d.time; |
| 3810 |
delete d.lastTime; |
| 3811 |
}); |
| 3812 |
|
| 3813 |
return prof; |
| 3814 |
} |
| 3815 |
|
| 3816 |
// Find the total time spanned in the data |
| 3817 |
function getTotalTime(prof) { |
| 3818 |
return d3.max(prof, function(d) { return d.endTime; }) - |
| 3819 |
d3.min(prof, function(d) { return d.startTime; }); |
| 3820 |
} |
| 3821 |
|
| 3822 |
// Find the total memory spanned in the data |
| 3823 |
function getTotalMemory(prof) { |
| 3824 |
return d3.max(prof, function(d) { return d.memalloc; }); |
| 3825 |
} |
| 3826 |
|
| 3827 |
// Calculate the total amount of time spent in each function label |
| 3828 |
function getAggregatedLabelTimes(prof) { |
| 3829 |
var labelTimes = {}; |
| 3830 |
var tree = getProfTree(prof); |
| 3831 |
calcLabelTimes(tree); |
| 3832 |
|
| 3833 |
return labelTimes; |
| 3834 |
|
| 3835 |
// Traverse the tree with the following strategy: |
| 3836 |
// * Check if current label is used in an ancestor. |
| 3837 |
// * If yes, don't add to times for that label. |
| 3838 |
// * If no, do add to times for that label. |
| 3839 |
// * Recurse into children. |
| 3840 |
function calcLabelTimes(node) { |
| 3841 |
var label = node.label; |
| 3842 |
if (!ancestorHasLabel(label, node.parent)) { |
| 3843 |
if (labelTimes[label] === undefined) |
| 3844 |
labelTimes[label] = 0; |
| 3845 |
|
| 3846 |
labelTimes[label] += node.endTime - node.startTime; |
| 3847 |
} |
| 3848 |
|
| 3849 |
node.children.forEach(calcLabelTimes); |
| 3850 |
} |
| 3851 |
|
| 3852 |
// Returns true if the given node or one of its ancestors has the given |
| 3853 |
// label; false otherwise. |
| 3854 |
function ancestorHasLabel(label, node) { |
| 3855 |
if (node) { |
| 3856 |
if (node.label === label) { |
| 3857 |
return true; |
| 3858 |
} |
| 3859 |
return ancestorHasLabel(label, node.parent); |
| 3860 |
} else { |
| 3861 |
return false; |
| 3862 |
} |
| 3863 |
} |
| 3864 |
} |
| 3865 |
|
| 3866 |
|
| 3867 |
// Given profiling data, add parent and child links to indicate stack |
| 3868 |
// relationships. |
| 3869 |
function addParentChildLinks(prof) { |
| 3870 |
var data = d3.nest() |
| 3871 |
.key(function(d) { return d.time; }) |
| 3872 |
.rollup(function(leaves) { |
| 3873 |
leaves = leaves.sort(function(a, b) { return a.depth - b.depth; }); |
| 3874 |
|
| 3875 |
leaves[0].parent = null; |
| 3876 |
leaves[0].children = []; |
| 3877 |
|
| 3878 |
for (var i=1; i<leaves.length; i++) { |
| 3879 |
leaves[i-1].children.push(leaves[i]); |
| 3880 |
leaves[i].parent = leaves[i-1]; |
| 3881 |
leaves[i].children = []; |
| 3882 |
} |
| 3883 |
|
| 3884 |
return leaves; |
| 3885 |
}) |
| 3886 |
.map(prof); |
| 3887 |
|
| 3888 |
// Convert data from object of arrays to array of arrays |
| 3889 |
data = d3.map(data).values(); |
| 3890 |
// Flatten data |
| 3891 |
return d3.merge(data); |
| 3892 |
} |
| 3893 |
|
| 3894 |
|
| 3895 |
// Given profiling data, consolidate consecutive blocks for a flamegraph. |
| 3896 |
// This function also assigns correct parent-child relationships to form a |
| 3897 |
// tree of data objects, with a hidden root node at depth 0. |
| 3898 |
function consolidateRuns(prof) { |
| 3899 |
// Create a special top-level leaf whose only purpose is to point to its |
| 3900 |
// children, the items at depth 1. |
| 3901 |
var topLeaf = { |
| 3902 |
depth: 0, |
| 3903 |
parent: null, |
| 3904 |
children: prof.filter(function(d) { return d.depth === 1; }) |
| 3905 |
}; |
| 3906 |
|
| 3907 |
var tree = consolidateTree(topLeaf); |
| 3908 |
var data = treeToArray(tree); |
| 3909 |
// Remove the root node from the flattened data |
| 3910 |
data = data.filter(function(d) { return d.depth !== 0; }); |
| 3911 |
return data; |
| 3912 |
|
| 3913 |
function consolidateTree(tree) { |
| 3914 |
var leaves = tree.children; |
| 3915 |
leaves = leaves.sort(function(a, b) { return a.time - b.time; }); |
| 3916 |
|
| 3917 |
// Collapse consecutive leaves, with some conditions |
| 3918 |
var startLeaf = null; // leaf starting this run |
| 3919 |
var lastLeaf = null; // The last leaf we've looked at |
| 3920 |
var newLeaves = []; |
| 3921 |
var collectedChildren = []; |
| 3922 |
var sumMem = 0; |
| 3923 |
var sumMemDealloc = 0; |
| 3924 |
var sumMemAlloc = 0; |
| 3925 |
|
| 3926 |
// This takes the start leaf, end leaf, and the set of children for the |
| 3927 |
// new leaf, and creates a new leaf which copies all its properties from |
| 3928 |
// the startLeaf, except lastTime and children. |
| 3929 |
function addNewLeaf(startLeaf, endLeaf, newLeafChildren, sumMem, sumMemDealloc, sumMemAlloc) { |
| 3930 |
var newLeaf = $.extend({}, startLeaf); |
| 3931 |
newLeaf.lastTime = endLeaf.time; |
| 3932 |
newLeaf.parent = tree; |
| 3933 |
newLeaf.children = newLeafChildren; |
| 3934 |
|
| 3935 |
// Recurse into children |
| 3936 |
newLeaf = consolidateTree(newLeaf); |
| 3937 |
|
| 3938 |
// Aggregate memory from this consolidation batch and their children |
| 3939 |
aggregateMemory(newLeaf, sumMem, sumMemDealloc, sumMemAlloc); |
| 3940 |
|
| 3941 |
newLeaves.push(newLeaf); |
| 3942 |
} |
| 3943 |
|
| 3944 |
function aggregateMemory(leaf, sumMem, sumMemDealloc, sumMemAlloc) { |
| 3945 |
leaf.sumMem = sumMem; |
| 3946 |
leaf.sumMemDealloc = sumMemDealloc; |
| 3947 |
leaf.sumMemAlloc = sumMemAlloc; |
| 3948 |
if (leaf.children) { |
| 3949 |
leaf.children.forEach(function(child) { |
| 3950 |
leaf.sumMem += child.sumMem ? child.sumMem : 0; |
| 3951 |
leaf.sumMemDealloc += child.sumMemDealloc ? child.sumMemDealloc : 0; |
| 3952 |
leaf.sumMemAlloc += child.sumMemAlloc ? child.sumMemAlloc : 0; |
| 3953 |
}); |
| 3954 |
} |
| 3955 |
} |
| 3956 |
|
| 3957 |
for (var i=0; i<leaves.length; i++) { |
| 3958 |
var leaf = leaves[i]; |
| 3959 |
|
| 3960 |
if (i === 0) { |
| 3961 |
startLeaf = leaf; |
| 3962 |
sumMem = sumMemAlloc = sumMemDealloc = 0; |
| 3963 |
} else if (leaf.label !== startLeaf.label || |
| 3964 |
leaf.filename !== startLeaf.filename || |
| 3965 |
leaf.linenum !== startLeaf.linenum || |
| 3966 |
leaf.depth !== startLeaf.depth) |
| 3967 |
{ |
| 3968 |
addNewLeaf(startLeaf, lastLeaf, collectedChildren, sumMem, sumMemDealloc, sumMemAlloc); |
| 3969 |
|
| 3970 |
collectedChildren = []; |
| 3971 |
startLeaf = leaf; |
| 3972 |
sumMem = sumMemAlloc = sumMemDealloc = 0; |
| 3973 |
} |
| 3974 |
|
| 3975 |
sumMem += leaf.meminc; |
| 3976 |
sumMemDealloc += Math.min(leaf.meminc, 0); |
| 3977 |
sumMemAlloc += Math.max(leaf.meminc, 0); |
| 3978 |
collectedChildren = collectedChildren.concat(leaf.children); |
| 3979 |
lastLeaf = leaf; |
| 3980 |
} |
| 3981 |
|
| 3982 |
// Add the last one, if there were any at all |
| 3983 |
if (i !== 0) { |
| 3984 |
addNewLeaf(startLeaf, lastLeaf, collectedChildren, sumMem, sumMemDealloc, sumMemAlloc); |
| 3985 |
} |
| 3986 |
|
| 3987 |
tree.children = newLeaves; |
| 3988 |
return tree; |
| 3989 |
} |
| 3990 |
|
| 3991 |
// Given a tree, pull out all the leaves and put them in a flat array |
| 3992 |
function treeToArray(tree) { |
| 3993 |
var allLeaves = []; |
| 3994 |
|
| 3995 |
function pushLeaves(leaf) { |
| 3996 |
allLeaves.push(leaf); |
| 3997 |
leaf.children.forEach(pushLeaves); |
| 3998 |
} |
| 3999 |
|
| 4000 |
pushLeaves(tree); |
| 4001 |
return allLeaves; |
| 4002 |
} |
| 4003 |
} |
| 4004 |
|
| 4005 |
|
| 4006 |
// Given profiling data with parent-child information, get the root node. |
| 4007 |
function getProfTree(prof) { |
| 4008 |
if (prof.length === 0) |
| 4009 |
return null; |
| 4010 |
|
| 4011 |
// Climb up to the top of the tree |
| 4012 |
var node = prof[0]; |
| 4013 |
while (node.parent) { |
| 4014 |
node = node.parent; |
| 4015 |
} |
| 4016 |
return node; |
| 4017 |
} |
| 4018 |
|
| 4019 |
|
| 4020 |
// Given profiling data, find depth of items after hiding items between |
| 4021 |
// items with labels "..stacktraceoff.." and "..stacktraceon..". Modifies |
| 4022 |
// data in place. |
| 4023 |
function findCollapsedDepths(data) { |
| 4024 |
var tree = getProfTree(data); |
| 4025 |
calculateDepths(tree, tree.depth, 0); |
| 4026 |
return data; |
| 4027 |
|
| 4028 |
function calculateDepths(node, curCollapsedDepth, stacktraceOffCount) { |
| 4029 |
if (node.label === "..stacktraceoff..") { |
| 4030 |
stacktraceOffCount++; |
| 4031 |
} |
| 4032 |
|
| 4033 |
if (stacktraceOffCount > 0) { |
| 4034 |
node.depthCollapsed = null; |
| 4035 |
} else { |
| 4036 |
node.depthCollapsed = curCollapsedDepth; |
| 4037 |
curCollapsedDepth++; |
| 4038 |
} |
| 4039 |
|
| 4040 |
if (node.label === "..stacktraceon..") { |
| 4041 |
stacktraceOffCount--; |
| 4042 |
} |
| 4043 |
|
| 4044 |
// Recurse |
| 4045 |
node.children.forEach(function(x) { |
| 4046 |
calculateDepths(x, curCollapsedDepth, stacktraceOffCount); |
| 4047 |
}); |
| 4048 |
} |
| 4049 |
} |
| 4050 |
|
| 4051 |
|
| 4052 |
// Transform column-oriented data (an object with arrays) to row-oriented data |
| 4053 |
// (an array of objects). |
| 4054 |
function colToRows(x) { |
| 4055 |
var colnames = d3.keys(x); |
| 4056 |
if (colnames.length === 0) |
| 4057 |
return []; |
| 4058 |
|
| 4059 |
var newdata = []; |
| 4060 |
for (var i=0; i < x[colnames[0]].length; i++) { |
| 4061 |
var row = {}; |
| 4062 |
for (var j=0; j < colnames.length; j++) { |
| 4063 |
var colname = colnames[j]; |
| 4064 |
row[colname] = x[colname][i]; |
| 4065 |
} |
| 4066 |
newdata[i] = row; |
| 4067 |
} |
| 4068 |
|
| 4069 |
return newdata; |
| 4070 |
} |
| 4071 |
|
| 4072 |
// Given an array with two values (a min and max), return an array with the |
| 4073 |
// range expanded by `amount`. |
| 4074 |
function expandRange(range, amount) { |
| 4075 |
var adjust = amount * (range[1] - range[0]); |
| 4076 |
return [ |
| 4077 |
range[0] - adjust, |
| 4078 |
range[1] + adjust |
| 4079 |
]; |
| 4080 |
} |
| 4081 |
|
| 4082 |
|
| 4083 |
// Escape an HTML string. |
| 4084 |
function escapeHTML(text) { |
| 4085 |
return text |
| 4086 |
.replace(/&/g, "&") |
| 4087 |
.replace(/</g, "<") |
| 4088 |
.replace(/>/g, ">") |
| 4089 |
.replace(/"/g, """) |
| 4090 |
.replace(/'/g, "'"); |
| 4091 |
} |
| 4092 |
|
| 4093 |
// This returns the current page URL without any trailing hash. Should be |
| 4094 |
// used in url() references in SVGs to avoid problems when there's a <base> |
| 4095 |
// tag in the document. |
| 4096 |
function urlNoHash() { |
| 4097 |
return window.location.href.split("#")[0]; |
| 4098 |
} |
| 4099 |
|
| 4100 |
function debounce(f, delay) { |
| 4101 |
var timer = null; |
| 4102 |
return function() { |
| 4103 |
var context = this; |
| 4104 |
var args = arguments; |
| 4105 |
clearTimeout(timer); |
| 4106 |
timer = setTimeout(function () { |
| 4107 |
f.apply(context, args); |
| 4108 |
}, delay); |
| 4109 |
}; |
| 4110 |
} |
| 4111 |
|
| 4112 |
function randomString(length) { |
| 4113 |
var chars = 'abcdefghijklmnopqrstuvwxyz'; |
| 4114 |
var result = ''; |
| 4115 |
for (var i = length; i > 0; --i) |
| 4116 |
result += chars[Math.floor(Math.random() * chars.length)]; |
| 4117 |
return result; |
| 4118 |
} |
| 4119 |
|
| 4120 |
var getNormPath = function(files, filename) { |
| 4121 |
var normpath = null; |
| 4122 |
files.forEach(function(e) { |
| 4123 |
if (e.filename == filename) { |
| 4124 |
normpath = e.normpath; |
| 4125 |
} |
| 4126 |
}); |
| 4127 |
return normpath; |
| 4128 |
}; |
| 4129 |
|
| 4130 |
|
| 4131 |
(function() { |
| 4132 |
// Prevent unwanted scroll capturing. Based on the corresponding code in |
| 4133 |
// https://github.com/rstudio/leaflet |
| 4134 |
|
| 4135 |
// The rough idea is that we disable scroll wheel zooming inside each |
| 4136 |
// profvis object, until the user moves the mouse cursor or clicks on the |
| 4137 |
// visualization. This is trickier than just listening for mousemove, |
| 4138 |
// because mousemove is fired when the page is scrolled, even if the user |
| 4139 |
// did not physically move the mouse. We handle this by examining the |
| 4140 |
// mousemove event's screenX and screenY properties; if they change, we know |
| 4141 |
// it's a "true" move. |
| 4142 |
// |
| 4143 |
// There's a complication to this: when the mouse wheel is scrolled quickly, |
| 4144 |
// on the step where the profvis DOM object overlaps the cursor, sometimes |
| 4145 |
// the mousemove event happens before the mousewheel event, and sometimes |
| 4146 |
// it's the reverse (at least on Chrome 46 on Linux). This means that we |
| 4147 |
// can't rely on the mousemove handler disabling the profvis object's zoom |
| 4148 |
// before a scroll event is triggered on the profvis object (cauzing |
| 4149 |
// zooming). In order to deal with this, we start each profvis object with |
| 4150 |
// zooming disabled, and also disable zooming when the cursor leaves the |
| 4151 |
// profvis div. That way, even if a mousewheel event gets triggered on the |
| 4152 |
// object before the mousemove, it won't cause zooming. |
| 4153 |
|
| 4154 |
// lastScreen can never be null, but its x and y can. |
| 4155 |
var lastScreen = { x: null, y: null }; |
| 4156 |
|
| 4157 |
$(document) |
| 4158 |
.on("mousewheel DOMMouseScroll", function(e) { |
| 4159 |
// Any mousemove events at this screen position will be ignored. |
| 4160 |
lastScreen = { x: e.originalEvent.screenX, y: e.originalEvent.screenY }; |
| 4161 |
}) |
| 4162 |
.on("mousemove", ".profvis", function(e) { |
| 4163 |
// Did the mouse really move? |
| 4164 |
if (lastScreen.x !== null && e.screenX !== lastScreen.x || e.screenY !== lastScreen.y) { |
| 4165 |
$(this).data("profvis").flameGraph.enableZoom(); |
| 4166 |
lastScreen = { x: null, y: null }; |
| 4167 |
} |
| 4168 |
}) |
| 4169 |
.on("mousedown", ".profvis", function(e) { |
| 4170 |
// Clicking always enables zooming. |
| 4171 |
$(this).data("profvis").flameGraph.enableZoom(); |
| 4172 |
lastScreen = { x: null, y: null }; |
| 4173 |
}) |
| 4174 |
.on("mouseleave", ".profvis", function(e) { |
| 4175 |
$(this).data("profvis").flameGraph.disableZoom(); |
| 4176 |
}); |
| 4177 |
})(); |
| 4178 |
|
| 4179 |
return profvis; |
| 4180 |
})(); |
| 4181 |
</script> |
| 4182 |
<script>(function() { |
| 4183 |
|
| 4184 |
// Polyfill for scrollIntoViewIfNeeded() |
| 4185 |
// From https://gist.github.com/jocki84/6ffafd003387179a988e |
| 4186 |
// License: ISC |
| 4187 |
if (!Element.prototype.scrollIntoViewIfNeeded) { |
| 4188 |
Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) { |
| 4189 |
"use strict"; |
| 4190 |
|
| 4191 |
function makeRange(start, length) { |
| 4192 |
return {"start": start, "length": length, "end": start + length}; |
| 4193 |
} |
| 4194 |
|
| 4195 |
function coverRange(inner, outer) { |
| 4196 |
if ( |
| 4197 |
false === centerIfNeeded || |
| 4198 |
(outer.start < inner.end && inner.start < outer.end) |
| 4199 |
) { |
| 4200 |
return Math.max( |
| 4201 |
inner.end - outer.length, |
| 4202 |
Math.min(outer.start, inner.start) |
| 4203 |
); |
| 4204 |
} |
| 4205 |
return (inner.start + inner.end - outer.length) / 2; |
| 4206 |
} |
| 4207 |
|
| 4208 |
function makePoint(x, y) { |
| 4209 |
return { |
| 4210 |
"x": x, |
| 4211 |
"y": y, |
| 4212 |
"translate": function translate(dX, dY) { |
| 4213 |
return makePoint(x + dX, y + dY); |
| 4214 |
} |
| 4215 |
}; |
| 4216 |
} |
| 4217 |
|
| 4218 |
function absolute(elem, pt) { |
| 4219 |
while (elem) { |
| 4220 |
pt = pt.translate(elem.offsetLeft, elem.offsetTop); |
| 4221 |
elem = elem.offsetParent; |
| 4222 |
} |
| 4223 |
return pt; |
| 4224 |
} |
| 4225 |
|
| 4226 |
var target = absolute(this, makePoint(0, 0)), |
| 4227 |
extent = makePoint(this.offsetWidth, this.offsetHeight), |
| 4228 |
elem = this.parentNode, |
| 4229 |
origin; |
| 4230 |
|
| 4231 |
while (elem instanceof HTMLElement) { |
| 4232 |
// Apply desired scroll amount. |
| 4233 |
origin = absolute(elem, makePoint(elem.clientLeft, elem.clientTop)); |
| 4234 |
elem.scrollLeft = coverRange( |
| 4235 |
makeRange(target.x - origin.x, extent.x), |
| 4236 |
makeRange(elem.scrollLeft, elem.clientWidth) |
| 4237 |
); |
| 4238 |
elem.scrollTop = coverRange( |
| 4239 |
makeRange(target.y - origin.y, extent.y), |
| 4240 |
makeRange(elem.scrollTop, elem.clientHeight) |
| 4241 |
); |
| 4242 |
|
| 4243 |
// Determine actual scroll amount by reading back scroll properties. |
| 4244 |
target = target.translate(-elem.scrollLeft, -elem.scrollTop); |
| 4245 |
elem = elem.parentNode; |
| 4246 |
} |
| 4247 |
}; |
| 4248 |
} |
| 4249 |
|
| 4250 |
})()</script> |
| 4251 |
<style type="text/css">.profvis-code span.hljs-operator, |
| 4252 |
.profvis-code span.hljs-paren { |
| 4253 |
color: rgb(104, 118, 135) |
| 4254 |
} |
| 4255 |
.profvis-code span.hljs-literal { |
| 4256 |
color: rgb(88, 72, 246) |
| 4257 |
} |
| 4258 |
.profvis-code span.hljs-number { |
| 4259 |
color: rgb(0, 0, 205); |
| 4260 |
} |
| 4261 |
.profvis-code span.hljs-comment { |
| 4262 |
color: rgb(76, 136, 107); |
| 4263 |
} |
| 4264 |
.profvis-code span.hljs-keyword { |
| 4265 |
color: rgb(0, 0, 255); |
| 4266 |
} |
| 4267 |
.profvis-code span.hljs-identifier { |
| 4268 |
color: rgb(0, 0, 0); |
| 4269 |
} |
| 4270 |
.profvis-code span.hljs-string { |
| 4271 |
color: rgb(3, 106, 7); |
| 4272 |
} |
| 4273 |
</style> |
| 4274 |
<script>/*! |
| 4275 |
Highlight.js v11.10.0 (git: 366a8bd012) |
| 4276 |
(c) 2006-2024 Josh Goebel <[email protected]> and other contributors |
| 4277 |
License: BSD-3-Clause |
| 4278 |
*/ |
| 4279 |
var hljs=function(){"use strict";function e(t){ |
| 4280 |
return t instanceof Map?t.clear=t.delete=t.set=()=>{ |
| 4281 |
throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{ |
| 4282 |
throw Error("set is read-only") |
| 4283 |
}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{ |
| 4284 |
const i=t[n],s=typeof i;"object"!==s&&"function"!==s||Object.isFrozen(i)||e(i) |
| 4285 |
})),t}class t{constructor(e){ |
| 4286 |
void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} |
| 4287 |
ignoreMatch(){this.isMatchIgnored=!0}}function n(e){ |
| 4288 |
return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'") |
| 4289 |
}function i(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] |
| 4290 |
;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const s=e=>!!e.scope |
| 4291 |
;class o{constructor(e,t){ |
| 4292 |
this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ |
| 4293 |
this.buffer+=n(e)}openNode(e){if(!s(e))return;const t=((e,{prefix:t})=>{ |
| 4294 |
if(e.startsWith("language:"))return e.replace("language:","language-") |
| 4295 |
;if(e.includes(".")){const n=e.split(".") |
| 4296 |
;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") |
| 4297 |
}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)} |
| 4298 |
closeNode(e){s(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){ |
| 4299 |
this.buffer+=`<span class="${e}">`}}const r=(e={})=>{const t={children:[]} |
| 4300 |
;return Object.assign(t,e),t};class a{constructor(){ |
| 4301 |
this.rootNode=r(),this.stack=[this.rootNode]}get top(){ |
| 4302 |
return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ |
| 4303 |
this.top.children.push(e)}openNode(e){const t=r({scope:e}) |
| 4304 |
;this.add(t),this.stack.push(t)}closeNode(){ |
| 4305 |
if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ |
| 4306 |
for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} |
| 4307 |
walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ |
| 4308 |
return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), |
| 4309 |
t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ |
| 4310 |
"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ |
| 4311 |
a._collapse(e)})))}}class c extends a{constructor(e){super(),this.options=e} |
| 4312 |
addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){ |
| 4313 |
this.closeNode()}__addSublanguage(e,t){const n=e.root |
| 4314 |
;t&&(n.scope="language:"+t),this.add(n)}toHTML(){ |
| 4315 |
return new o(this,this.options).value()}finalize(){ |
| 4316 |
return this.closeAllNodes(),!0}}function l(e){ |
| 4317 |
return e?"string"==typeof e?e:e.source:null}function g(e){return h("(?=",e,")")} |
| 4318 |
function u(e){return h("(?:",e,")*")}function d(e){return h("(?:",e,")?")} |
| 4319 |
function h(...e){return e.map((e=>l(e))).join("")}function f(...e){const t=(e=>{ |
| 4320 |
const t=e[e.length-1] |
| 4321 |
;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} |
| 4322 |
})(e);return"("+(t.capture?"":"?:")+e.map((e=>l(e))).join("|")+")"} |
| 4323 |
function p(e){return RegExp(e.toString()+"|").exec("").length-1} |
| 4324 |
const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ |
| 4325 |
;function m(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n |
| 4326 |
;let i=l(e),s="";for(;i.length>0;){const e=b.exec(i);if(!e){s+=i;break} |
| 4327 |
s+=i.substring(0,e.index), |
| 4328 |
i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0], |
| 4329 |
"("===e[0]&&n++)}return s})).map((e=>`(${e})`)).join(t)} |
| 4330 |
const E="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",O={ |
| 4331 |
begin:"\\\\[\\s\\S]",relevance:0},v={scope:"string",begin:"'",end:"'", |
| 4332 |
illegal:"\\n",contains:[O]},k={scope:"string",begin:'"',end:'"',illegal:"\\n", |
| 4333 |
contains:[O]},N=(e,t,n={})=>{const s=i({scope:"comment",begin:e,end:t, |
| 4334 |
contains:[]},n);s.contains.push({scope:"doctag", |
| 4335 |
begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", |
| 4336 |
end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) |
| 4337 |
;const o=f("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) |
| 4338 |
;return s.contains.push({begin:h(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s |
| 4339 |
},S=N("//","$"),M=N("/\\*","\\*/"),R=N("#","$");var j=Object.freeze({ |
| 4340 |
__proto__:null,APOS_STRING_MODE:v,BACKSLASH_ESCAPE:O,BINARY_NUMBER_MODE:{ |
| 4341 |
scope:"number",begin:_,relevance:0},BINARY_NUMBER_RE:_,COMMENT:N, |
| 4342 |
C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:S,C_NUMBER_MODE:{scope:"number", |
| 4343 |
begin:y,relevance:0},C_NUMBER_RE:y,END_SAME_AS_BEGIN:e=>Object.assign(e,{ |
| 4344 |
"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ |
| 4345 |
t.data._beginMatch!==e[1]&&t.ignoreMatch()}}),HASH_COMMENT_MODE:R,IDENT_RE:E, |
| 4346 |
MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+x,relevance:0}, |
| 4347 |
NUMBER_MODE:{scope:"number",begin:w,relevance:0},NUMBER_RE:w, |
| 4348 |
PHRASAL_WORDS_MODE:{ |
| 4349 |
begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ |
| 4350 |
},QUOTE_STRING_MODE:k,REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/, |
| 4351 |
end:/\/[gimuy]*/,contains:[O,{begin:/\[/,end:/\]/,relevance:0,contains:[O]}]}, |
| 4352 |
RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", |
| 4353 |
SHEBANG:(e={})=>{const t=/^#![ ]*\// |
| 4354 |
;return e.binary&&(e.begin=h(t,/.*\b/,e.binary,/\b.*/)),i({scope:"meta",begin:t, |
| 4355 |
end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, |
| 4356 |
TITLE_MODE:{scope:"title",begin:E,relevance:0},UNDERSCORE_IDENT_RE:x, |
| 4357 |
UNDERSCORE_TITLE_MODE:{scope:"title",begin:x,relevance:0}});function A(e,t){ |
| 4358 |
"."===e.input[e.index-1]&&t.ignoreMatch()}function I(e,t){ |
| 4359 |
void 0!==e.className&&(e.scope=e.className,delete e.className)}function T(e,t){ |
| 4360 |
t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", |
| 4361 |
e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, |
| 4362 |
void 0===e.relevance&&(e.relevance=0))}function L(e,t){ |
| 4363 |
Array.isArray(e.illegal)&&(e.illegal=f(...e.illegal))}function B(e,t){ |
| 4364 |
if(e.match){ |
| 4365 |
if(e.begin||e.end)throw Error("begin & end are not supported with match") |
| 4366 |
;e.begin=e.match,delete e.match}}function P(e,t){ |
| 4367 |
void 0===e.relevance&&(e.relevance=1)}const D=(e,t)=>{if(!e.beforeMatch)return |
| 4368 |
;if(e.starts)throw Error("beforeMatch cannot be used with starts") |
| 4369 |
;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] |
| 4370 |
})),e.keywords=n.keywords,e.begin=h(n.beforeMatch,g(n.begin)),e.starts={ |
| 4371 |
relevance:0,contains:[Object.assign(n,{endsParent:!0})] |
| 4372 |
},e.relevance=0,delete n.beforeMatch |
| 4373 |
},H=["of","and","for","in","not","or","if","then","parent","list","value"],C="keyword" |
| 4374 |
;function $(e,t,n=C){const i=Object.create(null) |
| 4375 |
;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{ |
| 4376 |
Object.assign(i,$(e[n],t,n))})),i;function s(e,n){ |
| 4377 |
t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") |
| 4378 |
;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ |
| 4379 |
return t?Number(t):(e=>H.includes(e.toLowerCase()))(e)?0:1}const z={},W=e=>{ |
| 4380 |
console.error(e)},X=(e,...t)=>{console.log("WARN: "+e,...t)},G=(e,t)=>{ |
| 4381 |
z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) |
| 4382 |
},K=Error();function F(e,t,{key:n}){let i=0;const s=e[n],o={},r={} |
| 4383 |
;for(let e=1;e<=t.length;e++)r[e+i]=s[e],o[e+i]=!0,i+=p(t[e-1]) |
| 4384 |
;e[n]=r,e[n]._emit=o,e[n]._multi=!0}function Z(e){(e=>{ |
| 4385 |
e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, |
| 4386 |
delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ |
| 4387 |
_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope |
| 4388 |
}),(e=>{if(Array.isArray(e.begin)){ |
| 4389 |
if(e.skip||e.excludeBegin||e.returnBegin)throw W("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), |
| 4390 |
K |
| 4391 |
;if("object"!=typeof e.beginScope||null===e.beginScope)throw W("beginScope must be object"), |
| 4392 |
K;F(e,e.begin,{key:"beginScope"}),e.begin=m(e.begin,{joinWith:""})}})(e),(e=>{ |
| 4393 |
if(Array.isArray(e.end)){ |
| 4394 |
if(e.skip||e.excludeEnd||e.returnEnd)throw W("skip, excludeEnd, returnEnd not compatible with endScope: {}"), |
| 4395 |
K |
| 4396 |
;if("object"!=typeof e.endScope||null===e.endScope)throw W("endScope must be object"), |
| 4397 |
K;F(e,e.end,{key:"endScope"}),e.end=m(e.end,{joinWith:""})}})(e)}function V(e){ |
| 4398 |
function t(t,n){ |
| 4399 |
return RegExp(l(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) |
| 4400 |
}class n{constructor(){ |
| 4401 |
this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} |
| 4402 |
addRule(e,t){ |
| 4403 |
t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), |
| 4404 |
this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) |
| 4405 |
;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(m(e,{joinWith:"|" |
| 4406 |
}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex |
| 4407 |
;const t=this.matcherRe.exec(e);if(!t)return null |
| 4408 |
;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] |
| 4409 |
;return t.splice(0,n),Object.assign(t,i)}}class s{constructor(){ |
| 4410 |
this.rules=[],this.multiRegexes=[], |
| 4411 |
this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ |
| 4412 |
if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n |
| 4413 |
;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), |
| 4414 |
t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ |
| 4415 |
return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ |
| 4416 |
this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ |
| 4417 |
const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex |
| 4418 |
;let n=t.exec(e) |
| 4419 |
;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ |
| 4420 |
const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} |
| 4421 |
return n&&(this.regexIndex+=n.position+1, |
| 4422 |
this.regexIndex===this.count&&this.considerAll()),n}} |
| 4423 |
if(e.compilerExtensions||(e.compilerExtensions=[]), |
| 4424 |
e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") |
| 4425 |
;return e.classNameAliases=i(e.classNameAliases||{}),function n(o,r){const a=o |
| 4426 |
;if(o.isCompiled)return a |
| 4427 |
;[I,B,Z,D].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))), |
| 4428 |
o.__beforeBegin=null,[T,L,P].forEach((e=>e(o,r))),o.isCompiled=!0;let c=null |
| 4429 |
;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords), |
| 4430 |
c=o.keywords.$pattern, |
| 4431 |
delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=$(o.keywords,e.case_insensitive)), |
| 4432 |
a.keywordPatternRe=t(c,!0), |
| 4433 |
r&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/), |
| 4434 |
o.end&&(a.endRe=t(a.end)), |
| 4435 |
a.terminatorEnd=l(a.end)||"",o.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)), |
| 4436 |
o.illegal&&(a.illegalRe=t(o.illegal)), |
| 4437 |
o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>i(e,{ |
| 4438 |
variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?i(e,{ |
| 4439 |
starts:e.starts?i(e.starts):null |
| 4440 |
}):Object.isFrozen(e)?i(e):e))("self"===e?o:e)))),o.contains.forEach((e=>{n(e,a) |
| 4441 |
})),o.starts&&n(o.starts,r),a.matcher=(e=>{const t=new s |
| 4442 |
;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" |
| 4443 |
}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" |
| 4444 |
}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ |
| 4445 |
return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ |
| 4446 |
constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} |
| 4447 |
const Y=n,Q=i,ee=Symbol("nomatch"),te=n=>{ |
| 4448 |
const i=Object.create(null),s=Object.create(null),o=[];let r=!0 |
| 4449 |
;const a="Could not find the language '{}', did you forget to load/include a language module?",l={ |
| 4450 |
disableAutodetect:!0,name:"Plain text",contains:[]};let p={ |
| 4451 |
ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, |
| 4452 |
languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", |
| 4453 |
cssSelector:"pre code",languages:null,__emitter:c};function b(e){ |
| 4454 |
return p.noHighlightRe.test(e)}function m(e,t,n){let i="",s="" |
| 4455 |
;"object"==typeof t?(i=e, |
| 4456 |
n=t.ignoreIllegals,s=t.language):(G("10.7.0","highlight(lang, code, ...args) has been deprecated."), |
| 4457 |
G("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), |
| 4458 |
s=e,i=t),void 0===n&&(n=!0);const o={code:i,language:s};N("before:highlight",o) |
| 4459 |
;const r=o.result?o.result:E(o.language,o.code,n) |
| 4460 |
;return r.code=o.code,N("after:highlight",r),r}function E(e,n,s,o){ |
| 4461 |
const c=Object.create(null);function l(){if(!N.keywords)return void M.addText(R) |
| 4462 |
;let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(R),n="" |
| 4463 |
;for(;t;){n+=R.substring(e,t.index) |
| 4464 |
;const s=_.case_insensitive?t[0].toLowerCase():t[0],o=(i=s,N.keywords[i]);if(o){ |
| 4465 |
const[e,i]=o |
| 4466 |
;if(M.addText(n),n="",c[s]=(c[s]||0)+1,c[s]<=7&&(j+=i),e.startsWith("_"))n+=t[0];else{ |
| 4467 |
const n=_.classNameAliases[e]||e;u(t[0],n)}}else n+=t[0] |
| 4468 |
;e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(R)}var i |
| 4469 |
;n+=R.substring(e),M.addText(n)}function g(){null!=N.subLanguage?(()=>{ |
| 4470 |
if(""===R)return;let e=null;if("string"==typeof N.subLanguage){ |
| 4471 |
if(!i[N.subLanguage])return void M.addText(R) |
| 4472 |
;e=E(N.subLanguage,R,!0,S[N.subLanguage]),S[N.subLanguage]=e._top |
| 4473 |
}else e=x(R,N.subLanguage.length?N.subLanguage:null) |
| 4474 |
;N.relevance>0&&(j+=e.relevance),M.__addSublanguage(e._emitter,e.language) |
| 4475 |
})():l(),R=""}function u(e,t){ |
| 4476 |
""!==e&&(M.startScope(t),M.addText(e),M.endScope())}function d(e,t){let n=1 |
| 4477 |
;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue} |
| 4478 |
const i=_.classNameAliases[e[n]]||e[n],s=t[n];i?u(s,i):(R=s,l(),R=""),n++}} |
| 4479 |
function h(e,t){ |
| 4480 |
return e.scope&&"string"==typeof e.scope&&M.openNode(_.classNameAliases[e.scope]||e.scope), |
| 4481 |
e.beginScope&&(e.beginScope._wrap?(u(R,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), |
| 4482 |
R=""):e.beginScope._multi&&(d(e.beginScope,t),R="")),N=Object.create(e,{parent:{ |
| 4483 |
value:N}}),N}function f(e,n,i){let s=((e,t)=>{const n=e&&e.exec(t) |
| 4484 |
;return n&&0===n.index})(e.endRe,i);if(s){if(e["on:end"]){const i=new t(e) |
| 4485 |
;e["on:end"](n,i),i.isMatchIgnored&&(s=!1)}if(s){ |
| 4486 |
for(;e.endsParent&&e.parent;)e=e.parent;return e}} |
| 4487 |
if(e.endsWithParent)return f(e.parent,n,i)}function b(e){ |
| 4488 |
return 0===N.matcher.regexIndex?(R+=e[0],1):(T=!0,0)}function m(e){ |
| 4489 |
const t=e[0],i=n.substring(e.index),s=f(N,e,i);if(!s)return ee;const o=N |
| 4490 |
;N.endScope&&N.endScope._wrap?(g(), |
| 4491 |
u(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(g(), |
| 4492 |
d(N.endScope,e)):o.skip?R+=t:(o.returnEnd||o.excludeEnd||(R+=t), |
| 4493 |
g(),o.excludeEnd&&(R=t));do{ |
| 4494 |
N.scope&&M.closeNode(),N.skip||N.subLanguage||(j+=N.relevance),N=N.parent |
| 4495 |
}while(N!==s.parent);return s.starts&&h(s.starts,e),o.returnEnd?0:t.length} |
| 4496 |
let w={};function y(i,o){const a=o&&o[0];if(R+=i,null==a)return g(),0 |
| 4497 |
;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===a){ |
| 4498 |
if(R+=n.slice(o.index,o.index+1),!r){const t=Error(`0 width match regex (${e})`) |
| 4499 |
;throw t.languageName=e,t.badRule=w.rule,t}return 1} |
| 4500 |
if(w=o,"begin"===o.type)return(e=>{ |
| 4501 |
const n=e[0],i=e.rule,s=new t(i),o=[i.__beforeBegin,i["on:begin"]] |
| 4502 |
;for(const t of o)if(t&&(t(e,s),s.isMatchIgnored))return b(n) |
| 4503 |
;return i.skip?R+=n:(i.excludeBegin&&(R+=n), |
| 4504 |
g(),i.returnBegin||i.excludeBegin||(R=n)),h(i,e),i.returnBegin?0:n.length})(o) |
| 4505 |
;if("illegal"===o.type&&!s){ |
| 4506 |
const e=Error('Illegal lexeme "'+a+'" for mode "'+(N.scope||"<unnamed>")+'"') |
| 4507 |
;throw e.mode=N,e}if("end"===o.type){const e=m(o);if(e!==ee)return e} |
| 4508 |
if("illegal"===o.type&&""===a)return 1 |
| 4509 |
;if(I>1e5&&I>3*o.index)throw Error("potential infinite loop, way more iterations than matches") |
| 4510 |
;return R+=a,a.length}const _=O(e) |
| 4511 |
;if(!_)throw W(a.replace("{}",e)),Error('Unknown language: "'+e+'"') |
| 4512 |
;const v=V(_);let k="",N=o||v;const S={},M=new p.__emitter(p);(()=>{const e=[] |
| 4513 |
;for(let t=N;t!==_;t=t.parent)t.scope&&e.unshift(t.scope) |
| 4514 |
;e.forEach((e=>M.openNode(e)))})();let R="",j=0,A=0,I=0,T=!1;try{ |
| 4515 |
if(_.__emitTokens)_.__emitTokens(n,M);else{for(N.matcher.considerAll();;){ |
| 4516 |
I++,T?T=!1:N.matcher.considerAll(),N.matcher.lastIndex=A |
| 4517 |
;const e=N.matcher.exec(n);if(!e)break;const t=y(n.substring(A,e.index),e) |
| 4518 |
;A=e.index+t}y(n.substring(A))}return M.finalize(),k=M.toHTML(),{language:e, |
| 4519 |
value:k,relevance:j,illegal:!1,_emitter:M,_top:N}}catch(t){ |
| 4520 |
if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), |
| 4521 |
illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A, |
| 4522 |
context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:k},_emitter:M};if(r)return{ |
| 4523 |
language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:N} |
| 4524 |
;throw t}}function x(e,t){t=t||p.languages||Object.keys(i);const n=(e=>{ |
| 4525 |
const t={value:Y(e),illegal:!1,relevance:0,_top:l,_emitter:new p.__emitter(p)} |
| 4526 |
;return t._emitter.addText(e),t})(e),s=t.filter(O).filter(k).map((t=>E(t,e,!1))) |
| 4527 |
;s.unshift(n);const o=s.sort(((e,t)=>{ |
| 4528 |
if(e.relevance!==t.relevance)return t.relevance-e.relevance |
| 4529 |
;if(e.language&&t.language){if(O(e.language).supersetOf===t.language)return 1 |
| 4530 |
;if(O(t.language).supersetOf===e.language)return-1}return 0})),[r,a]=o,c=r |
| 4531 |
;return c.secondBest=a,c}function w(e){let t=null;const n=(e=>{ |
| 4532 |
let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" |
| 4533 |
;const n=p.languageDetectRe.exec(t);if(n){const t=O(n[1]) |
| 4534 |
;return t||(X(a.replace("{}",n[1])), |
| 4535 |
X("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} |
| 4536 |
return t.split(/\s+/).find((e=>b(e)||O(e)))})(e);if(b(n))return |
| 4537 |
;if(N("before:highlightElement",{el:e,language:n |
| 4538 |
}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) |
| 4539 |
;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), |
| 4540 |
console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), |
| 4541 |
console.warn("The element with unescaped HTML:"), |
| 4542 |
console.warn(e)),p.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) |
| 4543 |
;t=e;const i=t.textContent,o=n?m(i,{language:n,ignoreIllegals:!0}):x(i) |
| 4544 |
;e.innerHTML=o.value,e.dataset.highlighted="yes",((e,t,n)=>{const i=t&&s[t]||n |
| 4545 |
;e.classList.add("hljs"),e.classList.add("language-"+i) |
| 4546 |
})(e,n,o.language),e.result={language:o.language,re:o.relevance, |
| 4547 |
relevance:o.relevance},o.secondBest&&(e.secondBest={ |
| 4548 |
language:o.secondBest.language,relevance:o.secondBest.relevance |
| 4549 |
}),N("after:highlightElement",{el:e,result:o,text:i})}let y=!1;function _(){ |
| 4550 |
"loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(w):y=!0 |
| 4551 |
}function O(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]} |
| 4552 |
function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ |
| 4553 |
s[e.toLowerCase()]=t}))}function k(e){const t=O(e) |
| 4554 |
;return t&&!t.disableAutodetect}function N(e,t){const n=e;o.forEach((e=>{ |
| 4555 |
e[n]&&e[n](t)}))} |
| 4556 |
"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ |
| 4557 |
y&&_()}),!1),Object.assign(n,{highlight:m,highlightAuto:x,highlightAll:_, |
| 4558 |
highlightElement:w, |
| 4559 |
highlightBlock:e=>(G("10.7.0","highlightBlock will be removed entirely in v12.0"), |
| 4560 |
G("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{p=Q(p,e)}, |
| 4561 |
initHighlighting:()=>{ |
| 4562 |
_(),G("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, |
| 4563 |
initHighlightingOnLoad:()=>{ |
| 4564 |
_(),G("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") |
| 4565 |
},registerLanguage:(e,t)=>{let s=null;try{s=t(n)}catch(t){ |
| 4566 |
if(W("Language definition for '{}' could not be registered.".replace("{}",e)), |
| 4567 |
!r)throw t;W(t),s=l} |
| 4568 |
s.name||(s.name=e),i[e]=s,s.rawDefinition=t.bind(null,n),s.aliases&&v(s.aliases,{ |
| 4569 |
languageName:e})},unregisterLanguage:e=>{delete i[e] |
| 4570 |
;for(const t of Object.keys(s))s[t]===e&&delete s[t]}, |
| 4571 |
listLanguages:()=>Object.keys(i),getLanguage:O,registerAliases:v, |
| 4572 |
autoDetection:k,inherit:Q,addPlugin:e=>{(e=>{ |
| 4573 |
e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ |
| 4574 |
e["before:highlightBlock"](Object.assign({block:t.el},t)) |
| 4575 |
}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ |
| 4576 |
e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),o.push(e)}, |
| 4577 |
removePlugin:e=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),n.debugMode=()=>{ |
| 4578 |
r=!1},n.safeMode=()=>{r=!0},n.versionString="11.10.0",n.regex={concat:h, |
| 4579 |
lookahead:g,either:f,optional:d,anyNumberOfTimes:u} |
| 4580 |
;for(const t in j)"object"==typeof j[t]&&e(j[t]);return Object.assign(n,j),n |
| 4581 |
},ne=te({});return ne.newInstance=()=>te({}),ne}() |
| 4582 |
;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `r` grammar compiled for Highlight.js 11.10.0 */ |
| 4583 |
(()=>{var e=(()=>{"use strict";return e=>{ |
| 4584 |
const a=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=a.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,t=a.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/) |
| 4585 |
;return{name:"R",keywords:{$pattern:n, |
| 4586 |
keyword:"function if in break next repeat else for while", |
| 4587 |
literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", |
| 4588 |
built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" |
| 4589 |
},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/, |
| 4590 |
starts:{end:a.lookahead(a.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)), |
| 4591 |
endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{ |
| 4592 |
scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0 |
| 4593 |
}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}] |
| 4594 |
}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE], |
| 4595 |
variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ |
| 4596 |
}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ |
| 4597 |
}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ |
| 4598 |
}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ |
| 4599 |
}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ |
| 4600 |
}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', |
| 4601 |
relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{ |
| 4602 |
1:"operator",2:"number"},match:[s,i]},{scope:{1:"operator",2:"number"}, |
| 4603 |
match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[t,i]},{scope:{ |
| 4604 |
2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"}, |
| 4605 |
match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{ |
| 4606 |
match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:t},{begin:"`",end:"`", |
| 4607 |
contains:[{begin:/\\./}]}]}}})();hljs.registerLanguage("r",e)})();</script> |
| 4608 |
<script>HTMLWidgets.widget({ |
| 4609 |
|
| 4610 |
name: 'profvis', |
| 4611 |
|
| 4612 |
type: 'output', |
| 4613 |
|
| 4614 |
initialize: function(el, width, height) { |
| 4615 |
|
| 4616 |
return { |
| 4617 |
// TODO: add instance fields as required |
| 4618 |
}; |
| 4619 |
|
| 4620 |
}, |
| 4621 |
|
| 4622 |
renderValue: function(el, x, instance) { |
| 4623 |
profvis.render(el, x.message); |
| 4624 |
}, |
| 4625 |
|
| 4626 |
resize: function(el, width, height, instance) { |
| 4627 |
|
| 4628 |
} |
| 4629 |
|
| 4630 |
}); |
| 4631 |
</script> |
| 4632 |
|
| 4633 |
<style type="text/css"> |
| 4634 |
code{white-space: pre-wrap;} |
| 4635 |
span.smallcaps{font-variant: small-caps;} |
| 4636 |
span.underline{text-decoration: underline;} |
| 4637 |
div.column{display: inline-block; vertical-align: top; width: 50%;} |
| 4638 |
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} |
| 4639 |
ul.task-list{list-style: none;} |
| 4640 |
</style> |
| 4641 |
|
| 4642 |
|
| 4643 |
|
| 4644 |
<style type="text/css"> |
| 4645 |
code { |
| 4646 |
white-space: pre; |
| 4647 |
} |
| 4648 |
.sourceCode { |
| 4649 |
overflow: visible; |
| 4650 |
} |
| 4651 |
</style> |
| 4652 |
<style type="text/css" data-origin="pandoc"> |
| 4653 |
pre > code.sourceCode { white-space: pre; position: relative; } |
| 4654 |
pre > code.sourceCode > span { line-height: 1.25; } |
| 4655 |
pre > code.sourceCode > span:empty { height: 1.2em; } |
| 4656 |
.sourceCode { overflow: visible; } |
| 4657 |
code.sourceCode > span { color: inherit; text-decoration: inherit; } |
| 4658 |
div.sourceCode { margin: 1em 0; } |
| 4659 |
pre.sourceCode { margin: 0; } |
| 4660 |
@media screen { |
| 4661 |
div.sourceCode { overflow: auto; } |
| 4662 |
} |
| 4663 |
@media print { |
| 4664 |
pre > code.sourceCode { white-space: pre-wrap; } |
| 4665 |
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; } |
| 4666 |
} |
| 4667 |
pre.numberSource code |
| 4668 |
{ counter-reset: source-line 0; } |
| 4669 |
pre.numberSource code > span |
| 4670 |
{ position: relative; left: -4em; counter-increment: source-line; } |
| 4671 |
pre.numberSource code > span > a:first-child::before |
| 4672 |
{ content: counter(source-line); |
| 4673 |
position: relative; left: -1em; text-align: right; vertical-align: baseline; |
| 4674 |
border: none; display: inline-block; |
| 4675 |
-webkit-touch-callout: none; -webkit-user-select: none; |
| 4676 |
-khtml-user-select: none; -moz-user-select: none; |
| 4677 |
-ms-user-select: none; user-select: none; |
| 4678 |
padding: 0 4px; width: 4em; |
| 4679 |
color: #aaaaaa; |
| 4680 |
} |
| 4681 |
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } |
| 4682 |
div.sourceCode |
| 4683 |
{ } |
| 4684 |
@media screen { |
| 4685 |
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } |
| 4686 |
} |
| 4687 |
code span.al { color: #ff0000; font-weight: bold; } |
| 4688 |
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } |
| 4689 |
code span.at { color: #7d9029; } |
| 4690 |
code span.bn { color: #40a070; } |
| 4691 |
code span.bu { color: #008000; } |
| 4692 |
code span.cf { color: #007020; font-weight: bold; } |
| 4693 |
code span.ch { color: #4070a0; } |
| 4694 |
code span.cn { color: #880000; } |
| 4695 |
code span.co { color: #60a0b0; font-style: italic; } |
| 4696 |
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } |
| 4697 |
code span.do { color: #ba2121; font-style: italic; } |
| 4698 |
code span.dt { color: #902000; } |
| 4699 |
code span.dv { color: #40a070; } |
| 4700 |
code span.er { color: #ff0000; font-weight: bold; } |
| 4701 |
code span.ex { } |
| 4702 |
code span.fl { color: #40a070; } |
| 4703 |
code span.fu { color: #06287e; } |
| 4704 |
code span.im { color: #008000; font-weight: bold; } |
| 4705 |
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } |
| 4706 |
code span.kw { color: #007020; font-weight: bold; } |
| 4707 |
code span.op { color: #666666; } |
| 4708 |
code span.ot { color: #007020; } |
| 4709 |
code span.pp { color: #bc7a00; } |
| 4710 |
code span.sc { color: #4070a0; } |
| 4711 |
code span.ss { color: #bb6688; } |
| 4712 |
code span.st { color: #4070a0; } |
| 4713 |
code span.va { color: #19177c; } |
| 4714 |
code span.vs { color: #4070a0; } |
| 4715 |
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } |
| 4716 |
</style> |
| 4717 |
<script> |
| 4718 |
// apply pandoc div.sourceCode style to pre.sourceCode instead |
| 4719 |
(function() { |
| 4720 |
var sheets = document.styleSheets; |
| 4721 |
for (var i = 0; i < sheets.length; i++) { |
| 4722 |
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue; |
| 4723 |
try { var rules = sheets[i].cssRules; } catch (e) { continue; } |
| 4724 |
var j = 0; |
| 4725 |
while (j < rules.length) { |
| 4726 |
var rule = rules[j]; |
| 4727 |
// check if there is a div.sourceCode rule |
| 4728 |
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") { |
| 4729 |
j++; |
| 4730 |
continue; |
| 4731 |
} |
| 4732 |
var style = rule.style.cssText; |
| 4733 |
// check if color or background-color is set |
| 4734 |
if (rule.style.color === '' && rule.style.backgroundColor === '') { |
| 4735 |
j++; |
| 4736 |
continue; |
| 4737 |
} |
| 4738 |
// replace div.sourceCode by a pre.sourceCode rule |
| 4739 |
sheets[i].deleteRule(j); |
| 4740 |
sheets[i].insertRule('pre.sourceCode{' + style + '}', j); |
| 4741 |
} |
| 4742 |
} |
| 4743 |
})(); |
| 4744 |
</script> |
| 4745 |
|
| 4746 |
|
| 4747 |
|
| 4748 |
|
| 4749 |
<style type="text/css">body { |
| 4750 |
background-color: #fff; |
| 4751 |
margin: 1em auto; |
| 4752 |
max-width: 700px; |
| 4753 |
overflow: visible; |
| 4754 |
padding-left: 2em; |
| 4755 |
padding-right: 2em; |
| 4756 |
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; |
| 4757 |
font-size: 14px; |
| 4758 |
line-height: 1.35; |
| 4759 |
} |
| 4760 |
#TOC { |
| 4761 |
clear: both; |
| 4762 |
margin: 0 0 10px 10px; |
| 4763 |
padding: 4px; |
| 4764 |
width: 400px; |
| 4765 |
border: 1px solid #CCCCCC; |
| 4766 |
border-radius: 5px; |
| 4767 |
background-color: #f6f6f6; |
| 4768 |
font-size: 13px; |
| 4769 |
line-height: 1.3; |
| 4770 |
} |
| 4771 |
#TOC .toctitle { |
| 4772 |
font-weight: bold; |
| 4773 |
font-size: 15px; |
| 4774 |
margin-left: 5px; |
| 4775 |
} |
| 4776 |
#TOC ul { |
| 4777 |
padding-left: 40px; |
| 4778 |
margin-left: -1.5em; |
| 4779 |
margin-top: 5px; |
| 4780 |
margin-bottom: 5px; |
| 4781 |
} |
| 4782 |
#TOC ul ul { |
| 4783 |
margin-left: -2em; |
| 4784 |
} |
| 4785 |
#TOC li { |
| 4786 |
line-height: 16px; |
| 4787 |
} |
| 4788 |
table { |
| 4789 |
margin: 1em auto; |
| 4790 |
border-width: 1px; |
| 4791 |
border-color: #DDDDDD; |
| 4792 |
border-style: outset; |
| 4793 |
border-collapse: collapse; |
| 4794 |
} |
| 4795 |
table th { |
| 4796 |
border-width: 2px; |
| 4797 |
padding: 5px; |
| 4798 |
border-style: inset; |
| 4799 |
} |
| 4800 |
table td { |
| 4801 |
border-width: 1px; |
| 4802 |
border-style: inset; |
| 4803 |
line-height: 18px; |
| 4804 |
padding: 5px 5px; |
| 4805 |
} |
| 4806 |
table, table th, table td { |
| 4807 |
border-left-style: none; |
| 4808 |
border-right-style: none; |
| 4809 |
} |
| 4810 |
table thead, table tr.even { |
| 4811 |
background-color: #f7f7f7; |
| 4812 |
} |
| 4813 |
p { |
| 4814 |
margin: 0.5em 0; |
| 4815 |
} |
| 4816 |
blockquote { |
| 4817 |
background-color: #f6f6f6; |
| 4818 |
padding: 0.25em 0.75em; |
| 4819 |
} |
| 4820 |
hr { |
| 4821 |
border-style: solid; |
| 4822 |
border: none; |
| 4823 |
border-top: 1px solid #777; |
| 4824 |
margin: 28px 0; |
| 4825 |
} |
| 4826 |
dl { |
| 4827 |
margin-left: 0; |
| 4828 |
} |
| 4829 |
dl dd { |
| 4830 |
margin-bottom: 13px; |
| 4831 |
margin-left: 13px; |
| 4832 |
} |
| 4833 |
dl dt { |
| 4834 |
font-weight: bold; |
| 4835 |
} |
| 4836 |
ul { |
| 4837 |
margin-top: 0; |
| 4838 |
} |
| 4839 |
ul li { |
| 4840 |
list-style: circle outside; |
| 4841 |
} |
| 4842 |
ul ul { |
| 4843 |
margin-bottom: 0; |
| 4844 |
} |
| 4845 |
pre, code { |
| 4846 |
background-color: #f7f7f7; |
| 4847 |
border-radius: 3px; |
| 4848 |
color: #333; |
| 4849 |
white-space: pre-wrap; |
| 4850 |
} |
| 4851 |
pre { |
| 4852 |
border-radius: 3px; |
| 4853 |
margin: 5px 0px 10px 0px; |
| 4854 |
padding: 10px; |
| 4855 |
} |
| 4856 |
pre:not([class]) { |
| 4857 |
background-color: #f7f7f7; |
| 4858 |
} |
| 4859 |
code { |
| 4860 |
font-family: Consolas, Monaco, 'Courier New', monospace; |
| 4861 |
font-size: 85%; |
| 4862 |
} |
| 4863 |
p > code, li > code { |
| 4864 |
padding: 2px 0px; |
| 4865 |
} |
| 4866 |
div.figure { |
| 4867 |
text-align: center; |
| 4868 |
} |
| 4869 |
img { |
| 4870 |
background-color: #FFFFFF; |
| 4871 |
padding: 2px; |
| 4872 |
border: 1px solid #DDDDDD; |
| 4873 |
border-radius: 3px; |
| 4874 |
border: 1px solid #CCCCCC; |
| 4875 |
margin: 0 5px; |
| 4876 |
} |
| 4877 |
h1 { |
| 4878 |
margin-top: 0; |
| 4879 |
font-size: 35px; |
| 4880 |
line-height: 40px; |
| 4881 |
} |
| 4882 |
h2 { |
| 4883 |
border-bottom: 4px solid #f7f7f7; |
| 4884 |
padding-top: 10px; |
| 4885 |
padding-bottom: 2px; |
| 4886 |
font-size: 145%; |
| 4887 |
} |
| 4888 |
h3 { |
| 4889 |
border-bottom: 2px solid #f7f7f7; |
| 4890 |
padding-top: 10px; |
| 4891 |
font-size: 120%; |
| 4892 |
} |
| 4893 |
h4 { |
| 4894 |
border-bottom: 1px solid #f7f7f7; |
| 4895 |
margin-left: 8px; |
| 4896 |
font-size: 105%; |
| 4897 |
} |
| 4898 |
h5, h6 { |
| 4899 |
border-bottom: 1px solid #ccc; |
| 4900 |
font-size: 105%; |
| 4901 |
} |
| 4902 |
a { |
| 4903 |
color: #0033dd; |
| 4904 |
text-decoration: none; |
| 4905 |
} |
| 4906 |
a:hover { |
| 4907 |
color: #6666ff; } |
| 4908 |
a:visited { |
| 4909 |
color: #800080; } |
| 4910 |
a:visited:hover { |
| 4911 |
color: #BB00BB; } |
| 4912 |
a[href^="http:"] { |
| 4913 |
text-decoration: underline; } |
| 4914 |
a[href^="https:"] { |
| 4915 |
text-decoration: underline; } |
| 4916 |
|
| 4917 |
code > span.kw { color: #555; font-weight: bold; } |
| 4918 |
code > span.dt { color: #902000; } |
| 4919 |
code > span.dv { color: #40a070; } |
| 4920 |
code > span.bn { color: #d14; } |
| 4921 |
code > span.fl { color: #d14; } |
| 4922 |
code > span.ch { color: #d14; } |
| 4923 |
code > span.st { color: #d14; } |
| 4924 |
code > span.co { color: #888888; font-style: italic; } |
| 4925 |
code > span.ot { color: #007020; } |
| 4926 |
code > span.al { color: #ff0000; font-weight: bold; } |
| 4927 |
code > span.fu { color: #900; font-weight: bold; } |
| 4928 |
code > span.er { color: #a61717; background-color: #e3d2d2; } |
| 4929 |
</style> |
| 4930 |
|
| 4931 |
|
| 4932 |
|
| 4933 |
|
| 4934 |
</head> |
| 4935 |
|
| 4936 |
<body> |
| 4937 |
|
| 4938 |
|
| 4939 |
|
| 4940 |
|
| 4941 |
<h1 class="title toc-ignore">Getting started with profvis</h1> |
| 4942 |
|
| 4943 |
|
| 4944 |
|
| 4945 |
<div id="introduction" class="section level2"> |
| 4946 |
<h2>Introduction</h2> |
| 4947 |
<p><a href="https://github.com/r-lib/profvis">profvis</a> is a tool for |
| 4948 |
helping you to understand how R spends its time. It provides a |
| 4949 |
interactive graphical interface for visualizing data from |
| 4950 |
<code>Rprof()</code>, R’s built-in tool for collecting profiling |
| 4951 |
data.</p> |
| 4952 |
<p>Most R users have had times where we’ve wanted our code to run |
| 4953 |
faster. However, it’s not always clear how to accomplish this. A common |
| 4954 |
approach is to rely on intuition, and on wisdom from the broader R |
| 4955 |
community about speeding up R code. One drawback to this is it can lead |
| 4956 |
to a focus on optimizing things that actually take a small proportion of |
| 4957 |
the overall running time.</p> |
| 4958 |
<p>Suppose you make a loop run 5 times faster. That sounds like a huge |
| 4959 |
improvement, but if that loop only takes 10% of the total time, it’s |
| 4960 |
still only a 8% speedup overall. Another drawback is that, although many |
| 4961 |
of the commonly-held beliefs are true (for example, preallocating memory |
| 4962 |
can speed things up), some are not (e.g., that <code>*apply</code> |
| 4963 |
functions are inherently faster than <code>for</code> loops). This can |
| 4964 |
lead us to spend time doing “optimizations” that don’t really help. To |
| 4965 |
make slow code faster, we need accurate information about what is making |
| 4966 |
our code slow.</p> |
| 4967 |
</div> |
| 4968 |
<div id="getting-started" class="section level2"> |
| 4969 |
<h2>Getting started</h2> |
| 4970 |
<p>Below is an example of profvis in use. The code generates a random |
| 4971 |
50,000 row data set, draws a plot, then fits a linear model, and draws a |
| 4972 |
line for the model. (The plot isn’t displayed in this document, though.) |
| 4973 |
If you copy and paste this code into your R console, it’ll open a window |
| 4974 |
with the same profvis interface that you see in this HTML document.</p> |
| 4975 |
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="fu">library</span>(profvis)</span> |
| 4976 |
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a></span> |
| 4977 |
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a><span class="fu">profvis</span>({</span> |
| 4978 |
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a> df <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x =</span> <span class="fu">rnorm</span>(<span class="fl">5e5</span>), <span class="at">y =</span> <span class="fu">rnorm</span>(<span class="fl">5e5</span>))</span> |
| 4979 |
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a></span> |
| 4980 |
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a> <span class="fu">plot</span>(y <span class="sc">~</span> x, <span class="at">data =</span> df)</span> |
| 4981 |
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a> m <span class="ot"><-</span> <span class="fu">lm</span>(y <span class="sc">~</span> x, <span class="at">data =</span> df)</span> |
| 4982 |
<span id="cb1-8"><a href="#cb1-8" tabindex="-1"></a> <span class="fu">abline</span>(m, <span class="at">col =</span> <span class="st">"red"</span>)</span> |
| 4983 |
<span id="cb1-9"><a href="#cb1-9" tabindex="-1"></a>})</span></code></pre></div> |
| 4984 |
<div id="htmlwidget-942cab09132f2707bb81" style="width:100%;height:450px;" class="profvis html-widget"></div> |
| 4985 |
<script type="application/json" data-for="htmlwidget-942cab09132f2707bb81">{"x":{"message":{"prof":{"time":[1,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,66,66,66,66,67,67,67,67,68,68,68,68,69,69,69,69,70,70,70,70,71,71,71,71,72,72,72,72,73,73,73,73,74,74,74,74,75,75,75,75,76,76,76,76,77,77,77,77,78,78,78,78,79,79,79,79,80,80,80,80,81,81,81,81,82,82,82,82,83,83,83,83,84,84,84,84,85,85,85,85,86,86,86,86,87,87,87,87,88,88,88,88,89,89,89,89,90,90,90,90,91,91,91,91,92,92,92,92,93,93,93,93,94,94,94,94,95,95,95,95,96,96,96,96,97,97,97,98,98,98,99,99,99,100,100,100,101,101,101,102,102,102,103,103,103,104,104,104,105,105,105,106,106,106,107,107,107,108,108,108,109,109,109,110,110,110,111,111,111,112,112,112,113,113,113,114,114,114,115,115,115,116,116,116,117,117,117,118,118,118,119,119,119,120,120,120,121,121,121,122,122,122,123,123,123,124,124,124,125,125,125,126,126,126,127,127,127,128,128,128,129,129,129,130,130,130,131,131,131,132,132,132,133,133,133,134,134,134,135,135,135,136,136,136,137,137,137,138,138,138,139,139,139,140,140,140,141,141,141,142,142,142,143,143,143,144,144,144,145,145,145,146,146,146,147,147,147,148,148,148,149,149,149,150,150,150,151,151,151,152,152,152,153,153,153,154,154,154,155,155,155,156,156,156,157,157,157,158,158,158,159,159,159,160,160,160,161,161,161,162,162,162,163,163,163,164,164,164,165,165,165,166,166,166,167,167,167,168,168,168,169,169,169,170,170,170,171,171,171,172,172,172,173,173,173,174,174,174,175,175,175,176,176,176,177,177,177,178,178,178,179,179,179,180,180,180,181,181,181,182,182,182,183,183,183,184,184,184,185,185,185,186,186,186,187,187,187,188,188,188,189,189,189,190,190,190,191,191,191,192,192,192,193,193,193,194,194,194,195,195,195,196,196,196,197,197,197,198,198,198,199,199,199,200,200,200,201,201,201,202,202,202,203,203,203,204,204,204,205,205,205,206,206,206,207,207,207,208,208,208,209,209,209,210,210,210,211,211,211,212,212,212,213,213,213,214,214,214,215,215,215,216,216,216,217,217,217,218,218,218,219,219,219,220,220,220,221,221,221,222,222,222,223,223,223,224,224,224,225,225,225,226,226,226,227,227,227,228,228,228,229,229,229,230,230,230,231,231,231,232,232,232,233,233,233,234,234,234,235,235,235,236,236,236,237,237,237,238,238,238,239,239,239,239,239,240,240,240,241,241,241,242,242,242,243,243,243,244,244,245,245,246,246,247,247,247,248,248,248],"depth":[1,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,4,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,5,4,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,2,1,2,1,2,1,3,2,1,3,2,1],"label":["rnorm","rnorm","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","paste","deparse1","plot.default","plot.formula","paste","deparse1","plot.default","plot.formula","paste","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","deparse","deparse1","plot.default","plot.formula","paste","deparse1","plot.default","plot.formula","paste","deparse1","plot.default","plot.formula","paste","deparse1","plot.default","plot.formula","<GC>","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","plot.xy","plot.default","plot.formula","axis","Axis.default","localAxis","plot.default","plot.formula","<GC>","is.na","tools::buildVignettes","<GC>","is.na","tools::buildVignettes","<GC>","is.na","tools::buildVignettes","<GC>","is.na","tools::buildVignettes","!","tools::buildVignettes",".External2","tools::buildVignettes","lm.fit","lm","<GC>","lm.fit","lm","<GC>","lm.fit","lm"],"filenum":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"linenum":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"memalloc":[12.59921264648438,16.41629791259766,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.76531219482422,16.94114685058594,16.94114685058594,16.94114685058594,16.94114685058594,17.34563446044922,17.34563446044922,17.34563446044922,17.34563446044922,17.75290679931641,17.75290679931641,17.75290679931641,17.75290679931641,18.1627197265625,18.1627197265625,18.1627197265625,18.1627197265625,18.57353210449219,18.57353210449219,18.57353210449219,18.57353210449219,18.98371887207031,18.98371887207031,18.98371887207031,18.98371887207031,19.39289855957031,19.39289855957031,19.39289855957031,19.39289855957031,19.79587554931641,19.79587554931641,19.79587554931641,19.79587554931641,20.19838714599609,20.19838714599609,20.19838714599609,20.19838714599609,20.59787750244141,20.59787750244141,20.59787750244141,20.59787750244141,21.00170135498047,21.00170135498047,21.00170135498047,21.00170135498047,21.40142059326172,21.40142059326172,21.40142059326172,21.40142059326172,21.80523681640625,21.80523681640625,21.80523681640625,21.80523681640625,22.18553924560547,22.18553924560547,22.18553924560547,22.18553924560547,22.59368133544922,22.59368133544922,22.59368133544922,22.59368133544922,22.97544097900391,22.97544097900391,22.97544097900391,22.97544097900391,23.38135528564453,23.38135528564453,23.38135528564453,23.38135528564453,23.78905487060547,23.78905487060547,23.78905487060547,23.78905487060547,24.1868896484375,24.1868896484375,24.1868896484375,24.1868896484375,24.59446716308594,24.59446716308594,24.59446716308594,24.59446716308594,24.99764251708984,24.99764251708984,24.99764251708984,24.99764251708984,25.38074493408203,25.38074493408203,25.38074493408203,25.38074493408203,25.77471160888672,25.77471160888672,25.77471160888672,25.77471160888672,26.25477600097656,26.25477600097656,26.25477600097656,26.25477600097656,26.25477600097656,26.25477600097656,26.25477600097656,26.25477600097656,26.25478363037109,26.25478363037109,26.25478363037109,26.25478363037109,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.40536499023438,35.57862091064453,35.57862091064453,35.57862091064453,35.57862091064453,35.96939849853516,35.96939849853516,35.96939849853516,35.96939849853516,36.36647796630859,36.36647796630859,36.36647796630859,36.36647796630859,36.76193237304688,36.76193237304688,36.76193237304688,36.76193237304688,37.16376495361328,37.16376495361328,37.16376495361328,37.16376495361328,37.56414031982422,37.56414031982422,37.56414031982422,37.56414031982422,37.96666717529297,37.96666717529297,37.96666717529297,37.96666717529297,38.373291015625,38.373291015625,38.373291015625,38.373291015625,38.78093719482422,38.78093719482422,38.78093719482422,38.78093719482422,39.18679809570312,39.18679809570312,39.18679809570312,39.18679809570312,39.59356689453125,39.59356689453125,39.59356689453125,39.59356689453125,39.99913024902344,39.99913024902344,39.99913024902344,39.99913024902344,40.40576934814453,40.40576934814453,40.40576934814453,40.40576934814453,40.81357574462891,40.81357574462891,40.81357574462891,40.81357574462891,41.22112274169922,41.22112274169922,41.22112274169922,41.22112274169922,41.62940216064453,41.62940216064453,41.62940216064453,41.62940216064453,42.03733062744141,42.03733062744141,42.03733062744141,42.03733062744141,42.44239044189453,42.44239044189453,42.44239044189453,42.44239044189453,42.84842681884766,42.84842681884766,42.84842681884766,42.84842681884766,43.23928833007812,43.23928833007812,43.23928833007812,43.23928833007812,43.62281036376953,43.62281036376953,43.62281036376953,43.62281036376953,44.00872039794922,44.00872039794922,44.00872039794922,44.00872039794922,44.38796234130859,44.38796234130859,44.38796234130859,44.38796234130859,44.89488983154297,44.89488983154297,44.89488983154297,44.89488983154297,44.89488983154297,44.89488983154297,44.89488983154297,44.89488983154297,44.8948974609375,44.8948974609375,44.8948974609375,44.8948974609375,62.13706970214844,62.13706970214844,62.13706970214844,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.3751220703125,60.40470886230469,60.40470886230469,60.40470886230469,60.40470886230469,60.40470886230469,62.42490386962891,62.42490386962891,62.42490386962891,62.42490386962891,62.42490386962891,62.42490386962891,62.42490386962891,62.42490386962891,62.42490386962891,51.60758972167969,51.60758972167969,51.60758972167969,46.26289367675781,46.26289367675781,55.79926300048828,55.79926300048828,69.18769073486328,69.18769073486328,76.82675170898438,76.82675170898438,76.82675170898438,76.82675170898438,76.82675170898438,76.82675170898438],"meminc":[0,3.817085266113281,0.3490142822265625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1758346557617188,0,0,0,0.4044876098632812,0,0,0,0.4072723388671875,0,0,0,0.4098129272460938,0,0,0,0.4108123779296875,0,0,0,0.410186767578125,0,0,0,0.4091796875,0,0,0,0.4029769897460938,0,0,0,0.4025115966796875,0,0,0,0.3994903564453125,0,0,0,0.4038238525390625,0,0,0,0.39971923828125,0,0,0,0.4038162231445312,0,0,0,0.3803024291992188,0,0,0,0.40814208984375,0,0,0,0.3817596435546875,0,0,0,0.405914306640625,0,0,0,0.4076995849609375,0,0,0,0.3978347778320312,0,0,0,0.4075775146484375,0,0,0,0.4031753540039062,0,0,0,0.3831024169921875,0,0,0,0.3939666748046875,0,0,0,0.4800643920898438,0,0,0,0,0,0,0,7.62939453125e-06,0,0,0,9.150581359863281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1732559204101562,0,0,0,0.390777587890625,0,0,0,0.3970794677734375,0,0,0,0.3954544067382812,0,0,0,0.4018325805664062,0,0,0,0.4003753662109375,0,0,0,0.40252685546875,0,0,0,0.4066238403320312,0,0,0,0.4076461791992188,0,0,0,0.4058609008789062,0,0,0,0.406768798828125,0,0,0,0.4055633544921875,0,0,0,0.4066390991210938,0,0,0,0.407806396484375,0,0,0,0.4075469970703125,0,0,0,0.4082794189453125,0,0,0,0.407928466796875,0,0,0,0.405059814453125,0,0,0,0.406036376953125,0,0,0,0.3908615112304688,0,0,0,0.3835220336914062,0,0,0,0.3859100341796875,0,0,0,0.379241943359375,0,0,0,0.506927490234375,0,0,0,0,0,0,0,7.62939453125e-06,0,0,0,17.24217224121094,0,0,-1.761947631835938,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0295867919921875,0,0,0,0,2.020195007324219,0,0,0,0,0,0,0,0,-10.81731414794922,0,0,-5.344696044921875,0,9.536369323730469,0,13.388427734375,0,7.639060974121094,0,0,0,0,0],"filename":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]},"interval":10,"files":[],"prof_output":"/tmp/Rtmpv2rdLT/filed93d1a90d167.prof","highlight":{"output":["^output\\$"],"gc":["^<GC>$"],"stacktrace":["^\\.\\.stacktraceo(n|ff)\\.\\.$"]},"split":"h"}},"evals":[],"jsHooks":[]}</script> |
| 4986 |
<p>On top is the code, and on the bottom is a flame graph. In the flame |
| 4987 |
graph, the horizontal direction represents time in milliseconds, and the |
| 4988 |
vertical direction represents the call stack. Looking at the bottom-most |
| 4989 |
items on the stack, most of the time, about 2 seconds, is spent in |
| 4990 |
<code>plot</code>, and then a much smaller amount of time is spent in |
| 4991 |
<code>lm</code>, and almost no time at all is spent in |
| 4992 |
<code>abline</code> – it doesn’t even show up on the flame graph.</p> |
| 4993 |
<p>Traveling up the stack, <code>plot</code> called |
| 4994 |
<code>plot.formula</code>, which called <code>do.call</code>, and so on. |
| 4995 |
Going up a few more levels, we can see that <code>plot.default</code> |
| 4996 |
called a number of functions: first <code>deparse</code>, and later, |
| 4997 |
<code>plot.xy</code>. Similarly, <code>lm</code> calls a number of |
| 4998 |
different functions.</p> |
| 4999 |
<p>On top, we can see the amount of time spent on each line of code. |
| 5000 |
This tells us, unsurprisingly, that most of the time is spent on the |
| 5001 |
line with <code>plot</code>, and a little bit is spent on the line with |
| 5002 |
<code>lm</code>.</p> |
| 5003 |
<p>The code panel also shows memory allocation and deallocation. |
| 5004 |
Interpreting this information can be a little tricky, because it does |
| 5005 |
not necessarily reflect memory allocated and deallcated <em>at</em> that |
| 5006 |
line of code. The sampling profiler records information about memory |
| 5007 |
allocations that happen between the previous sample and the current one. |
| 5008 |
This means that the allocation/deallocation values on that line may have |
| 5009 |
actually occurred in a previous line of code.</p> |
| 5010 |
<div id="navigating-profvis" class="section level3"> |
| 5011 |
<h3>Navigating profvis</h3> |
| 5012 |
<p>profvis is interactive. You can try the following:</p> |
| 5013 |
<ul> |
| 5014 |
<li>As you mouse over the flame graph, information about each block will |
| 5015 |
show in the info box.</li> |
| 5016 |
<li>Yellow flame graph blocks have corresponding lines of code on the |
| 5017 |
left. (White blocks represent code where profvis doesn’t have the source |
| 5018 |
code – for example, in base R and in R packages. But see <a href="#how-do-i-get-code-from-an-r-package-to-show-in-the-code-panel">this |
| 5019 |
FAQ</a> if you want package code to show up in the code panel.) If you |
| 5020 |
mouse over a yellow block, the corresponding line of code will be |
| 5021 |
highlighted. Note that the highlighted line of code is where the yellow |
| 5022 |
function is called <em>from</em>, not the content of that function.</li> |
| 5023 |
<li>If you mouse over a line of code, all flame graph blocks that were |
| 5024 |
called from that line will be highlighted.</li> |
| 5025 |
<li>Click on a block or line of code to lock the current highlighting. |
| 5026 |
Click on the background, or again on that same item to unlock the |
| 5027 |
highlighting. Click on another item to lock on that item.</li> |
| 5028 |
<li>Use the mouse scroll wheel or trackpad’s scroll gesture to zoom in |
| 5029 |
or out in the x direction.</li> |
| 5030 |
<li>Click and drag on the flame graph to pan up, down, left, right.</li> |
| 5031 |
<li>Double-click on the background to zoom the x axis to its original |
| 5032 |
extent.</li> |
| 5033 |
<li>Double-click on a flamegraph block to zoom the x axis the width of |
| 5034 |
that block.</li> |
| 5035 |
</ul> |
| 5036 |
<p>Each <em>block</em> in the flame graph represents a call to a |
| 5037 |
function, or possibly multiple calls to the same function. The width of |
| 5038 |
the block is proportional to the amount of time spent in that function. |
| 5039 |
When a function calls another function, another block is added on top of |
| 5040 |
it in the flame graph.</p> |
| 5041 |
<p>The profiling data has some limitations: some internal R functions |
| 5042 |
don’t show up in the flame graph, and it offers no insight into code |
| 5043 |
that’s implemented in languages other than R (e.g. C, C++, or |
| 5044 |
Fortran).</p> |
| 5045 |
</div> |
| 5046 |
<div id="the-data-view" class="section level3"> |
| 5047 |
<h3>The data view</h3> |
| 5048 |
<p>In addition to the flame graph view, profvis provides a <em>data |
| 5049 |
view</em>, which can be seen by clicking on the Data tab. It provides a |
| 5050 |
top-down tabular view of the profile. Click the <strong>code</strong> |
| 5051 |
column to expand the call stack under investigation and the following |
| 5052 |
columns to reason about resource allocation:</p> |
| 5053 |
<ul> |
| 5054 |
<li>Memory: Memory allocated or deallocated (for negative numbers) for a |
| 5055 |
given call stack. This is represented in megabytes and aggregated over |
| 5056 |
all the call stacks over the code in the given row.</li> |
| 5057 |
<li>Time: Time spent in milliseconds. This field is also aggregated over |
| 5058 |
all the call stacks executed over the code in the given row.</li> |
| 5059 |
</ul> |
| 5060 |
</div> |
| 5061 |
</div> |
| 5062 |
<div id="how-profiling-data-is-collected" class="section level2"> |
| 5063 |
<h2>How profiling data is collected</h2> |
| 5064 |
<p>profvis uses data collected by <code>Rprof()</code>, which is part of |
| 5065 |
the base R distribution. At each time interval (<code>profvis()</code> |
| 5066 |
uses a default interval of 10ms), the profiler stops the R interpreter, |
| 5067 |
looks at the current function call stack, and records it to a file. |
| 5068 |
Because it works by <em>sampling</em>, the result isn’t deterministic. |
| 5069 |
Each time you profile your code, the result will be slightly |
| 5070 |
different.</p> |
| 5071 |
</div> |
| 5072 |
|
| 5073 |
|
| 5074 |
|
| 5075 |
<!-- code folding --> |
| 5076 |
|
| 5077 |
|
| 5078 |
<!-- dynamically load mathjax for compatibility with self-contained --> |
| 5079 |
<script> |
| 5080 |
(function () { |
| 5081 |
var script = document.createElement("script"); |
| 5082 |
script.type = "text/javascript"; |
| 5083 |
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; |
| 5084 |
document.getElementsByTagName("head")[0].appendChild(script); |
| 5085 |
})(); |
| 5086 |
</script> |
| 5087 |
|
| 5088 |
</body> |
| 5089 |
</html> |