|
1 | 1 | (function() { |
| 2 | + d3 = { |
| 3 | + version: "3.0.5" |
| 4 | + }; |
| 5 | + var π = Math.PI, ε = 1e-6, d3_radians = π / 180, d3_degrees = 180 / π, d3_document = document, d3_window = window; |
| 6 | + function d3_target(d) { |
| 7 | + return d.target; |
| 8 | + } |
| 9 | + function d3_source(d) { |
| 10 | + return d.source; |
| 11 | + } |
2 | 12 | var d3_format_decimalPoint = ".", d3_format_thousandsSeparator = ",", d3_format_grouping = [ 3, 3 ]; |
3 | 13 | if (!Date.now) Date.now = function() { |
4 | 14 | return +new Date(); |
5 | 15 | }; |
6 | 16 | try { |
7 | | - document.createElement("div").style.setProperty("opacity", 0, ""); |
| 17 | + d3_document.createElement("div").style.setProperty("opacity", 0, ""); |
8 | 18 | } catch (error) { |
9 | | - var d3_style_prototype = CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty; |
| 19 | + var d3_style_prototype = d3_window.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty; |
10 | 20 | d3_style_prototype.setProperty = function(name, value, priority) { |
11 | 21 | d3_style_setProperty.call(this, name, value + "", priority); |
12 | 22 | }; |
13 | 23 | } |
14 | | - d3 = { |
15 | | - version: "3.0.5" |
16 | | - }; |
17 | | - var π = Math.PI, ε = 1e-6, d3_radians = π / 180, d3_degrees = 180 / π; |
18 | | - function d3_target(d) { |
19 | | - return d.target; |
20 | | - } |
21 | | - function d3_source(d) { |
22 | | - return d.source; |
23 | | - } |
24 | 24 | function d3_class(ctor, properties) { |
25 | 25 | try { |
26 | 26 | for (var key in properties) { |
|
43 | 43 | return Array.prototype.slice.call(pseudoarray); |
44 | 44 | } |
45 | 45 | try { |
46 | | - d3_array(document.documentElement.childNodes)[0].nodeType; |
| 46 | + d3_array(d3_document.documentElement.childNodes)[0].nodeType; |
47 | 47 | } catch (e) { |
48 | 48 | d3_array = d3_arrayCopy; |
49 | 49 | } |
|
395 | 395 | return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x); |
396 | 396 | }; |
397 | 397 | d3.xhr = function(url, mimeType, callback) { |
398 | | - var xhr = {}, dispatch = d3.dispatch("progress", "load", "error"), headers = {}, response = d3_identity, request = new (window.XDomainRequest && /^(http(s)?:)?\/\//.test(url) ? XDomainRequest : XMLHttpRequest)(); |
| 398 | + var xhr = {}, dispatch = d3.dispatch("progress", "load", "error"), headers = {}, response = d3_identity, request = new (d3_window.XDomainRequest && /^(http(s)?:)?\/\//.test(url) ? XDomainRequest : XMLHttpRequest)(); |
399 | 399 | "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() { |
400 | 400 | request.readyState > 3 && respond(); |
401 | 401 | }; |
|
474 | 474 | return d3.xhr(url, "text/html", callback).response(d3_html); |
475 | 475 | }; |
476 | 476 | function d3_html(request) { |
477 | | - var range = document.createRange(); |
478 | | - range.selectNode(document.body); |
| 477 | + var range = d3_document.createRange(); |
| 478 | + range.selectNode(d3_document.body); |
479 | 479 | return range.createContextualFragment(request.responseText); |
480 | 480 | } |
481 | 481 | d3.xml = function() { |
|
805 | 805 | return dispatch; |
806 | 806 | } |
807 | 807 | d3.transform = function(string) { |
808 | | - var g = document.createElementNS(d3.ns.prefix.svg, "g"); |
| 808 | + var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); |
809 | 809 | return (d3.transform = function(string) { |
810 | 810 | g.setAttribute("transform", string); |
811 | 811 | var t = g.transform.baseVal.consolidate(); |
|
1440 | 1440 | return n.querySelector(s); |
1441 | 1441 | }, d3_selectAll = function(s, n) { |
1442 | 1442 | return n.querySelectorAll(s); |
1443 | | - }, d3_selectRoot = document.documentElement, d3_selectMatcher = d3_selectRoot.matchesSelector || d3_selectRoot.webkitMatchesSelector || d3_selectRoot.mozMatchesSelector || d3_selectRoot.msMatchesSelector || d3_selectRoot.oMatchesSelector, d3_selectMatches = function(n, s) { |
| 1443 | + }, d3_selectRoot = d3_document.documentElement, d3_selectMatcher = d3_selectRoot.matchesSelector || d3_selectRoot.webkitMatchesSelector || d3_selectRoot.mozMatchesSelector || d3_selectRoot.msMatchesSelector || d3_selectRoot.oMatchesSelector, d3_selectMatches = function(n, s) { |
1444 | 1444 | return d3_selectMatcher.call(n, s); |
1445 | 1445 | }; |
1446 | 1446 | if (typeof Sizzle === "function") { |
|
1592 | 1592 | for (priority in name) this.each(d3_selection_style(priority, name[priority], value)); |
1593 | 1593 | return this; |
1594 | 1594 | } |
1595 | | - if (n < 2) return getComputedStyle(this.node(), null).getPropertyValue(name); |
| 1595 | + if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name); |
1596 | 1596 | priority = ""; |
1597 | 1597 | } |
1598 | 1598 | return this.each(d3_selection_style(name, value, priority)); |
|
1654 | 1654 | d3_selectionPrototype.append = function(name) { |
1655 | 1655 | name = d3.ns.qualify(name); |
1656 | 1656 | function append() { |
1657 | | - return this.appendChild(document.createElementNS(this.namespaceURI, name)); |
| 1657 | + return this.appendChild(d3_document.createElementNS(this.namespaceURI, name)); |
1658 | 1658 | } |
1659 | 1659 | function appendNS() { |
1660 | | - return this.appendChild(document.createElementNS(name.space, name.local)); |
| 1660 | + return this.appendChild(d3_document.createElementNS(name.space, name.local)); |
1661 | 1661 | } |
1662 | 1662 | return this.select(name.local ? appendNS : append); |
1663 | 1663 | }; |
1664 | 1664 | d3_selectionPrototype.insert = function(name, before) { |
1665 | 1665 | name = d3.ns.qualify(name); |
1666 | 1666 | function insert() { |
1667 | | - return this.insertBefore(document.createElementNS(this.namespaceURI, name), d3_select(before, this)); |
| 1667 | + return this.insertBefore(d3_document.createElementNS(this.namespaceURI, name), d3_select(before, this)); |
1668 | 1668 | } |
1669 | 1669 | function insertNS() { |
1670 | | - return this.insertBefore(document.createElementNS(name.space, name.local), d3_select(before, this)); |
| 1670 | + return this.insertBefore(d3_document.createElementNS(name.space, name.local), d3_select(before, this)); |
1671 | 1671 | } |
1672 | 1672 | return this.select(name.local ? insertNS : insert); |
1673 | 1673 | }; |
|
1891 | 1891 | } |
1892 | 1892 | return d3_transition(subgroups, id); |
1893 | 1893 | }; |
1894 | | - var d3_selectionRoot = d3_selection([ [ document ] ]); |
| 1894 | + var d3_selectionRoot = d3_selection([ [ d3_document ] ]); |
1895 | 1895 | d3_selectionRoot[0].parentNode = d3_selectRoot; |
1896 | 1896 | d3.select = function(selector) { |
1897 | 1897 | return typeof selector === "string" ? d3_selectionRoot.select(selector) : d3_selection([ [ selector ] ]); |
|
2103 | 2103 | } |
2104 | 2104 | return d3_transition_tween(this, "style." + name, value, function(b) { |
2105 | 2105 | function styleString() { |
2106 | | - var a = getComputedStyle(this, null).getPropertyValue(name), i; |
| 2106 | + var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i; |
2107 | 2107 | return a !== b && (i = interpolate(a, b), function(t) { |
2108 | 2108 | this.style.setProperty(name, i(t), priority); |
2109 | 2109 | }); |
|
2114 | 2114 | d3_transitionPrototype.styleTween = function(name, tween, priority) { |
2115 | 2115 | if (arguments.length < 3) priority = ""; |
2116 | 2116 | return this.tween("style." + name, function(d, i) { |
2117 | | - var f = tween.call(this, d, i, getComputedStyle(this, null).getPropertyValue(name)); |
| 2117 | + var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name)); |
2118 | 2118 | return f && function(t) { |
2119 | 2119 | this.style.setProperty(name, f(t), priority); |
2120 | 2120 | }; |
|
2272 | 2272 | } |
2273 | 2273 | return then; |
2274 | 2274 | } |
2275 | | - var d3_timer_frame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { |
| 2275 | + var d3_timer_frame = d3_window.requestAnimationFrame || d3_window.webkitRequestAnimationFrame || d3_window.mozRequestAnimationFrame || d3_window.oRequestAnimationFrame || d3_window.msRequestAnimationFrame || function(callback) { |
2276 | 2276 | setTimeout(callback, 17); |
2277 | 2277 | }; |
2278 | 2278 | d3.mouse = function(container) { |
2279 | 2279 | return d3_mousePoint(container, d3_eventSource()); |
2280 | 2280 | }; |
2281 | | - var d3_mouse_bug44083 = /WebKit/.test(navigator.userAgent) ? -1 : 0; |
| 2281 | + var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0; |
2282 | 2282 | function d3_mousePoint(container, e) { |
2283 | 2283 | var svg = container.ownerSVGElement || container; |
2284 | 2284 | if (svg.createSVGPoint) { |
2285 | 2285 | var point = svg.createSVGPoint(); |
2286 | | - if (d3_mouse_bug44083 < 0 && (window.scrollX || window.scrollY)) { |
2287 | | - svg = d3.select(document.body).append("svg").style("position", "absolute").style("top", 0).style("left", 0); |
| 2286 | + if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) { |
| 2287 | + svg = d3.select(d3_document.body).append("svg").style("position", "absolute").style("top", 0).style("left", 0); |
2288 | 2288 | var ctm = svg[0][0].getScreenCTM(); |
2289 | 2289 | d3_mouse_bug44083 = !(ctm.f || ctm.e); |
2290 | 2290 | svg.remove(); |
|
3523 | 3523 | } |
3524 | 3524 | function brushstart() { |
3525 | 3525 | var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), center, origin = mouse(), offset; |
3526 | | - var w = d3.select(window).on("mousemove.brush", brushmove).on("mouseup.brush", brushend).on("touchmove.brush", brushmove).on("touchend.brush", brushend).on("keydown.brush", keydown).on("keyup.brush", keyup); |
| 3526 | + var w = d3.select(d3_window).on("mousemove.brush", brushmove).on("mouseup.brush", brushend).on("touchmove.brush", brushmove).on("touchend.brush", brushend).on("keydown.brush", keydown).on("keyup.brush", keyup); |
3527 | 3527 | if (dragging) { |
3528 | 3528 | origin[0] = extent[0][0] - origin[0]; |
3529 | 3529 | origin[1] = extent[0][1] - origin[1]; |
|
3710 | 3710 | } |
3711 | 3711 | function mousedown() { |
3712 | 3712 | var target = this, event_ = event.of(target, arguments), eventTarget = d3.event.target, touchId = d3.event.touches ? d3.event.changedTouches[0].identifier : null, offset, origin_ = point(), moved = 0; |
3713 | | - var w = d3.select(window).on(touchId != null ? "touchmove.drag-" + touchId : "mousemove.drag", dragmove).on(touchId != null ? "touchend.drag-" + touchId : "mouseup.drag", dragend, true); |
| 3713 | + var w = d3.select(d3_window).on(touchId != null ? "touchmove.drag-" + touchId : "mousemove.drag", dragmove).on(touchId != null ? "touchend.drag-" + touchId : "mouseup.drag", dragend, true); |
3714 | 3714 | if (origin) { |
3715 | 3715 | offset = origin.apply(target, arguments); |
3716 | 3716 | offset = [ offset.x - origin_[0], offset.y - origin_[1] ]; |
|
3833 | 3833 | }); |
3834 | 3834 | } |
3835 | 3835 | function mousedown() { |
3836 | | - var target = this, event_ = event.of(target, arguments), eventTarget = d3.event.target, moved = 0, w = d3.select(window).on("mousemove.zoom", mousemove).on("mouseup.zoom", mouseup), l = location(d3.mouse(target)); |
3837 | | - window.focus(); |
| 3836 | + var target = this, event_ = event.of(target, arguments), eventTarget = d3.event.target, moved = 0, w = d3.select(d3_window).on("mousemove.zoom", mousemove).on("mouseup.zoom", mouseup), l = location(d3.mouse(target)); |
| 3837 | + d3_window.focus(); |
3838 | 3838 | d3_eventCancel(); |
3839 | 3839 | function mousemove() { |
3840 | 3840 | moved = 1; |
|
0 commit comments