Minor simplifications.
Removes a few extraneous parentheses that aren't needed due to operator precedence.
This commit is contained in:
Родитель
38a6c302de
Коммит
82af000cbf
|
@ -38,7 +38,7 @@ d3.format = function(specifier) {
|
|||
if (integer && (value % 1)) return "";
|
||||
|
||||
// Convert negative to positive, and record the sign prefix.
|
||||
var negative = (value < 0) && (value = -value) ? "-" : sign;
|
||||
var negative = value < 0 && (value = -value) ? "-" : sign;
|
||||
|
||||
// Apply the scale, computing it from the value's exponent for si format.
|
||||
if (scale < 0) {
|
||||
|
|
|
@ -254,7 +254,7 @@ function d3_interpolateByName(name) {
|
|||
|
||||
d3.interpolators = [
|
||||
d3.interpolateObject,
|
||||
function(a, b) { return (b instanceof Array) && d3.interpolateArray(a, b); },
|
||||
function(a, b) { return b instanceof Array && d3.interpolateArray(a, b); },
|
||||
function(a, b) { return (typeof a === "string" || typeof b === "string") && d3.interpolateString(a + "", b + ""); },
|
||||
function(a, b) { return (typeof b === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) : b instanceof d3_Rgb || b instanceof d3_Hsl) && d3.interpolateRgb(a, b); },
|
||||
function(a, b) { return !isNaN(a = +a) && !isNaN(b = +b) && d3.interpolateNumber(a, b); }
|
||||
|
|
|
@ -9,7 +9,7 @@ function d3_mousePoint(container, e) {
|
|||
var svg = container.ownerSVGElement || container;
|
||||
if (svg.createSVGPoint) {
|
||||
var point = svg.createSVGPoint();
|
||||
if ((d3_mouse_bug44083 < 0) && (window.scrollX || window.scrollY)) {
|
||||
if (d3_mouse_bug44083 < 0 && (window.scrollX || window.scrollY)) {
|
||||
svg = d3.select(document.body)
|
||||
.append("svg")
|
||||
.style("position", "absolute")
|
||||
|
|
|
@ -70,7 +70,7 @@ function d3_dsv(delimiter, mimeType) {
|
|||
|
||||
while ((t = token()) !== EOF) {
|
||||
var a = [];
|
||||
while ((t !== EOL) && (t !== EOF)) {
|
||||
while (t !== EOL && t !== EOF) {
|
||||
a.push(t);
|
||||
t = token();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ d3.layout.histogram = function() {
|
|||
if (m > 0) {
|
||||
i = -1; while(++i < n) {
|
||||
x = values[i];
|
||||
if ((x >= range[0]) && (x <= range[1])) {
|
||||
if (x >= range[0] && x <= range[1]) {
|
||||
bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
|
||||
bin.y += k;
|
||||
bin.push(data[i]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче