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

Function scaleKey

docs/app/js/sanddance-app.js:129978–129986  ·  view source on GitHub ↗
(_)

Source from the content-addressed store, hash-verified

129976 }
129977});
129978function scaleKey(_) {
129979 var t = _.type, d = "", n; // backwards compatibility pre Vega 5.
129980 if (t === (0, _vegaScale.Sequential)) return (0, _vegaScale.Sequential) + "-" + (0, _vegaScale.Linear);
129981 if (isContinuousColor(_)) {
129982 n = _.rawDomain ? _.rawDomain.length : _.domain ? _.domain.length + +(_.domainMid != null) : 0;
129983 d = n === 2 ? (0, _vegaScale.Sequential) + "-" : n === 3 ? (0, _vegaScale.Diverging) + "-" : "";
129984 }
129985 return (d + t || (0, _vegaScale.Linear)).toLowerCase();
129986}
129987function isContinuousColor(_) {
129988 const t = _.type;
129989 return (0, _vegaScale.isContinuous)(t) && t !== (0, _vegaScale.Time) && t !== (0, _vegaScale.UTC) && (_.scheme || _.range && _.range.length && _.range.every((0, _vegaUtil.isString)));

Callers 1

transformFunction · 0.70

Calls 1

isContinuousColorFunction · 0.70

Tested by

no test coverage detected