@aexol/slothking-diagram

A slothking diagram

Usage no npm install needed!

<script type="module">
  import aexolSlothkingDiagram from 'https://cdn.skypack.dev/@aexol/slothking-diagram';
</script>

README

How to use it

Define spacebar menu actions

let allCategories = [{
  name: 'middlewares',
  items: [
    {
      name: 'middleware',
      type: 'middleware',
      inputs: [
        {
          name: ''
        }
      ],
      outputs: [
        {
          name: ''
        }
      ]
    }
  ]
}]
<Graph
  categories={allCategories}
/>

Now if you press spacebar when mouse is on the graph you get this menu, which creates nodes.

Serialization of data

<Graph
  categories={allCategories}
  serialize={(nodes, links) => {
  }}
/>