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

Function parseScale

docs/tests/v2/es6/js/sanddance.js:133543–133568  ·  view source on GitHub ↗
(spec, scope)

Source from the content-addressed store, hash-verified

133541}
133542
133543function parseScale(spec, scope) {
133544 var params = scope.getScale(spec.name).params,
133545 key;
133546 params.domain = parseScaleDomain(spec.domain, spec, scope);
133547
133548 if (spec.range != null) {
133549 params.range = parseScaleRange(spec, scope, params);
133550 }
133551
133552 if (spec.interpolate != null) {
133553 parseScaleInterpolate(spec.interpolate, params);
133554 }
133555
133556 if (spec.nice != null) {
133557 params.nice = parseScaleNice(spec.nice);
133558 }
133559
133560 if (spec.bins != null) {
133561 params.bins = parseScaleBins(spec.bins, scope);
133562 }
133563
133564 for (key in spec) {
133565 if ((0, _vegaUtil.hasOwnProperty)(params, key) || key === 'name') continue;
133566 params[key] = parseLiteral(spec[key], scope);
133567 }
133568}
133569
133570function parseLiteral(v, scope) {
133571 return !(0, _vegaUtil.isObject)(v) ? v : v.signal ? scope.signalRef(v.signal) : (0, _vegaUtil.error)('Unsupported object: ' + (0, _vegaUtil.stringValue)(v));

Callers

nothing calls this directly

Calls 7

parseScaleDomainFunction · 0.70
parseScaleRangeFunction · 0.70
parseScaleInterpolateFunction · 0.70
parseScaleNiceFunction · 0.70
parseScaleBinsFunction · 0.70
parseLiteralFunction · 0.70
getScaleMethod · 0.45

Tested by

no test coverage detected