MCPcopy
hub / github.com/microsoft/SandDance / labelFormat

Function labelFormat

docs/app/js/sanddance-app.js:127251–127254  ·  view source on GitHub ↗
(locale, scale16, count, type, specifier, formatType, noSkip)

Source from the content-addressed store, hash-verified

127249}
127250const isDiscreteRange = (scale15)=>symbols[scale15.type] || scale15.bins;
127251function labelFormat(locale, scale16, count, type, specifier, formatType, noSkip) {
127252 const format2 = formats[scale16.type] && formatType !== Time && formatType !== UTC ? thresholdFormat(locale, scale16, specifier) : tickFormat(locale, scale16, count, specifier, formatType, noSkip);
127253 return type === SymbolLegend && isDiscreteRange(scale16) ? formatRange(format2) : type === DiscreteLegend ? formatDiscrete(format2) : formatPoint(format2);
127254}
127255const formatRange = (format3)=>(value, index, array)=>{
127256 const limit = get(array[index + 1], get(array.max, Infinity)), lo = formatValue(value, format3), hi = formatValue(limit, format3);
127257 return lo && hi ? lo + " \u2013 " + hi : hi ? "< " + hi : "\u2265 " + lo;

Callers 1

formatFunction · 0.70

Calls 6

thresholdFormatFunction · 0.70
tickFormatFunction · 0.70
isDiscreteRangeFunction · 0.70
formatRangeFunction · 0.70
formatDiscreteFunction · 0.70
formatPointFunction · 0.70

Tested by

no test coverage detected