How to use state-machine-cat - 2 common examples

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

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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 3 months ago

Package Health Score

77 / 100
Full package analysis

Popular state-machine-cat functions