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

Function padDomain

docs/app/js/sanddance-app.js:130028–130034  ·  view source on GitHub ↗
(type, domain, range, pad, exponent, constant)

Source from the content-addressed store, hash-verified

130026 } else return -1;
130027}
130028function padDomain(type, domain, range, pad, exponent, constant) {
130029 var span = Math.abs((0, _vegaUtil.peek)(range) - range[0]), frac = span / (span - 2 * pad), d = type === (0, _vegaScale.Log) ? (0, _vegaUtil.zoomLog)(domain, null, frac) : type === (0, _vegaScale.Sqrt) ? (0, _vegaUtil.zoomPow)(domain, null, frac, 0.5) : type === (0, _vegaScale.Pow) ? (0, _vegaUtil.zoomPow)(domain, null, frac, exponent || 1) : type === (0, _vegaScale.Symlog) ? (0, _vegaUtil.zoomSymlog)(domain, null, frac, constant || 1) : (0, _vegaUtil.zoomLinear)(domain, null, frac);
130030 domain = domain.slice();
130031 domain[0] = d[0];
130032 domain[domain.length - 1] = d[1];
130033 return domain;
130034}
130035function domainCheck(type, domain, df) {
130036 if ((0, _vegaScale.isLogarithmic)(type)) {
130037 // sum signs of domain values

Callers 1

configureDomainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected