JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css">
<div id="mynetwork">

</div>

CSS

#mynetwork {
  position: absolute;
  top: 0px; right: 0px; bottom: 0px; left: 0px;
}

JavaScript

const container = document.getElementById("mynetwork");
const nodes = new vis.DataSet([
    {
      id: 1,
      label: "1",
    },
    {
      id: 2,
      label: "2",
    },
    {
      id: 3,
      label: "3",
    },
    {
      id: 4,
      label: "4",
    },
    {
      id: 5,
      label: "5",
    },
    {
      id: 6,
      label: "6",
    },
    {
      id: 7,
      label: "7",
    },
    {
      id: 8,
      label: "8",
    }
  ]);

  const edges = new vis.DataSet([
    { from: 1, to: 4 },
    { from: 3, to: 4 },
    { from: 2, to: 4 },
    { from: 4, to: 5 },
    { from: 6, to: 8 },
    { from: 5, to: 7 },
    { from: 1, to: 6 },
    { from: 7, to: 8 }
  ]);
  const data = {
    nodes: nodes,
    edges: edges
  };
  const options = {
    nodes: {
      font: {
        size: 22
      },
    },
    edges: {
      font: {
        align: "top"
      },
      arrows: {
        to: { enabled: true, scaleFactor: 1, type: "arrow" }
      }
    },
    layout: {
      hierarchical: {
        direction: "LR",
        sortMethod: 'directed'
      }
    },
    interaction: {
      tooltipDelay: 200,
      hover: true
    },
  };
   const network = new vis.Network(container, data, options);