MCPcopy Index your code
hub / github.com/microsoft/SandDance / tickLog

Function tickLog

docs/app/js/sanddance-app.js:127210–127218  ·  view source on GitHub ↗
(scale12, count, values)

Source from the content-addressed store, hash-verified

127208 return format1;
127209}
127210function tickLog(scale12, count, values) {
127211 const ticks = tickValues(scale12, count), base = scale12.base(), logb = Math.log(base), k = Math.max(1, base * count / ticks.length); // apply d3-scale's log format filter criteria
127212 const test = (d)=>{
127213 let i = d / Math.pow(base, Math.round(Math.log(d) / logb));
127214 if (i * base < base - 0.5) i *= base;
127215 return i <= k;
127216 };
127217 return values ? ticks.filter(test) : test;
127218}
127219const symbols = {
127220 [Quantile]: "quantiles",
127221 [Quantize]: "thresholds",

Callers 2

tickFormatFunction · 0.70
labelValuesFunction · 0.70

Calls 4

tickValuesFunction · 0.70
logMethod · 0.45
maxMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected