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.

118 lines
8.0 KiB

  1. <?js
  2. var self = this;
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="en"><head>
  6. <meta charset="utf-8">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <meta name="description" content="">
  10. <meta name="author" content="">
  11. <link rel="icon" HREF="favicon.ico">
  12. <title>vis.js - Interaction documentation.</title>
  13. <!-- Bootstrap core CSS -->
  14. <link href="../css/bootstrap.css" rel="stylesheet">
  15. <!-- Tipue vendor css -->
  16. <link href="../css/tipuesearch.css" rel="stylesheet">
  17. <link href="../css/style.css" rel="stylesheet">
  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. <link href="../css/prettify.css" type="text/css" rel="stylesheet"/>
  24. <script type="text/javascript" src="../js/googleAnalytics.js"></script>
  25. <script type="text/javascript" src="../js/prettify/prettify.js"></script>
  26. <script src="../js/smooth-scroll.min.js"></script>
  27. <script language="JavaScript">
  28. smoothScroll.init();
  29. </script>
  30. <script type="text/javascript" src="../js/toggleTable.js"></script>
  31. </head>
  32. <body onload="prettyPrint();">
  33. <?js= self.partial('tmpl/navbar.tmpl') ?>
  34. <div class="container full">
  35. <h1>Network - interaction</h1>
  36. <p>Used for all user interaction with the network. Handles mouse and touch events as well as the navigation buttons and the popups.</p>
  37. <h3>Options</h3>
  38. <p>The options for the interaction module have to be contained in an object titled 'interaction'.</p>
  39. <p>Click on the full options or shorthand options to show how these options are supposed to be used.</p>
  40. <ul class="nav nav-tabs">
  41. <li role="presentation" class="active" onclick="toggleTab(this)"><a href="#">options hidden</a></li>
  42. <li role="presentation" onclick="toggleTab(this);" targetNode="fullOptions"><a href="#">full options</a></li>
  43. <li role="presentation" onclick="toggleTab(this);" targetNode="shortOptions"><a href="#">shorthand options</a></li>
  44. </ul>
  45. <br>
  46. <pre class="prettyprint lang-js options top hidden" id="fullOptions">
  47. // these are all options in full.
  48. var options = {
  49. interaction:{
  50. dragNodes:true,
  51. dragView: true,
  52. hideEdgesOnDrag: false,
  53. hideNodesOnDrag: false,
  54. hover: false,
  55. hoverConnectedEdges: true,
  56. keyboard: {
  57. enabled: false,
  58. speed: {x: 10, y: 10, zoom: 0.02},
  59. bindToWindow: true
  60. },
  61. multiselect: false,
  62. navigationButtons: false,
  63. selectable: true,
  64. selectConnectedEdges: true,
  65. tooltipDelay: 300,
  66. zoomView: true,
  67. zoomSpeed: 1
  68. }
  69. }
  70. network.setOptions(options);
  71. </pre>
  72. <pre class="prettyprint lang-js options top hidden" id="shortOptions">
  73. // only the options that have shorthand notations are shown.
  74. var options = {
  75. interaction:{
  76. keyboard: false
  77. }
  78. }
  79. network.setOptions(options);
  80. </pre>
  81. <p>This is a list of all the methods in the public API. They are collected here from all individual modules.</p>
  82. <table class="options" id="optionTable">
  83. <tr><th>Name</th><th>Type</th><th>Default</th><th>Description</th></tr>
  84. <tr><td>dragNodes</td> <td>Boolean</td> <td><code>true</code></td> <td>When true, the nodes that are not fixed can be dragged by the user.</td></tr>
  85. <tr><td>dragView</td> <td>Boolean</td> <td><code>true</code></td> <td>When true, the view can be dragged around by the user.</td></tr>
  86. <tr><td>hideEdgesOnDrag</td> <td>Boolean</td> <td><code>false</code></td> <td>When true, the edges are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.</td></tr>
  87. <tr><td>hideNodesOnDrag</td> <td>Boolean</td> <td><code>false</code></td> <td>When true, the nodes are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.</td></tr>
  88. <tr><td>hover</td> <td>Boolean</td> <td><code>false</code></td> <td>When true, the nodes use their hover colors when the mouse moves over them.</td></tr>
  89. <tr><td>hoverConnectedEdges</td> <td>Boolean</td> <td><code>true</code></td> <td>When true, on hovering over a node, it's connecting edges are highlighted.</td></tr>
  90. <tr class='toggle collapsible' onclick="toggleTable('optionTable','keyboard', this);"><td><span parent="keyboard" class="right-caret"></span> keyboard</td> <td>Object or Boolean</td> <td><code>Object</code></td> <td>When true, the keyboard shortcuts are enabled with the default settings. For further customization, you can supply an object.</td></tr>
  91. <tr parent="keyboard" class="hidden"><td class="indent">keyboard.enabled</td> <td>Boolean</td> <td><code>false</code></td> <td>Toggle the usage of the keyboard shortcuts. If this option is not defined, it is set to true if any of the properties in this object are defined.</td></tr>
  92. <tr parent="keyboard" class="hidden"><td class="indent">keyboard.speed.x</td> <td>Number</td> <td><code>1</code></td> <td>The speed at which the view moves in the x direction on pressing a key or pressing a navigation button.</td></tr>
  93. <tr parent="keyboard" class="hidden"><td class="indent">keyboard.speed.y</td> <td>Number</td> <td><code>1</code></td> <td>The speed at which the view moves in the y direction on pressing a key or pressing a navigation button.</td></tr>
  94. <tr parent="keyboard" class="hidden"><td class="indent">keyboard.speed.zoom</td> <td>Number</td> <td><code>0.02</code></td> <td>The speed at which the view zooms in or out pressing a key or pressing a navigation button.</td></tr>
  95. <tr parent="keyboard" class="hidden"><td class="indent">keyboard.bindToWindow</td> <td>Boolean</td> <td><code>true</code></td> <td>When binding the keyboard shortcuts to the window, they will work regardless of which DOM object has the focus. If you have multiple networks on your page, you could set this to false, making sure the keyboard shortcuts only work on the network that has the focus.</td></tr>
  96. <tr><td>multiselect</td> <td>Boolean</td> <td><code>false</code></td> <td>When true, a longheld click (or touch) as well as a control-click will add to the selection.</td></tr>
  97. <tr><td>navigationButtons</td> <td>Boolean</td> <td><code>false</code></td> <td>When true, navigation buttons are drawn on the network canvas. These are HTML buttons and can be completely customized using CSS.</td></tr>
  98. <tr><td>selectable</td> <td>Boolean</td><td><code>true</code></td><td>When true, the nodes and edges can be selected by the user.</td></tr>
  99. <tr><td>selectConnectedEdges</td> <td>Boolean</td><td><code>true</code></td><td>When true, on selecting a node, its connecting edges are highlighted.</td></tr>
  100. <tr><td>tooltipDelay</td> <td>Number</td> <td><code>300</code></td> <td>When nodes or edges have a defined <code>'title'</code> field, this can be shown as a pop-up tooltip. The tooltip itself is an HTML element that can be fully styled using CSS. The delay is the amount of time in milliseconds it takes before the tooltip is shown.</td></tr>
  101. <tr><td>zoomView</td> <td>Boolean</td> <td><code>true</code></td> <td>When true, the user can zoom in.</td></tr>
  102. <tr><td>zoomSpeed</td> <td>Number</td> <td><code>1</code></td> <td>The default speed of "1" (arbitrary unit) is moderately fast. Speed changes apply only to manual zooming (e.g. with mouse scroll wheel).</td></tr>
  103. </table>
  104. </div>
  105. <?js= self.partial('tmpl/html-foot.tmpl') ?>