vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.2 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Network | Groups</title>
  5. <style>
  6. body {
  7. color: #d3d3d3;
  8. font: 12pt arial;
  9. background-color: #ffffff;
  10. }
  11. #mynetwork {
  12. width: 800px;
  13. height: 800px;
  14. border: 1px solid #444444;
  15. background-color: #dddddd;
  16. }
  17. </style>
  18. <script type="text/javascript" src="../../../../dist/vis.js"></script>
  19. <link href="../../../../dist/vis.css" rel="stylesheet" type="text/css"/>
  20. <script src="../../../googleAnalytics.js"></script>
  21. </head>
  22. <body>
  23. <div id="mynetwork"></div>
  24. <script type="text/javascript">
  25. var len = undefined;
  26. var nodes = [{id: 0, label: "0", group: 0},
  27. {id: 1, label: "1", group: 0},
  28. {id: 2, label: "2", group: 0},
  29. {id: 3, label: "3", group: 1},
  30. {id: 4, label: "4", group: 1},
  31. {id: 5, label: "5", group: 1},
  32. {id: 6, label: "6", group: 2},
  33. {id: 7, label: "7", group: 2},
  34. {id: 8, label: "8", group: 2},
  35. {id: 9, label: "9", group: 3},
  36. {id: 10, label: "10", group: 3},
  37. {id: 11, label: "11", group: 3},
  38. {id: 12, label: "12", group: 4},
  39. {id: 13, label: "13", group: 4},
  40. {id: 14, label: "14", group: 4},
  41. {id: 15, label: "15", group: 5},
  42. {id: 16, label: "16", group: 5},
  43. {id: 17, label: "17", group: 5},
  44. {id: 18, label: "18", group: 6},
  45. {id: 19, label: "19", group: 6},
  46. {id: 20, label: "20", group: 6},
  47. {id: 21, label: "21", group: 7},
  48. {id: 22, label: "22", group: 7},
  49. {id: 23, label: "23", group: 7},
  50. {id: 24, label: "24", group: 8},
  51. {id: 25, label: "25", group: 8},
  52. {id: 26, label: "26", group: 8},
  53. {id: 27, label: "27", group: 9},
  54. {id: 28, label: "28", group: 9},
  55. {id: 29, label: "29", group: 9}
  56. ];
  57. var edges = [{from: 1, to: 0},
  58. {from: 2, to: 0},
  59. {from: 4, to: 3},
  60. {from: 5, to: 4},
  61. {from: 4, to: 0},
  62. {from: 7, to: 6},
  63. {from: 8, to: 7},
  64. {from: 7, to: 0},
  65. {from: 10, to: 9},
  66. {from: 11, to: 10},
  67. {from: 10, to: 4},
  68. {from: 13, to: 12},
  69. {from: 14, to: 13},
  70. {from: 13, to: 0},
  71. {from: 16, to: 15},
  72. {from: 17, to: 15},
  73. {from: 15, to: 10},
  74. {from: 19, to: 18},
  75. {from: 20, to: 19},
  76. {from: 19, to: 4},
  77. {from: 22, to: 21},
  78. {from: 23, to: 22},
  79. {from: 22, to: 13},
  80. {from: 25, to: 24},
  81. {from: 26, to: 25},
  82. {from: 25, to: 7},
  83. {from: 28, to: 27},
  84. {from: 29, to: 28},
  85. {from: 28, to: 0}
  86. ]
  87. // create a network
  88. var container = document.getElementById('mynetwork');
  89. var data = {
  90. nodes: nodes,
  91. edges: edges
  92. };
  93. var options = {
  94. nodes: {
  95. shape: 'dot',
  96. size: 30,
  97. font: {
  98. size: 32
  99. },
  100. borderWidth: 2,
  101. shadow:true
  102. },
  103. edges: {
  104. width: 2,
  105. shadow:true
  106. }
  107. };
  108. network = new vis.Network(container, data, options);
  109. </script>
  110. </body>
  111. </html>