MAIDR JavaScript API
    Preparing search index...
    • 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.

      Parameters

      Returns Maidr

      The MAIDR figure, ready for the maidr attribute

      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)));