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

Function initializeAria

docs/app/js/sanddance-app.js:141654–141661  ·  view source on GitHub ↗
(view)

Source from the content-addressed store, hash-verified

141652var _vegaFormat = require("vega-format");
141653// initialize aria role and label attributes
141654function initializeAria(view) {
141655 const el = view.container();
141656 if (el) {
141657 el.setAttribute("role", "graphics-document");
141658 el.setAttribute("aria-roleDescription", "visualization");
141659 ariaLabel(el, view.description());
141660 }
141661} // update aria-label if we have a DOM container element
141662function ariaLabel(el, desc) {
141663 if (el) desc == null ? el.removeAttribute("aria-label") : el.setAttribute("aria-label", desc);
141664}

Callers 1

initializeFunction · 0.70

Calls 1

ariaLabelFunction · 0.70

Tested by

no test coverage detected