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

Function parseTitle

docs/app/js/sanddance-app.js:148583–148606  ·  view source on GitHub ↗
(spec, scope)

Source from the content-addressed store, hash-verified

148581}
148582const angleExpr = `item.orient==="${Left}"?-90:item.orient==="${Right}"?90:0`;
148583function parseTitle(spec, scope) {
148584 spec = (0, _vegaUtil.isString)(spec) ? {
148585 text: spec
148586 } : spec;
148587 const _ = lookup(spec, scope.config.title), encode = spec.encode || {}, userEncode = encode.group || {}, name = userEncode.name || undefined, interactive3 = userEncode.interactive, style = userEncode.style, children = []; // single-element data source for group title
148588 const datum = {}, dataRef = ref(scope.add(Collect(null, [
148589 datum
148590 ]))); // include title text
148591 children.push(buildTitle(spec, _, titleEncode(spec), dataRef)); // include subtitle text
148592 if (spec.subtitle) children.push(buildSubTitle(spec, _, encode.subtitle, dataRef));
148593 // parse title specification
148594 return parseMark(guideGroup({
148595 role: TitleRole,
148596 from: dataRef,
148597 encode: groupEncode(_, userEncode),
148598 marks: children,
148599 aria: _("aria"),
148600 description: _("description"),
148601 zindex: _("zindex"),
148602 name,
148603 interactive: interactive3,
148604 style
148605 }), scope);
148606} // provide backwards-compatibility for title custom encode;
148607// the top-level encode block has been *deprecated*.
148608function titleEncode(spec) {
148609 const encode = spec.encode;

Callers 1

parseScopeFunction · 0.70

Calls 11

lookupFunction · 0.70
refFunction · 0.70
CollectFunction · 0.70
buildTitleFunction · 0.70
titleEncodeFunction · 0.70
buildSubTitleFunction · 0.70
parseMarkFunction · 0.70
guideGroupFunction · 0.70
groupEncodeFunction · 0.70
_Function · 0.70
addMethod · 0.45

Tested by

no test coverage detected