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.

125 lines
7.1 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. </style>
  35. </head>
  36. <!-- NAVBAR
  37. ================================================== -->
  38. <body>
  39. <div class="navbar-wrapper">
  40. <div class="container">
  41. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  42. <div class="container">
  43. <div class="navbar-header">
  44. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  45. <span class="sr-only">Toggle navigation</span>
  46. <span class="icon-bar"></span>
  47. <span class="icon-bar"></span>
  48. <span class="icon-bar"></span>
  49. </button>
  50. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  51. </div>
  52. <div id="navbar" class="navbar-collapse collapse">
  53. <ul class="nav navbar-nav">
  54. <li><a href="../index.html#modules">Modules</a></li>
  55. <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>
  56. <li><a href="../blog.html">Blog</a></li>
  57. <li><a href="../index.html#download_install">Download</a></li>
  58. <li><a href="../showcase/index.html">Showcase</a></li>
  59. <li><a href="../index.html#contribute">Contribute</a></li>
  60. <li><a href="../featureRequests.html">Feature requests</a></li>
  61. <li><a href="../index.html#licenses">License</a></li>
  62. </ul>
  63. </div>
  64. </div>
  65. </nav>
  66. </div>
  67. </div>
  68. <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>
  69. <div class="container full">
  70. <h1>Network - selection</h1>
  71. <p>Handles the selection of nodes and edges.</p>
  72. <h3>Options</h3>
  73. <p>This is a list of all the methods in the public API. They are collected here from all individual modules.</p>
  74. <table class="moduleTable">
  75. <tr class="header"><td>name</td><td>type</td><td>default</td><td>description</td></tr>
  76. <tr><td>select</td> <td class="mid">Boolean</td><td class="mid"><code>true</code></td><td>When true, the nodes and edges can be selected by the user.</td></tr>
  77. <tr><td>selectConnectedEdges</td> <td class="mid">Boolean</td><td class="mid"><code>true</code></td><td>When true, on selecting a node, its connecting edges are highlighted.</td></tr>
  78. </table>
  79. <h3>Methods</h3>
  80. <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>
  81. <table class="moduleTable">
  82. <tr class="header"><td class="method">name</td><td>returns</td><td>description</td></tr>
  83. <tr><td>getSelection()</td> <td class="mid">
  84. <pre class="code">
  85. {
  86. nodes: [Array of selected nodeIds],
  87. edges: [Array of selected edgeIds]
  88. }</pre> </td><td>Returns an object with selected nodes and edges ids.</td></tr>
  89. <tr><td>getSelectedNodes()</td> <td class="mid"><code>[nodeId1, nodeId2, ..]</code></td><td>Returns an array of selected node ids.</td></tr>
  90. <tr><td>getSelectedEdges()</td> <td class="mid"><code>[edgeId1, edgeId2, ..]</code></td><td>Returns an array of selected edge ids.</td></tr>
  91. <tr><td>selectNodes(<br>&nbsp;&nbsp;&nbsp;<code><i>Array with nodeIds</i></code>,<br>&nbsp;&nbsp;&nbsp;<code><i>[Boolean highlightEdges]</i></code><br>)</td> <td class="mid">none</td><td>Selects the nodes corresponding to the id's in the input array. If highlightEdges is true or undefined, the neighbouring edges will also be selected. This method unselects all other objects before selecting its own objects. <i>Does not fire events</i>.</td></tr>
  92. <tr><td>selectEdges(<br>&nbsp;&nbsp;&nbsp;<code><i>Array with edgeIds</i></code><br>)</td> <td class="mid">none</td><td>Selects the edges corresponding to the id's in the input array. This method unselects all other objects before selecting its own objects. <i>Does not fire events</i>.</td></tr>
  93. <tr><td>unselectAll()</td> <td class="mid">none</td> <td>Unselect all objects. <i>Does not fire events</i>.</td></tr>
  94. </table>
  95. <h3>Events</h3>
  96. <p>The selection handler does not fire events. All related events are fired by the interaction module because they are triggered by user interaction.</p>
  97. <br />
  98. <br />
  99. <br />
  100. <br />
  101. <br />
  102. <br />
  103. <br />
  104. </div>
  105. <!-- Bootstrap core JavaScript
  106. ================================================== -->
  107. <!-- Placed at the end of the document so the pages load faster -->
  108. <script src="../js/jquery.min.js"></script>
  109. <script src="../js/bootstrap.min.js"></script>
  110. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  111. <script src="../js/ie10-viewport-bug-workaround.js"></script>