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

Function thresholdFormat

docs/app/js/sanddance-app.js:127231–127237  ·  view source on GitHub ↗
(locale, scale14, specifier)

Source from the content-addressed store, hash-verified

127229 return scale13.bins ? binValues(scale13.bins) : scale13.type === Log ? tickLog(scale13, count, true) : symbols[scale13.type] ? thresholdValues(scale13[symbols[scale13.type]]()) : tickValues(scale13, count);
127230}
127231function thresholdFormat(locale, scale14, specifier) {
127232 const _ = scale14[formats[scale14.type]](), n = _.length;
127233 let d = n > 1 ? _[1] - _[0] : _[0], i;
127234 for(i = 1; i < n; ++i)d = Math.min(d, _[i] - _[i - 1]);
127235 // tickCount = 3 ticks times 10 for increased resolution
127236 return locale.formatSpan(0, d, 30, specifier);
127237}
127238function thresholdValues(thresholds) {
127239 const values = [
127240 -Infinity

Callers 1

labelFormatFunction · 0.70

Calls 1

minMethod · 0.45

Tested by

no test coverage detected