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.

156 lines
10 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  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 - Layout documentation.</title>
  10. <!-- Bootstrap core CSS -->
  11. <link href="../css/bootstrap.css" rel="stylesheet">
  12. <!-- Tipue vendor css -->
  13. <link href="../css/tipuesearch.css" rel="stylesheet">
  14. <link href="../css/style.css" rel="stylesheet">
  15. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  16. <!--[if lt IE 9]>
  17. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  18. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  19. <![endif]-->
  20. <link href="../css/prettify.css" type="text/css" rel="stylesheet"/>
  21. <script type="text/javascript" src="../js/googleAnalytics.js"></script>
  22. <script type="text/javascript" src="../js/prettify/prettify.js"></script>
  23. <script src="../js/smooth-scroll.min.js"></script>
  24. <script language="JavaScript">
  25. smoothScroll.init();
  26. </script>
  27. <!-- Tipue vendor css -->
  28. <link href="../css/tipuesearch.css" rel="stylesheet">
  29. <script type="text/javascript" src="../js/toggleTable.js"></script>
  30. </head>
  31. <body onload="prettyPrint();">
  32. <!-- NAVBAR
  33. ================================================== -->
  34. <body>
  35. <div class="navbar-wrapper">
  36. <div class="container">
  37. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  38. <div class="container">
  39. <div class="navbar-header">
  40. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
  41. aria-expanded="false" aria-controls="navbar">
  42. <span class="sr-only">Toggle navigation</span>
  43. <span class="icon-bar"></span>
  44. <span class="icon-bar"></span>
  45. <span class="icon-bar"></span>
  46. </button>
  47. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  48. </div>
  49. <div id="navbar" class="navbar-collapse collapse">
  50. <ul class="nav navbar-nav">
  51. <li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
  52. <li><a href="http://www.visjs.org/blog.html">Blog</a></li>
  53. <li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
  54. <li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
  55. <li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
  56. <li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
  57. <li><a href="http://www.visjs.org/index.html#licenses">License</a></li>
  58. </ul>
  59. <form class="navbar-form navbar-right" role="search">
  60. <input name="q" id="tipue_search_input" autocomplete="off" type="text" class="form-control" placeholder="Enter keywords">
  61. <button type="button" class="btn btn-default" onclick="vis.initSiteSearch(true);">Go!</button>
  62. </form>
  63. <div id="search-results-wrapper" class="panel panel-default">
  64. <div class="panel-body">
  65. <div id="tipue_search_content"></div>
  66. </div>
  67. </div>
  68. <div id="keyword-info" class="panel panel-success">
  69. <div class="panel-body">
  70. Found <span id="keyword-count"></span> results. Click <a id="keyword-jumper-button" href="">here</a> to jump to the first keyword occurence!
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </nav>
  76. </div>
  77. </div>
  78. <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>
  79. <div class="container full">
  80. <h1>Network - layout</h1>
  81. <p>Acts as the camera that looks on the canvas. Does the animation, zooming and focusing.</p>
  82. <h3>Options</h3>
  83. <p>The options for the layout module have to be contained in an object titled 'layout'.</p>
  84. <p>Click on the full options or shorthand options to show how these options are supposed to be used.</p>
  85. <ul class="nav nav-tabs">
  86. <li role="presentation" class="active" onclick="toggleTab(this)"><a href="#">options hidden</a></li>
  87. <li role="presentation" onclick="toggleTab(this);" targetNode="fullOptions"><a href="#">full options</a></li>
  88. <li role="presentation" onclick="toggleTab(this);" targetNode="shortOptions"><a href="#">shorthand options</a></li>
  89. </ul>
  90. <br>
  91. <pre class="prettyprint lang-js options top hidden" id="fullOptions">
  92. // these are all options in full.
  93. var options = {
  94. layout: {
  95. randomSeed: undefined,
  96. improvedLayout:true,
  97. hierarchical: {
  98. enabled:false,
  99. levelSeparation: 150,
  100. direction: 'UD', // UD, DU, LR, RL
  101. sortMethod: 'hubsize' // hubsize, directed
  102. }
  103. }
  104. }
  105. network.setOptions(options);
  106. </pre>
  107. <pre class="prettyprint lang-js options top hidden" id="shortOptions">
  108. // only the options that have shorthand notations are shown.
  109. var options = {
  110. layout:{
  111. hierarchical: true
  112. }
  113. }
  114. network.setOptions(options);
  115. </pre>
  116. <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>
  117. <table class="options" id="optionTable">
  118. <tr><th>Name</th><th>Type</th><th>Default</th><td>Description</td></tr>
  119. <tr><td>randomSeed</td><td>Number</td><td><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>
  120. <tr id="layout"><td>improvedLayout</td><td>Boolean</td><td><code>true</code></td> <td>When enabled, the network will use the Kamada Kawai algorithm for initial layout. For networks larger than 100 nodes, clustering will be performed automatically to reduce the amount of nodes. This can greatly improve the stabilization times. If the network is very interconnected (no or few leaf nodes), this may not work and it will revert back to the old method. Performance will be improved in the future.</td></tr>
  121. <tr class='toggle collapsible' onclick="toggleTable('optionTable','hierarchical', this);"><td><span parent="repulsion" class="right-caret"></span> hierarchical</td><td>Object or Boolean</td><td><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>
  122. <tr parent="hierarchical" class="hidden"><td class="indent">hierarchical.enabled</td><td>Boolean</td><td><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>
  123. <tr parent="hierarchical" class="hidden"><td class="indent">hierarchical.levelSeparation</td><td>Number</td><td><code>150</code></td> <td>The distance between the different levels.</td></tr>
  124. <tr parent="hierarchical" class="hidden"><td class="indent">hierarchical.direction</td><td>String</td><td><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>
  125. <tr parent="hierarchical" class="hidden"><td class="indent">hierarchical.sortMethod</td><td>String</td><td><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>
  126. 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>
  127. Directed adheres to the to and from data of the edges. A --> B so B is a level lower than A.</td></tr>
  128. </table>
  129. </div>
  130. <!-- Bootstrap core JavaScript
  131. ================================================== -->
  132. <!-- Placed at the end of the document so the pages load faster -->
  133. <script src="../js/jquery.min.js"></script>
  134. <script src="../js/bootstrap.min.js"></script>
  135. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  136. <script src="../js/ie10-viewport-bug-workaround.js"></script>
  137. <!-- jquery extensions -->
  138. <script src="../js/jquery.highlight.js"></script>
  139. <script src="../js/jquery.url.min.js"></script>
  140. <!-- Tipue vendor js -->
  141. <script src="../js/tipuesearch.config.js"></script>
  142. <script src="../js/tipuesearch.js"></script>
  143. <!-- controller -->
  144. <script src="../js/main.js"></script>