JSSM, a JavaScript state machine - the FSM for FSL
    Preparing search index...

    Function dot_to_svg

    • Render a graphviz dot source string to SVG using @viz-js/viz, or the engine injected via configure({ viz }) when one is set. The default viz instance is lazy-initialized on first call and cached for the lifetime of the module; an injected engine bypasses it entirely.

      const svg = await dot_to_svg('digraph G { a -> b }');
      const svg_neato = await dot_to_svg('digraph G { a -> b }', { engine: 'neato' });

      Parameters

      • dot: string

        Graphviz dot source.

      • Optionaloptions: { engine?: string }

        Optional renderer overrides.

        • Optionalengine?: string

          Graphviz layout engine to use (e.g. 'dot', 'neato', 'circo'). Unrecognized engine names cause @viz-js/viz to throw at render time.

      Returns Promise<string>

      A promise resolving to an SVG XML string.