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.

157 lines
6.6 KiB

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">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta name="description" content="">
  8. <meta name="author" content="">
  9. <link rel="icon" HREF="favicon.ico">
  10. <title>vis.js - A dynamic, browser based visualization library.</title>
  11. <!-- Bootstrap core CSS -->
  12. <link href="../css/bootstrap.css" rel="stylesheet">
  13. <link href="../css/newdocs.css" rel="stylesheet">
  14. <link href="../css/prettify.css" type="text/css" rel="stylesheet" />
  15. <script type="text/javascript" src="../js/toggleTable.js"></script>
  16. <script type="text/javascript" src="../js/googleAnalytics.js"></script>
  17. <script type="text/javascript" src="../js/prettify/prettify.js"></script>
  18. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  19. <!--[if lt IE 9]>
  20. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  21. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  22. <![endif]-->
  23. <script src="../js/smooth-scroll.min.js"></script>
  24. <script language="JavaScript">
  25. smoothScroll.init();
  26. </script>
  27. <style>
  28. </style>
  29. </head>
  30. <!-- NAVBAR
  31. ================================================== -->
  32. <body onload="prettyPrint();">
  33. <div class="navbar-wrapper">
  34. <div class="container">
  35. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  36. <div class="container">
  37. <div class="navbar-header">
  38. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
  39. aria-expanded="false" aria-controls="navbar">
  40. <span class="sr-only">Toggle navigation</span>
  41. <span class="icon-bar"></span>
  42. <span class="icon-bar"></span>
  43. <span class="icon-bar"></span>
  44. </button>
  45. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  46. </div>
  47. <div id="navbar" class="navbar-collapse collapse">
  48. <ul class="nav navbar-nav">
  49. <li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
  50. <li class="active"><a href="./docs/index.html" target="_blank">Documentation <img class="icon"
  51. src="../img/external-link-icons/external-link-icon-white.png"></a>
  52. </li>
  53. <li><a href="http://www.visjs.org/blog.html">Blog</a></li>
  54. <li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
  55. <li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
  56. <li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
  57. <li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
  58. <li><a href="http://www.visjs.org/index.html#licenses">License</a></li>
  59. </ul>
  60. </div>
  61. </div>
  62. </nav>
  63. </div>
  64. </div>
  65. <a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img
  66. style="position: absolute; top: 0; right: 0; border: 0;"
  67. src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
  68. alt="Fork me on GitHub"
  69. data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
  70. <div class="container full">
  71. <h1>Network - groups</h1>
  72. <p>Handles the group styling.</p>
  73. <h3>Options</h3>
  74. <p>The options for the canvas have to be contained in an object titled 'groups'.</p>
  75. <p>Click on the options shown to show how these options are supposed to be used.</p>
  76. <ul class="nav nav-tabs">
  77. <li role="presentation" class="active" onclick="toggleTab(this)"><a href="#">options hidden</a></li>
  78. <li role="presentation" onclick="toggleTab(this);" targetNode="fullOptions"><a href="#">options shown</a></li>
  79. </ul>
  80. <br>
  81. <pre class="prettyprint lang-js options hidden" id="fullOptions">
  82. var options = {
  83. groups:{
  84. useDefaultGroups: true,
  85. myGroupId:{
  86. /*node options*/
  87. }
  88. }
  89. }
  90. network.setOptions(options);
  91. </pre>
  92. <p>All of the individual options are explained here:</p>
  93. <table class="moduleTable">
  94. <tr>
  95. <th>name</th>
  96. <th>type</th>
  97. <th>default</th>
  98. <th>description</th>
  99. </tr>
  100. <tr>
  101. <td>useDefaultGroups</td>
  102. <td class="mid">Boolean</td>
  103. <td class="mid"><code>true</code></td>
  104. <td>If your nodes have groups defined that are not in the Groups module, the module loops over the groups it
  105. does have, allocating one for each unknown group. When all are used, it goes back to the first group. By
  106. setting this to false, the default groups will not be used in this cycle.
  107. </td>
  108. </tr>
  109. <tr>
  110. <td>group*</td>
  111. <td class="mid">Object</td>
  112. <td class="mid"><code></code></td>
  113. <td>
  114. You can add multiple groups containing styling information that applies to a certain subset of groups.
  115. All options described in the <a href="./nodes.html">nodes module</a> that make sense can be used here
  116. (you're not going to set the same id or x,y position for a group of nodes).
  117. Example:
  118. <pre class="prettyprint lang-js options">
  119. var nodes = [
  120. {id:1, group:'myGroup', label:"I'm in a custom group called 'myGroup'!"}
  121. ]
  122. var options = {
  123. groups: {
  124. myGroup: {color:{background:'red'}, borderWidth:3}
  125. }
  126. }
  127. </pre>
  128. *) the option is not called group, as shown by the example but can by any custom id, except for
  129. 'useDefaultGroups'.
  130. </td>
  131. </tr>
  132. </table>
  133. </div>
  134. <!-- Bootstrap core JavaScript
  135. ================================================== -->
  136. <!-- Placed at the end of the document so the pages load faster -->
  137. <script src="../js/jquery.min.js"></script>
  138. <script src="../js/bootstrap.min.js"></script>
  139. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  140. <script src="../js/ie10-viewport-bug-workaround.js"></script>