MCPcopy Index your code
hub / github.com/microsoft/SandDance / legendType

Function legendType

docs/app/js/sanddance-app.js:148541–148545  ·  view source on GitHub ↗
(spec, scaleType)

Source from the content-addressed store, hash-verified

148539 }), scope);
148540}
148541function legendType(spec, scaleType) {
148542 let type = spec.type || Symbols;
148543 if (!spec.type && scaleCount(spec) === 1 && (spec.fill || spec.stroke)) type = (0, _vegaScale.isContinuous)(scaleType) ? Gradient : (0, _vegaScale.isDiscretizing)(scaleType) ? Discrete : Symbols;
148544 return type !== Gradient ? type : (0, _vegaScale.isDiscretizing)(scaleType) ? Discrete : Gradient;
148545}
148546function scaleCount(spec) {
148547 return LegendScales.reduce((count, type)=>count + (spec[type] ? 1 : 0), 0);
148548}

Callers 1

parseLegendFunction · 0.70

Calls 1

scaleCountFunction · 0.70

Tested by

no test coverage detected