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

Function legendCaption

docs/app/js/sanddance-app.js:123980–123983  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

123978 return `${xy}-axis` + (title ? ` titled '${title}'` : "") + ` for a ${(0, _vegaScale.isDiscrete)(type22) ? "discrete" : type22} scale` + ` with ${(0, _vegaScale.domainCaption)(locale, scale1, item)}`;
123979}
123980function legendCaption(item) {
123981 const datum = item.datum, title = datum.title ? extractTitle(item) : null, type23 = `${datum.type || ""} legend`.trim(), scales = datum.scales, props = Object.keys(scales), ctx = item.context, scale2 = ctx.scales[scales[props[0]]].value, locale = ctx.dataflow.locale();
123982 return capitalize(type23) + (title ? ` titled '${title}'` : "") + ` for ${channelCaption(props)}` + ` with ${(0, _vegaScale.domainCaption)(locale, scale2, item)}`;
123983}
123984function extractTitle(item) {
123985 try {
123986 return (0, _vegaUtil.array)((0, _vegaUtil.peek)(item.items).items[0].text).join(" ");

Callers

nothing calls this directly

Calls 3

extractTitleFunction · 0.70
capitalizeFunction · 0.70
channelCaptionFunction · 0.70

Tested by

no test coverage detected