MCPcopy Create free account
hub / github.com/microsoft/SandDance / thresholdFormat

Function thresholdFormat

docs/tests/v2/es6/js/sanddance.js:110410–110422  ·  view source on GitHub ↗
(scale, specifier)

Source from the content-addressed store, hash-verified

110408}
110409
110410function thresholdFormat(scale, specifier) {
110411 var _ = scale[formats[scale.type]](),
110412 n = _.length,
110413 d = n > 1 ? _[1] - _[0] : _[0],
110414 i;
110415
110416 for (i = 1; i < n; ++i) {
110417 d = Math.min(d, _[i] - _[i - 1]);
110418 } // 3 ticks times 10 for increased resolution
110419
110420
110421 return (0, _vegaScale.tickFormat)(0, d, 3 * 10, specifier);
110422}
110423
110424function thresholdValues(thresholds) {
110425 const values = [-Infinity].concat(thresholds);

Callers 1

labelFormatFunction · 0.70

Calls 1

minMethod · 0.45

Tested by

no test coverage detected