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.

124 lines
7.6 KiB

  1. <!DOCTYPE html>
  2. <html lang="en"><head><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-61231638-1', 'auto');ga('send', 'pageview');</script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="description" content="">
  7. <meta name="author" content="">
  8. <link rel="icon" HREF="favicon.ico">
  9. <title>vis.js - A dynamic, browser based visualization library.</title>
  10. <!-- Bootstrap core CSS -->
  11. <link href="../css/bootstrap.css" rel="stylesheet">
  12. <link href="../css/newdocs.css" rel="stylesheet">
  13. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  14. <!--[if lt IE 9]>
  15. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  16. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  17. <![endif]-->
  18. <script src="../js/smooth-scroll.min.js"></script>
  19. <script language="JavaScript">
  20. smoothScroll.init();
  21. </script>
  22. <style>
  23. pre.code {
  24. padding:2px 4px;
  25. font-size:90%;
  26. color:#c7254e;
  27. background-color:#f9f2f4;
  28. border-radius:4px;
  29. border:0px;
  30. }
  31. td.method {
  32. width:250px;
  33. }
  34. p {
  35. max-width:1000px;
  36. }
  37. </style>
  38. </head>
  39. <!-- NAVBAR
  40. ================================================== -->
  41. <body>
  42. <div class="navbar-wrapper">
  43. <div class="container">
  44. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  45. <div class="container">
  46. <div class="navbar-header">
  47. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  48. <span class="sr-only">Toggle navigation</span>
  49. <span class="icon-bar"></span>
  50. <span class="icon-bar"></span>
  51. <span class="icon-bar"></span>
  52. </button>
  53. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  54. </div>
  55. <div id="navbar" class="navbar-collapse collapse">
  56. <ul class="nav navbar-nav">
  57. <li><a href="../index.html#modules">Modules</a></li>
  58. <li class="active"><a href="./docs/index.html" target="_blank">Documentation <img class="icon" src="../images/external-link-icons/external-link-icon-white.png"></a></li>
  59. <li><a href="../blog.html">Blog</a></li>
  60. <li><a href="../index.html#download_install">Download</a></li>
  61. <li><a href="../showcase/index.html">Showcase</a></li>
  62. <li><a href="../index.html#contribute">Contribute</a></li>
  63. <li><a href="../featureRequests.html">Feature requests</a></li>
  64. <li><a href="../index.html#licenses">License</a></li>
  65. </ul>
  66. </div>
  67. </div>
  68. </nav>
  69. </div>
  70. </div>
  71. <a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
  72. <div class="container full">
  73. <h1>Network - layout</h1>
  74. <p>Acts as the camera that looks on the canvas. Does the animation, zooming and focusing.</p>
  75. <h3>Options</h3>
  76. <p>When enabling the hierarchical layout, it overrules some of the other options. The physics is set to the hierarchical repulsion solver and dynamic smooth edges are converted to static smooth edges.</p>
  77. <table class="moduleTable">
  78. <tr class="header"><td>name</td><td>type</td><td>default</td><td>description</td></tr>
  79. <tr><td>randomSeed</td><td class="mid">Number</td><td class="mid"><code>undefined</code></td> <td>When NOT using the hierarchical layout, the nodes are randomly positioned initially. This means that the settled result is different every time. If you provide a random seed manually, the layout will be the same every time. Ideally you try with an undefined seed, reload until you are happy with the layout and use the <code>getSeed()</code> method to ascertain the seed.</td></tr>
  80. <tr><td>hierarchical</td><td class="mid">Object | Boolean</td><td class="mid"><code>Object</code></td> <td>When true, the layout engine positions the nodes in a hierarchical fashion using default settings. For customization you can supply an object.</td></tr>
  81. <tr><td>hierarchical.enabled</td><td class="mid">Boolean</td><td class="mid"><code>false</code></td> <td>Toggle the usage of the hierarchical layout system. If this option is not defined, it is set to true if any of the properties in this object are defined.</td></tr>
  82. <tr><td>hierarchical.levelSeparation</td><td class="mid">Number</td><td class="mid"><code>150</code></td> <td>The distance between the different levels.</td></tr>
  83. <tr><td>hierarchical.direction</td><td class="mid">String</td><td class="mid"><code>'UD'</code></td> <td>The direction of the hierarchical layout. The available options are: <code>UD, DU, LR, RL</code>. To simplify: up-down, down-up, left-right, right-left.</td></tr>
  84. <tr><td>hierarchical.sortMethod</td><td class="mid">String</td><td class="mid"><code>'hubsize'</code></td> <td>The algorithm used to ascertain the levels of the nodes based on the data. The possible options are: <code>hubsize, directed</code>. <br><br>
  85. Hubsize takes the nodes with the most edges and puts them at the top. From that the rest of the hierarchy is evaluated. <br><br>
  86. Directed adheres to the to and from data of the edges. A --> B so B is a level lower than A.</td></tr>
  87. </table>
  88. <h3>Methods</h3>
  89. <p>This is a list of all the methods in the public API. Options can be set directly to the module or you can use the setOptions method of the network itself and use the module name as an object name.</p>
  90. <table class="moduleTable">
  91. <tr class="header"> <td class="method">name</td><td>returns</td><td>description</td></tr>
  92. <tr><td>getSeed()</td> <td class="mid">Number</td><td>If you like the layout of your network and would like it to start in the same way next time, ask for the seed using this method and put it in the <code>randomSeed</code> option.</td></tr>
  93. </table>
  94. <h3>Events</h3>
  95. <p>There are no events emitted by the layout module.</p>
  96. <br />
  97. <br />
  98. <br />
  99. <br />
  100. <br />
  101. <br />
  102. <br />
  103. </div>
  104. <!-- Bootstrap core JavaScript
  105. ================================================== -->
  106. <!-- Placed at the end of the document so the pages load faster -->
  107. <script src="../js/jquery.min.js"></script>
  108. <script src="../js/bootstrap.min.js"></script>
  109. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  110. <script src="../js/ie10-viewport-bug-workaround.js"></script>