How to use the state-machine-cat.render function in state-machine-cat

To help you get started, we’ve selected a few state-machine-cat examples, based on popular ways it is used in public projects.

github karl / redux-saga-state-machine / xstate-to-svg / src / index.ts View on Github external
export const xstateToSvg = (description: MachineConfig) => {
  const smcDescription = xstateToSmcDescription(description);

  // console.log(JSON.stringify(smcDescription, null, 2));

  const svg = render(smcDescription, {
    inputType: 'json',
    outputType: 'svg',
  });

  return svg;
};
github TerosTechnology / terosHDL / lib / run / state-machine / main.js View on Github external
export function stateMachineVHDL(code) {
  const smcat = require("state-machine-cat")
  try {
      var go = getSvgStateMachine(code);
      var lSVGInAString = smcat.render(go);
      var view = new InitProjectView();
      var panel = atom.workspace.addBottomPanel({item: view.getElement()});
      svg.outerHTML += lSVGInAString
      //-- Cancel button pressed: finish
      view.handleCancel = () => panel.destroy();
  } catch (pError) {
    atom.notifications.addInfo("This is an experimental feature. Sorry, this state machine is not supported.")
  }
}

state-machine-cat

write beautiful state charts

MIT
Latest version published 18 days ago

Package Health Score

84 / 100
Full package analysis

Popular state-machine-cat functions

Similar packages