Comparing version 3.0.5 to 3.0.6
{ | ||
"name": "d3", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"main": "./d3.js" | ||
} |
var document = global.document = require("jsdom").jsdom("<html><head></head><body></body></html>"), | ||
window = global.window = document.createWindow(), | ||
navigator = global.navigator = window.navigator, | ||
getComputedStyle = global.getComputedStyle = window.getComputedStyle, | ||
CSSStyleDeclaration = global.CSSStyleDeclaration = window.CSSStyleDeclaration; | ||
window = global.window = document.createWindow(); | ||
// https://github.com/chad3814/CSSStyleDeclaration/issues/3 | ||
var CSSStyleDeclaration_setProperty = CSSStyleDeclaration.prototype.setProperty; | ||
CSSStyleDeclaration.prototype.setProperty = function(name, value, priority) { | ||
var CSSStyleDeclaration_prototype = window.CSSStyleDeclaration.prototype, | ||
CSSStyleDeclaration_setProperty = CSSStyleDeclaration_prototype.setProperty; | ||
CSSStyleDeclaration_prototype.setProperty = function(name, value, priority) { | ||
return CSSStyleDeclaration_setProperty.call(this, name + "", value == null ? null : value + "", priority == null ? null : priority + ""); | ||
}; |
@@ -1,2 +0,2 @@ | ||
var globals = ["document", "window", "navigator", "CSSStyleDeclaration", "getComputedStyle", "d3"], | ||
var globals = ["document", "window", "d3"], | ||
globalValues = {}; | ||
@@ -3,0 +3,0 @@ |
{ | ||
"name": "d3", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "A small, free JavaScript library for manipulating documents based on data.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -19,3 +19,3 @@ d3.behavior.drag = function() { | ||
var w = d3.select(window) | ||
var w = d3.select(d3_window) | ||
.on(touchId != null ? "touchmove.drag-" + touchId : "mousemove.drag", dragmove) | ||
@@ -22,0 +22,0 @@ .on(touchId != null ? "touchend.drag-" + touchId : "mouseup.drag", dragend, true); |
@@ -15,7 +15,5 @@ d3.behavior.zoom = function() { | ||
function zoom() { | ||
this | ||
.on("mousedown.zoom", mousedown) | ||
.on("mousewheel.zoom", mousewheel) | ||
this.on("mousedown.zoom", mousedown) | ||
.on("mousemove.zoom", mousemove) | ||
.on("DOMMouseScroll.zoom", mousewheel) | ||
.on(d3_behavior_zoomWheel + ".zoom", mousewheel) | ||
.on("dblclick.zoom", dblclick) | ||
@@ -99,6 +97,6 @@ .on("touchstart.zoom", touchstart) | ||
moved = 0, | ||
w = d3.select(window).on("mousemove.zoom", mousemove).on("mouseup.zoom", mouseup), | ||
w = d3.select(d3_window).on("mousemove.zoom", mousemove).on("mouseup.zoom", mouseup), | ||
l = location(d3.mouse(target)); | ||
window.focus(); | ||
d3_window.focus(); | ||
d3_eventCancel(); | ||
@@ -180,32 +178,8 @@ | ||
var d3_behavior_zoomDiv, // for interpreting mousewheel events | ||
d3_behavior_zoomInfinity = [0, Infinity]; // default scale extent | ||
var d3_behavior_zoomInfinity = [0, Infinity]; // default scale extent | ||
function d3_behavior_zoomDelta() { | ||
// mousewheel events are totally broken! | ||
// https://bugs.webkit.org/show_bug.cgi?id=40441 | ||
// not only that, but Chrome and Safari differ in re. to acceleration! | ||
if (!d3_behavior_zoomDiv) { | ||
d3_behavior_zoomDiv = d3.select("body").append("div") | ||
.style("visibility", "hidden") | ||
.style("top", 0) | ||
.style("height", 0) | ||
.style("width", 0) | ||
.style("overflow-y", "scroll") | ||
.append("div") | ||
.style("height", "2000px") | ||
.node().parentNode; | ||
} | ||
var e = d3.event, delta; | ||
try { | ||
d3_behavior_zoomDiv.scrollTop = 1000; | ||
d3_behavior_zoomDiv.dispatchEvent(e); | ||
delta = 1000 - d3_behavior_zoomDiv.scrollTop; | ||
} catch (error) { | ||
delta = e.wheelDelta || (-e.detail * 5); | ||
} | ||
return delta; | ||
} | ||
// https://developer.mozilla.org/en-US/docs/Mozilla_event_reference/wheel | ||
var d3_behavior_zoomDelta, d3_behavior_zoomWheel | ||
= "onwheel" in document ? (d3_behavior_zoomDelta = function() { return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); }, "wheel") | ||
: "onmousewheel" in document ? (d3_behavior_zoomDelta = function() { return d3.event.wheelDelta; }, "mousewheel") | ||
: (d3_behavior_zoomDelta = function() { return -d3.event.detail; }, "MozMousePixelScroll"); |
try { | ||
document.createElement("div").style.setProperty("opacity", 0, ""); | ||
d3_document.createElement("div").style.setProperty("opacity", 0, ""); | ||
} catch (error) { | ||
var d3_style_prototype = CSSStyleDeclaration.prototype, | ||
var d3_style_prototype = d3_window.CSSStyleDeclaration.prototype, | ||
d3_style_setProperty = d3_style_prototype.setProperty; | ||
@@ -6,0 +6,0 @@ d3_style_prototype.setProperty = function(name, value, priority) { |
@@ -1,4 +0,4 @@ | ||
require("./core/core"); | ||
var d3 = require("../index"); | ||
require("util").puts(JSON.stringify({ | ||
console.log(JSON.stringify({ | ||
"name": "d3", | ||
@@ -5,0 +5,0 @@ "version": d3.version, |
@@ -14,3 +14,3 @@ var d3_array = d3_arraySlice; // conversion for NodeLists | ||
try { | ||
d3_array(document.documentElement.childNodes)[0].nodeType; | ||
d3_array(d3_document.documentElement.childNodes)[0].nodeType; | ||
} catch(e) { | ||
@@ -17,0 +17,0 @@ d3_array = d3_arrayCopy; |
@@ -1,7 +0,8 @@ | ||
d3 = {version: "3.0.5"}; // semver | ||
var π = Math.PI, | ||
ε = 1e-6, | ||
d3 = {version: "3.0.6"}, // semver | ||
d3_radians = π / 180, | ||
d3_degrees = 180 / π; | ||
d3_degrees = 180 / π, | ||
d3_document = document, | ||
d3_window = window; | ||
@@ -8,0 +9,0 @@ function d3_target(d) { |
@@ -98,7 +98,7 @@ d3.format = function(specifier) { | ||
f: function(x, p) { return x.toFixed(p); }, | ||
r: function(x, p) { return d3.round(x, p = d3_format_precision(x, p)).toFixed(Math.max(0, Math.min(20, p))); } | ||
r: function(x, p) { return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p)))); } | ||
}); | ||
function d3_format_precision(x, p) { | ||
return p - (x ? 1 + Math.floor(Math.log(x + Math.pow(10, 1 + Math.floor(Math.log(x) / Math.LN10) - p)) / Math.LN10) : 1); | ||
return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1); | ||
} | ||
@@ -105,0 +105,0 @@ |
@@ -1,2 +0,2 @@ | ||
var d3_formatPrefixes = ["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix); | ||
var d3_formatPrefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix); | ||
@@ -3,0 +3,0 @@ d3.formatPrefix = function(value, precision) { |
@@ -6,5 +6,5 @@ d3.html = function(url, callback) { | ||
function d3_html(request) { | ||
var range = document.createRange(); | ||
range.selectNode(document.body); | ||
var range = d3_document.createRange(); | ||
range.selectNode(d3_document.body); | ||
return range.createContextualFragment(request.responseText); | ||
} |
@@ -6,3 +6,3 @@ d3.mouse = function(container) { | ||
// https://bugs.webkit.org/show_bug.cgi?id=44083 | ||
var d3_mouse_bug44083 = /WebKit/.test(navigator.userAgent) ? -1 : 0; | ||
var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0; | ||
@@ -13,5 +13,4 @@ function d3_mousePoint(container, e) { | ||
var point = svg.createSVGPoint(); | ||
if (d3_mouse_bug44083 < 0 && (window.scrollX || window.scrollY)) { | ||
svg = d3.select(document.body) | ||
.append("svg") | ||
if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) { | ||
svg = d3.select(d3_document.body).append("svg") | ||
.style("position", "absolute") | ||
@@ -18,0 +17,0 @@ .style("top", 0) |
@@ -16,9 +16,6 @@ d3.random = { | ||
}, | ||
logNormal: function(µ, σ) { | ||
var n = arguments.length; | ||
if (n < 2) σ = 1; | ||
if (n < 1) µ = 0; | ||
var random = d3.random.normal(); | ||
logNormal: function() { | ||
var random = d3.random.normal.apply(d3, arguments); | ||
return function() { | ||
return Math.exp(µ + σ * random()); | ||
return Math.exp(random()); | ||
}; | ||
@@ -25,0 +22,0 @@ }, |
@@ -7,7 +7,7 @@ // TODO append(node)? | ||
function append() { | ||
return this.appendChild(document.createElementNS(this.namespaceURI, name)); | ||
return this.appendChild(d3_document.createElementNS(this.namespaceURI, name)); | ||
} | ||
function appendNS() { | ||
return this.appendChild(document.createElementNS(name.space, name.local)); | ||
return this.appendChild(d3_document.createElementNS(name.space, name.local)); | ||
} | ||
@@ -14,0 +14,0 @@ |
@@ -9,3 +9,3 @@ // TODO insert(node, function)? | ||
return this.insertBefore( | ||
document.createElementNS(this.namespaceURI, name), | ||
d3_document.createElementNS(this.namespaceURI, name), | ||
d3_select(before, this)); | ||
@@ -16,3 +16,3 @@ } | ||
return this.insertBefore( | ||
document.createElementNS(name.space, name.local), | ||
d3_document.createElementNS(name.space, name.local), | ||
d3_select(before, this)); | ||
@@ -19,0 +19,0 @@ } |
@@ -1,2 +0,2 @@ | ||
var d3_selectionRoot = d3_selection([[document]]); | ||
var d3_selectionRoot = d3_selection([[d3_document]]); | ||
@@ -3,0 +3,0 @@ d3_selectionRoot[0].parentNode = d3_selectRoot; |
@@ -10,4 +10,4 @@ d3_selectionPrototype.sort = function(comparator) { | ||
return function(a, b) { | ||
return comparator(a && a.__data__, b && b.__data__); | ||
return (!a - !b) || comparator(a.__data__, b.__data__); | ||
}; | ||
} |
@@ -16,3 +16,3 @@ d3_selectionPrototype.style = function(name, value, priority) { | ||
// For style(string), return the computed style value for the first node. | ||
if (n < 2) return getComputedStyle(this.node(), null).getPropertyValue(name); | ||
if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name); | ||
@@ -19,0 +19,0 @@ // For style(string, string) or style(string, function), use the default |
@@ -8,3 +8,3 @@ function d3_selection(groups) { | ||
d3_selectAll = function(s, n) { return n.querySelectorAll(s); }, | ||
d3_selectRoot = document.documentElement, | ||
d3_selectRoot = d3_document.documentElement, | ||
d3_selectMatcher = d3_selectRoot.matchesSelector || d3_selectRoot.webkitMatchesSelector || d3_selectRoot.mozMatchesSelector || d3_selectRoot.msMatchesSelector || d3_selectRoot.oMatchesSelector, | ||
@@ -11,0 +11,0 @@ d3_selectMatches = function(n, s) { return d3_selectMatcher.call(n, s); }; |
@@ -93,7 +93,7 @@ var d3_timer_id = 0, | ||
var d3_timer_frame = window.requestAnimationFrame | ||
|| window.webkitRequestAnimationFrame | ||
|| window.mozRequestAnimationFrame | ||
|| window.oRequestAnimationFrame | ||
|| window.msRequestAnimationFrame | ||
var d3_timer_frame = d3_window.requestAnimationFrame | ||
|| d3_window.webkitRequestAnimationFrame | ||
|| d3_window.mozRequestAnimationFrame | ||
|| d3_window.oRequestAnimationFrame | ||
|| d3_window.msRequestAnimationFrame | ||
|| function(callback) { setTimeout(callback, 17); }; |
d3.transform = function(string) { | ||
var g = document.createElementNS(d3.ns.prefix.svg, "g"); | ||
var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); | ||
return (d3.transform = function(string) { | ||
@@ -4,0 +4,0 @@ g.setAttribute("transform", string); |
@@ -34,3 +34,3 @@ d3_transitionPrototype.style = function(name, value, priority) { | ||
function styleString() { | ||
var a = getComputedStyle(this, null).getPropertyValue(name), i; | ||
var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i; | ||
return a !== b && (i = interpolate(a, b), function(t) { this.style.setProperty(name, i(t), priority); }); | ||
@@ -47,5 +47,5 @@ } | ||
return this.tween("style." + name, function(d, i) { | ||
var f = tween.call(this, d, i, getComputedStyle(this, null).getPropertyValue(name)); | ||
var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name)); | ||
return f && function(t) { this.style.setProperty(name, f(t), priority); }; | ||
}); | ||
}; |
@@ -6,3 +6,3 @@ d3.xhr = function(url, mimeType, callback) { | ||
response = d3_identity, | ||
request = new (window.XDomainRequest && /^(http(s)?:)?\/\//.test(url) ? XDomainRequest : XMLHttpRequest); | ||
request = new (d3_window.XDomainRequest && /^(http(s)?:)?\/\//.test(url) ? XDomainRequest : XMLHttpRequest); | ||
@@ -9,0 +9,0 @@ "onload" in request |
@@ -1,1 +0,1 @@ | ||
})(); | ||
return d3;})(); |
@@ -8,3 +8,4 @@ d3.geo.area = function(object) { | ||
var d3_geo_areaSum, | ||
d3_geo_areaRing; | ||
d3_geo_areaRingU, | ||
d3_geo_areaRingV; | ||
@@ -19,7 +20,8 @@ var d3_geo_area = { | ||
polygonStart: function() { | ||
d3_geo_areaRing = 0; | ||
d3_geo_areaRingU = 1, d3_geo_areaRingV = 0; | ||
d3_geo_area.lineStart = d3_geo_areaRingStart; | ||
}, | ||
polygonEnd: function() { | ||
d3_geo_areaSum += d3_geo_areaRing < 0 ? 4 * π + d3_geo_areaRing : d3_geo_areaRing; | ||
var area = 2 * Math.atan2(d3_geo_areaRingV, d3_geo_areaRingU); | ||
d3_geo_areaSum += area < 0 ? 4 * π + area : area; | ||
d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop; | ||
@@ -30,3 +32,3 @@ } | ||
function d3_geo_areaRingStart() { | ||
var λ00, φ00, λ1, λ0, φ0, cosφ0, sinφ0; // start point and two previous points | ||
var λ00, φ00, λ0, cosφ0, sinφ0; // start point and two previous points | ||
@@ -36,3 +38,3 @@ // For the first point, … | ||
d3_geo_area.point = nextPoint; | ||
λ1 = λ0 = (λ00 = λ) * d3_radians, φ0 = (φ00 = φ) * d3_radians, cosφ0 = Math.cos(φ0), sinφ0 = Math.sin(φ0); | ||
λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), sinφ0 = Math.sin(φ); | ||
}; | ||
@@ -42,30 +44,22 @@ | ||
function nextPoint(λ, φ) { | ||
λ *= d3_radians, φ *= d3_radians; | ||
λ *= d3_radians; | ||
φ = φ * d3_radians / 2 + π / 4; // half the angular distance from south pole | ||
// If both the current point and the previous point are polar, skip this point. | ||
if (Math.abs(Math.abs(φ0) - π / 2) < ε && Math.abs(Math.abs(φ) - π / 2) < ε) return; | ||
var cosφ = Math.cos(φ), sinφ = Math.sin(φ); | ||
// Spherical excess E for a spherical triangle with vertices: south pole, | ||
// previous point, current point. Uses a formula derived from Cagnoli’s | ||
// theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2). | ||
var dλ = λ - λ0, | ||
cosφ = Math.cos(φ), | ||
sinφ = Math.sin(φ), | ||
k = sinφ0 * sinφ, | ||
u0 = d3_geo_areaRingU, | ||
v0 = d3_geo_areaRingV, | ||
u = cosφ0 * cosφ + k * Math.cos(dλ), | ||
v = k * Math.sin(dλ); | ||
// ∑ arg(z) = arg(∏ z), where z = u + iv. | ||
d3_geo_areaRingU = u0 * u - v0 * v; | ||
d3_geo_areaRingV = v0 * u + u0 * v; | ||
// If the previous point is at the north pole, then compute lune area. | ||
if (Math.abs(φ0 - π / 2) < ε) d3_geo_areaRing += (λ - λ1) * 2; | ||
// Area of spherical triangle with vertices at south pole, previous point | ||
// and current point = ER², where E is the spherical excess, and in our | ||
// case, R = 1. | ||
else { | ||
var dλ = λ - λ0, | ||
cosdλ = Math.cos(dλ), | ||
// Distance from previous point to current point, well-conditioned | ||
// for all angles. | ||
d = Math.atan2(Math.sqrt((d = cosφ * Math.sin(dλ)) * d + (d = cosφ0 * sinφ - sinφ0 * cosφ * cosdλ) * d), sinφ0 * sinφ + cosφ0 * cosφ * cosdλ), | ||
// Half the semiperimeter (a + b + c) / 2, where a, b and c are the | ||
// lengths of the triangle sides. | ||
s = (d + π + φ0 + φ) / 4; | ||
// Compute the spherical excess E using l’Huilier’s theorem, | ||
// tan(E / 4) = √[tan(s)tan(s - a / 2)tan(s - b / 2)tan(s - c / 2)]. | ||
d3_geo_areaRing += (dλ < 0 && dλ > -π || dλ > π ? -4 : 4) * Math.atan(Math.sqrt(Math.abs(Math.tan(s) * Math.tan(s - d / 2) * Math.tan(s - π / 4 - φ0 / 2) * Math.tan(s - π / 4 - φ / 2)))); | ||
} | ||
// Advance the previous points. | ||
λ1 = λ0, λ0 = λ, φ0 = φ, cosφ0 = cosφ, sinφ0 = sinφ; | ||
λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ; | ||
} | ||
@@ -72,0 +66,0 @@ |
@@ -60,6 +60,6 @@ // Adapted from Nicolas Garcia Belmonte's JIT implementation: | ||
cy = vertices[i][1], | ||
angle = polygon.map(function(v) { return Math.atan2(v[0] - cx, v[1] - cy); }); | ||
return d3.range(polygon.length) | ||
.sort(function(a, b) { return angle[a] - angle[b]; }) | ||
.filter(function(d, i, order) { return !i || (angle[d] - angle[order[i - 1]] > ε); }) | ||
angle = polygon.map(function(v) { return Math.atan2(v[0] - cx, v[1] - cy); }), | ||
order = d3.range(polygon.length).sort(function(a, b) { return angle[a] - angle[b]; }); | ||
return order | ||
.filter(function(d, i) { return !i || (angle[d] - angle[order[i - 1]] > ε); }) | ||
.map(function(d) { return polygon[d]; }); | ||
@@ -66,0 +66,0 @@ }); |
@@ -138,3 +138,3 @@ // A rudimentary force layout using Gauss-Seidel. | ||
if (!arguments.length) return linkDistance; | ||
linkDistance = d3_functor(x); | ||
linkDistance = typeof x === "function" ? x : +x; | ||
return force; | ||
@@ -148,3 +148,3 @@ }; | ||
if (!arguments.length) return linkStrength; | ||
linkStrength = d3_functor(x); | ||
linkStrength = typeof x === "function" ? x : +x; | ||
return force; | ||
@@ -155,3 +155,3 @@ }; | ||
if (!arguments.length) return friction; | ||
friction = x; | ||
friction = +x; | ||
return force; | ||
@@ -168,3 +168,3 @@ }; | ||
if (!arguments.length) return gravity; | ||
gravity = x; | ||
gravity = +x; | ||
return force; | ||
@@ -175,3 +175,3 @@ }; | ||
if (!arguments.length) return theta; | ||
theta = x; | ||
theta = +x; | ||
return force; | ||
@@ -183,2 +183,3 @@ }; | ||
x = +x; | ||
if (alpha) { // if we're already running | ||
@@ -210,4 +211,2 @@ if (x > 0) alpha = x; // we might keep it hot | ||
distances = []; | ||
strengths = []; | ||
for (i = 0; i < m; ++i) { | ||
@@ -217,4 +216,2 @@ o = links[i]; | ||
if (typeof o.target == "number") o.target = nodes[o.target]; | ||
distances[i] = linkDistance.call(this, o, i); | ||
strengths[i] = linkStrength.call(this, o, i); | ||
++o.source.weight; | ||
@@ -232,12 +229,13 @@ ++o.target.weight; | ||
distances = []; | ||
if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); | ||
else for (i = 0; i < m; ++i) distances[i] = linkDistance; | ||
strengths = []; | ||
if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); | ||
else for (i = 0; i < m; ++i) strengths[i] = linkStrength; | ||
charges = []; | ||
if (typeof charge === "function") { | ||
for (i = 0; i < n; ++i) { | ||
charges[i] = +charge.call(this, nodes[i], i); | ||
} | ||
} else { | ||
for (i = 0; i < n; ++i) { | ||
charges[i] = charge; | ||
} | ||
} | ||
if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); | ||
else for (i = 0; i < n; ++i) charges[i] = charge; | ||
@@ -285,6 +283,8 @@ // initialize node position based on first neighbor | ||
.origin(d3_identity) | ||
.on("dragstart", d3_layout_forceDragstart) | ||
.on("drag", dragmove) | ||
.on("dragend", d3_layout_forceDragend); | ||
.on("dragstart.force", d3_layout_forceDragstart) | ||
.on("drag.force", dragmove) | ||
.on("dragend.force", d3_layout_forceDragend); | ||
if (!arguments.length) return drag; | ||
this.on("mouseover.force", d3_layout_forceMouseover) | ||
@@ -314,3 +314,3 @@ .on("mouseout.force", d3_layout_forceMouseout) | ||
function d3_layout_forceDragend(d) { | ||
d.fixed &= 1; // unset bits 2 and 3 | ||
d.fixed &= ~6; // unset bits 2 and 3 | ||
} | ||
@@ -324,3 +324,3 @@ | ||
function d3_layout_forceMouseout(d) { | ||
d.fixed &= 3; // unset bit 3 | ||
d.fixed &= ~4; // unset bit 3 | ||
} | ||
@@ -361,8 +361,3 @@ | ||
function d3_layout_forceLinkDistance() { | ||
return 20; | ||
} | ||
function d3_layout_forceLinkStrength() { | ||
return 1; | ||
} | ||
var d3_layout_forceLinkDistance = 20, | ||
d3_layout_forceLinkStrength = 1; |
@@ -1,4 +0,4 @@ | ||
require("./core/core"); | ||
var d3 = require("../index"); | ||
require("util").puts(JSON.stringify({ | ||
console.log(JSON.stringify({ | ||
"name": "d3", | ||
@@ -5,0 +5,0 @@ "version": d3.version, |
@@ -1,1 +0,1 @@ | ||
(function(){ | ||
d3 = (function(){ |
d3.svg.axis = function() { | ||
var scale = d3.scale.linear(), | ||
orient = "bottom", | ||
orient = d3_svg_axisDefaultOrient, | ||
tickMajorSize = 6, | ||
@@ -23,4 +23,4 @@ tickMinorSize = 6, | ||
var subticks = d3_svg_axisSubdivide(scale, ticks, tickSubdivide), | ||
subtick = g.selectAll(".minor").data(subticks, String), | ||
subtickEnter = subtick.enter().insert("line", "g").attr("class", "tick minor").style("opacity", 1e-6), | ||
subtick = g.selectAll(".tick.minor").data(subticks, String), | ||
subtickEnter = subtick.enter().insert("line", ".tick").attr("class", "tick minor").style("opacity", 1e-6), | ||
subtickExit = d3.transition(subtick.exit()).style("opacity", 1e-6).remove(), | ||
@@ -30,4 +30,4 @@ subtickUpdate = d3.transition(subtick).style("opacity", 1); | ||
// Major ticks. | ||
var tick = g.selectAll("g").data(ticks, String), | ||
tickEnter = tick.enter().insert("g", "path").style("opacity", 1e-6), | ||
var tick = g.selectAll(".tick.major").data(ticks, String), | ||
tickEnter = tick.enter().insert("g", "path").attr("class", "tick major").style("opacity", 1e-6), | ||
tickExit = d3.transition(tick.exit()).style("opacity", 1e-6).remove(), | ||
@@ -40,3 +40,3 @@ tickUpdate = d3.transition(tick).style("opacity", 1), | ||
path = g.selectAll(".domain").data([0]), | ||
pathUpdate = d3.transition(path); | ||
pathUpdate = (path.enter().append("path").attr("class", "domain"), d3.transition(path)); | ||
@@ -48,4 +48,3 @@ // Stash a snapshot of the new scale, and retrieve the old snapshot. | ||
path.enter().append("path").attr("class", "domain"); | ||
tickEnter.append("line").attr("class", "tick"); | ||
tickEnter.append("line"); | ||
tickEnter.append("text"); | ||
@@ -142,3 +141,3 @@ | ||
if (!arguments.length) return orient; | ||
orient = x; | ||
orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient; | ||
return axis; | ||
@@ -189,2 +188,5 @@ }; | ||
var d3_svg_axisDefaultOrient = "bottom", | ||
d3_svg_axisOrients = {top: 1, right: 1, bottom: 1, left: 1}; | ||
function d3_svg_axisX(selection, x) { | ||
@@ -191,0 +193,0 @@ selection.attr("transform", function(d) { return "translate(" + x(d) + ",0)"; }); |
@@ -96,3 +96,3 @@ d3.svg.brush = function() { | ||
var w = d3.select(window) | ||
var w = d3.select(d3_window) | ||
.on("mousemove.brush", brushmove) | ||
@@ -99,0 +99,0 @@ .on("mouseup.brush", brushend) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
0
700427
17452