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.

94 lines
3.0 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Vis Popup Example</title>
  5. <style type="text/css">
  6. body {
  7. font: 10pt sans;
  8. }
  9. #mynetwork {
  10. width: 600px;
  11. height: 600px;
  12. border: 1px solid lightgray;
  13. }
  14. </style>
  15. <script src="http://visjs.org/dist/vis.js" type="text/javascript" ></script>
  16. <link href="http://visjs.org/dist/vis.css" rel="stylesheet" type="text/css"/>
  17. <!--<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" />-->
  18. <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>-->
  19. <!--<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" type="text/javascript"></script>-->
  20. <script type="text/javascript">
  21. var network = null;
  22. var network2 = null;
  23. function draw() {
  24. var nodes = [];
  25. var edges = [];
  26. nodes.push({ id: 1, label: 'Node1' });
  27. nodes.push({ id: 2, label: 'Node2' });
  28. edges.push({ from: 2, to: 1 });
  29. var data = {
  30. nodes: nodes,
  31. edges: edges
  32. };
  33. // create a network
  34. var container = document.getElementById('mynetwork');
  35. var options = {
  36. layout: {
  37. hierarchical: {
  38. direction: "UD"
  39. }
  40. }
  41. };
  42. network = new vis.Network(container, data, options);
  43. // $('#divTreemapPopUp').modal('show');
  44. var nodes2 = [];
  45. var edges2 = [];
  46. nodes2.push({ id: 1, label: 'Node1' });
  47. nodes2.push({ id: 2, label: 'Node2' });
  48. edges2.push({ from: 2, to: 1 });
  49. var data2 = {
  50. nodes: nodes2,
  51. edges: edges2
  52. };
  53. // create a network
  54. var container2 = document.getElementById('mynetwork2');
  55. var options2 = {
  56. layout: {
  57. hierarchical: {
  58. direction: "UD"
  59. }
  60. }
  61. };
  62. network2 = new vis.Network(container2, data2, options2);
  63. }
  64. </script>
  65. </head>
  66. <body onload="draw();">
  67. <h2>Popup Example</h2>
  68. <div style='display: block;' class='modal fade' id='divTreemapPopUp' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
  69. <div class='modal-dialog'><div class='modal-content'><div class='modal-header'>
  70. <button type='button' class='close' data-dismiss='modal' aria-hidden='true'></button>
  71. <h4 class='modal-title'>TreeMap</h4></div>
  72. <div class='modal-body'>
  73. <div id='mynetwork'></div></div>
  74. <div class='modal-footer'><button type='button' class='btn btn-default' data-dismiss='modal'>Close</button></div></div></div></div>
  75. <div id='mynetwork2'></div>
  76. </body>
  77. </html>