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

Function domainCheck

docs/app/js/sanddance-app.js:130035–130043  ·  view source on GitHub ↗
(type, domain, df)

Source from the content-addressed store, hash-verified

130033 return domain;
130034}
130035function domainCheck(type, domain, df) {
130036 if ((0, _vegaScale.isLogarithmic)(type)) {
130037 // sum signs of domain values
130038 // if all pos or all neg, abs(sum) === domain.length
130039 var s1 = Math.abs(domain.reduce((s, v)=>s + (v < 0 ? -1 : v > 0 ? 1 : 0), 0));
130040 if (s1 !== domain.length) df.warn("Log scale domain includes zero: " + (0, _vegaUtil.stringValue)(domain));
130041 }
130042 return domain;
130043}
130044function configureBins(scale, _, count) {
130045 let bins = _.bins;
130046 if (bins && !(0, _vegaUtil.isArray)(bins)) {

Callers 2

configureDomainFunction · 0.70
rawDomainFunction · 0.70

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected