Counts() {
    document.getElementById('myMessage1').textContent = myWholeModel.nodeDataArray.length;
    document.getElementById('myMessage2').textContent = myDiagram.nodes.count;
    document.getElementById('myMessage4').textContent = myDiagram.links.count;
  }

  window.addEventListener('DOMContentLoaded', init);
</script>
<style>
  #mySpinner {
    display: none;
    position: absolute;
    z-index: 100;
    animation: spin 1s linear infinite;
  }
  @keyframes spin {
    from {
      transform: rotate(0