@easyv/utils
Advanced tools
Comparing version 0.0.25 to 0.0.26
@@ -74,17 +74,22 @@ "use strict"; | ||
return fmt; | ||
} | ||
} // export function getTicksOfAxis(domain, count) { | ||
// var len = domain.length; | ||
// let ticksCount = Math.round(count); | ||
// if (ticksCount < 2 || ticksCount > len) return domain; | ||
// let newDomain = []; | ||
// for (let i = 0; i < ticksCount; i++) { | ||
// let a = Math.round(((len - 1) / (ticksCount - 1)) * i); | ||
// newDomain.push(domain[a]); | ||
// } | ||
// return newDomain; | ||
// } | ||
function getTicksOfAxis(domain, count) { | ||
function getTicksOfAxis(domain, ticksCount) { | ||
var len = domain.length; | ||
var ticksCount = Math.round(count); | ||
if (ticksCount < 2 || ticksCount > len) return domain; | ||
var newDomain = []; | ||
for (var i = 0; i < ticksCount; i++) { | ||
var _a = Math.round((len - 1) / (ticksCount - 1) * i); | ||
newDomain.push(domain[_a]); | ||
} | ||
return newDomain; | ||
var step = Math.floor((len - ticksCount) / (ticksCount - 1)); | ||
return domain.filter(function (d, i) { | ||
return i % (step + 1) === 0; | ||
}); | ||
} | ||
@@ -91,0 +96,0 @@ |
{ | ||
"name": "@easyv/utils", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
162088
4134