Creates a MAIDR figure from a Graphviz drawing on the page.
Call it once the SVG is in the document: the layer's selectors name the drawing's own node groups, and each group is marked so it can be named however many graphs share the page.
The SVG Graphviz drew
Figure options
The MAIDR figure, ready for the maidr attribute
maidr
Error when the SVG is not a Graphviz drawing. A drawing with no nodes becomes a figure with no layers, which MAIDR announces as empty
const svg = document.querySelector('#pipeline svg');svg.setAttribute('maidr', JSON.stringify(maidrGraphviz.createMaidrFromGraphviz(svg))); Copy
const svg = document.querySelector('#pipeline svg');svg.setAttribute('maidr', JSON.stringify(maidrGraphviz.createMaidrFromGraphviz(svg)));
Creates a MAIDR figure from a Graphviz drawing on the page.
Call it once the SVG is in the document: the layer's selectors name the drawing's own node groups, and each group is marked so it can be named however many graphs share the page.