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

Function scaleKey

docs/tests/v2/es6/js/sanddance.js:110969–110982  ·  view source on GitHub ↗
(_)

Source from the content-addressed store, hash-verified

110967};
110968
110969function scaleKey(_) {
110970 var t = _.type,
110971 d = '',
110972 n; // backwards compatibility pre Vega 5.
110973
110974 if (t === _vegaScale.Sequential) return _vegaScale.Sequential + '-' + _vegaScale.Linear;
110975
110976 if (isContinuousColor(_)) {
110977 n = _.rawDomain ? _.rawDomain.length : _.domain ? _.domain.length + +(_.domainMid != null) : 0;
110978 d = n === 2 ? _vegaScale.Sequential + '-' : n === 3 ? _vegaScale.Diverging + '-' : '';
110979 }
110980
110981 return (d + t || _vegaScale.Linear).toLowerCase();
110982}
110983
110984function isContinuousColor(_) {
110985 const t = _.type;

Callers 1

sanddance.jsFile · 0.70

Calls 1

isContinuousColorFunction · 0.70

Tested by

no test coverage detected