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

    Function machine_to_dot

    • Render a jssm.Machine as a graphviz dot string.

      An optional footer may be supplied via opts.footer; it is emitted verbatim just before the closing } of the dot source, after all arrange declarations. This is a function-argument-only feature for the moment — a machine-attribute equivalent is planned as a follow-up.

      import { sm } from 'jssm';
      import { machine_to_dot } from 'jssm/viz';

      const dot = machine_to_dot(sm`a -> b;`);
      // 'digraph G { ... }'

      // suppress state-name labels (boxes only, no text inside)
      const dot2 = machine_to_dot(sm`a -> b;`, { hide_state_labels: true });

      const dot_with_footer = machine_to_dot(sm`a -> b;`, { footer: 'labelloc="b"; label="caption";' });
      // 'digraph G { ... labelloc="b"; label="caption"; }'

      // render FSL state groups as nested clusters (the default)
      const grouped = machine_to_dot(sm`&g : [a b]; a -> b;`);
      // 'digraph G { ... subgraph cluster_g { label="g"; ... } ... }'

      // or as label chips, with no cluster boxes
      const chipped = machine_to_dot(sm`&g : [a b]; a -> b;`, { render_groups: 'chips' });

      Type Parameters

      • T

      Parameters

      Returns string

      A complete graphviz dot source string.