Socket
Socket
Sign inDemoInstall

jssm-viz

Package Overview
Dependencies
130
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jssm-viz

Visualization of JSSM machines using viz.js


Version published
Weekly downloads
706
increased by34.99%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

jssm-viz

Visualization of JSSM machines using viz.js



TL;DR

Easy to use fsl to svg through jssm.



Node

cd ~/projects && mkdir jssm-viz-demo && cd jssm-viz-demo
npm init -y && npm install --save-dev jssm-viz

in dump_svg.js:

async function run() {

  const jssm_viz = require('jssm-viz'),
        fsl_code = 'green => yellow => red => green; [green yellow red] ~> off -> red;';

  svg_code = await jssm_viz.fsl_to_svg_string(fsl_code);

  console.log(svg_code);

}

run();
node ./dump_svg.js

Et voila: svg of your fsl.



Browser

<!doctype html><html><head><title>jssm-viz example</title>
    <script defer type="text/javascript" src="jssm-viz.iife.js"></script>
    <script defer type="text/javascript">

      window.onload = async () => {

        const ExMachine = `
          Green => Yellow => Red => Green;
          [Red Yellow Green] ~> Off -> Red;
        `;

        document.getElementById('tgt').innerHTML = await window.jssm_viz.fsl_to_svg_string(ExMachine);

      }

    </script>

  </head>

  <body><div id="tgt"></div></body>

</html>

What is this?

jssm-viz is a way to render your fsl and jssm to svg (and from there to jpeg and png.)

See it in use.

TODO: write a better readme

Keywords

FAQs

Last updated on 25 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc