@visx/legend
Advanced tools
Comparing version 3.5.0 to 3.10.3
@@ -23,3 +23,2 @@ import _pt from "prop-types"; | ||
var scaleRange = scale.range(); | ||
var scaleDomain = scale.domain(); | ||
return function (d, i) { | ||
@@ -35,3 +34,3 @@ var _ref3 = scaleRange.length >= i ? scale.invertExtent(scaleRange[i]) : [undefined, undefined], | ||
delimiter = labelLower || delimiter; | ||
value = d1 - 1; | ||
value = d1 - Math.abs(2 * d1 - 1); // guarantees a value smaller than the lower threshold | ||
text = "" + delimiter + formatZero(labelFormat(d1, i)); | ||
@@ -45,3 +44,3 @@ } else if (d0 != null && d1 != null) { | ||
delimiter = labelUpper || delimiter; | ||
value = d0 + scaleDomain[1]; // x0,x1 are from the domain, so the domain is numeric if d0 is | ||
value = d0 + Math.abs(2 * d0 + 1); // // guarantees a value larger than the upper threshold | ||
text = "" + delimiter + formatZero(labelFormat(d0, i)); | ||
@@ -51,3 +50,3 @@ } | ||
extent: [d0, d1], | ||
value: scale(value || d), | ||
value: scale(value), | ||
text: text, | ||
@@ -77,2 +76,3 @@ datum: d, | ||
// because it should contain more elements | ||
var domain = inputDomain || scale.range().map(function (output) { | ||
@@ -79,0 +79,0 @@ return scale.invertExtent(output)[0]; |
@@ -25,3 +25,2 @@ "use strict"; | ||
var scaleRange = scale.range(); | ||
var scaleDomain = scale.domain(); | ||
return function (d, i) { | ||
@@ -37,3 +36,3 @@ var _ref3 = scaleRange.length >= i ? scale.invertExtent(scaleRange[i]) : [undefined, undefined], | ||
delimiter = labelLower || delimiter; | ||
value = d1 - 1; | ||
value = d1 - Math.abs(2 * d1 - 1); // guarantees a value smaller than the lower threshold | ||
text = "" + delimiter + formatZero(labelFormat(d1, i)); | ||
@@ -47,3 +46,3 @@ } else if (d0 != null && d1 != null) { | ||
delimiter = labelUpper || delimiter; | ||
value = d0 + scaleDomain[1]; // x0,x1 are from the domain, so the domain is numeric if d0 is | ||
value = d0 + Math.abs(2 * d0 + 1); // // guarantees a value larger than the upper threshold | ||
text = "" + delimiter + formatZero(labelFormat(d0, i)); | ||
@@ -53,3 +52,3 @@ } | ||
extent: [d0, d1], | ||
value: scale(value || d), | ||
value: scale(value), | ||
text: text, | ||
@@ -79,2 +78,3 @@ datum: d, | ||
// because it should contain more elements | ||
var domain = inputDomain || scale.range().map(function (output) { | ||
@@ -81,0 +81,0 @@ return scale.invertExtent(output)[0]; |
{ | ||
"name": "@visx/legend", | ||
"version": "3.5.0", | ||
"version": "3.10.3", | ||
"description": "visx legend", | ||
@@ -43,3 +43,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "015ceb786b2acb7f482214234720d930693b5e98" | ||
"gitHead": "ed021d77e3b7f50dfd45ec03055d0faef4ca0f7d" | ||
} |
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
90820
1527