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.

197 lines
8.1 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <script>(function (i, s, o, g, r, a, m) {
  5. i['GoogleAnalyticsObject'] = r;
  6. i[r] = i[r] || function () {
  7. (i[r].q = i[r].q || []).push(arguments)
  8. }, i[r].l = 1 * new Date();
  9. a = s.createElement(o), m = s.getElementsByTagName(o)[0];
  10. a.async = 1;
  11. a.src = g;
  12. m.parentNode.insertBefore(a, m)
  13. })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
  14. ga('create', 'UA-61231638-1', 'auto');
  15. ga('send', 'pageview');</script>
  16. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  17. <meta charset="utf-8">
  18. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  19. <meta name="viewport" content="width=device-width, initial-scale=1">
  20. <meta name="description" content="">
  21. <meta name="author" content="">
  22. <link rel="icon" HREF="favicon.ico">
  23. <title>vis.js - A dynamic, browser based visualization library.</title>
  24. <!-- Bootstrap core CSS -->
  25. <link href="../css/bootstrap.css" rel="stylesheet">
  26. <link href="../css/newdocs.css" rel="stylesheet">
  27. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  28. <!--[if lt IE 9]>
  29. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  30. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  31. <![endif]-->
  32. <script src="../js/smooth-scroll.min.js"></script>
  33. <script language="JavaScript">
  34. smoothScroll.init();
  35. </script>
  36. </head>
  37. <!-- NAVBAR
  38. ================================================== -->
  39. <body>
  40. <div class="navbar-wrapper">
  41. <div class="container">
  42. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  43. <div class="container">
  44. <div class="navbar-header">
  45. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
  46. aria-expanded="false" aria-controls="navbar">
  47. <span class="sr-only">Toggle navigation</span>
  48. <span class="icon-bar"></span>
  49. <span class="icon-bar"></span>
  50. <span class="icon-bar"></span>
  51. </button>
  52. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  53. </div>
  54. <div id="navbar" class="navbar-collapse collapse">
  55. <ul class="nav navbar-nav">
  56. <li><a href="../index.html#modules">Modules</a></li>
  57. <li class="active"><a href="./docs/index.html" target="_blank">Documentation <img class="icon"
  58. src="../img/external-link-icons/external-link-icon-white.png"></a>
  59. </li>
  60. <li><a href="../blog.html">Blog</a></li>
  61. <li><a href="../index.html#download_install">Download</a></li>
  62. <li><a href="../showcase/index.html">Showcase</a></li>
  63. <li><a href="../index.html#contribute">Contribute</a></li>
  64. <li><a href="../featureRequests.html">Feature requests</a></li>
  65. <li><a href="../index.html#licenses">License</a></li>
  66. </ul>
  67. </div>
  68. </div>
  69. </nav>
  70. </div>
  71. </div>
  72. <a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img
  73. style="position: absolute; top: 0; right: 0; border: 0;"
  74. src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
  75. alt="Fork me on GitHub"
  76. data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
  77. <div class="container full">
  78. <h1>Network - canvas</h1>
  79. <p>Handles the HTML part of the canvas.</p>
  80. <h3>Options</h3>
  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="moduleTable">
  83. <tr class="header">
  84. <td class="name">name</td>
  85. <td class="type">type</td>
  86. <td class="default">default</td>
  87. <td class="description">description</td>
  88. </tr>
  89. <tr>
  90. <td>width</td>
  91. <td class="mid">String</td>
  92. <td class="mid"><code>'100%'</code></td>
  93. <td>the width of the canvas. Can be in percentages or pixels (ie. <code>'400px'</code>).</td>
  94. </tr>
  95. <tr>
  96. <td>height</td>
  97. <td class="mid">String</td>
  98. <td class="mid"><code>'100%'</code></td>
  99. <td>the height of the canvas. Can be in percentages or pixels (ie. <code>'400px'</code>).</td>
  100. </tr>
  101. </table>
  102. <h3>Methods</h3>
  103. <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
  104. setOptions method of the network itself and use the module name as an object name.</p>
  105. <table class="moduleTable">
  106. <tr class="header">
  107. <td class="methodName">name</td>
  108. <td>returns</td>
  109. <td>description</td>
  110. </tr>
  111. <tr>
  112. <td>setSize(<br>&nbsp;&nbsp;&nbsp;<code><i>String width</i></code>,<br>&nbsp;&nbsp;&nbsp;<code><i>String
  113. height</i></code><br>)
  114. </td>
  115. <td class="mid">none</td>
  116. <td>Set the size of the canvas. This is automatically done on a window resize.</td>
  117. </tr>
  118. <tr>
  119. <td>canvasToDOM({<br>&nbsp;&nbsp;&nbsp;<code><i>x: Number</i></code>,<br>&nbsp;&nbsp;&nbsp;<code><i>y:
  120. Number</i></code><br>})
  121. </td>
  122. <td class="mid">Object</td>
  123. <td>This function converts canvas coordinates to coordinates on the DOM. Input and output are in the form of
  124. <code>{x:Number,y:Number}</code>. The DOM values are relative to the network container.
  125. </td>
  126. </tr>
  127. <tr>
  128. <td>DOMtoCanvas({<br>&nbsp;&nbsp;&nbsp;<code><i>x: Number</i></code>,<br>&nbsp;&nbsp;&nbsp;<code><i>y:
  129. Number</i></code><br>})
  130. </td>
  131. <td class="mid">Object</td>
  132. <td>This function converts DOM coordinates to coordinates on the canvas. Input and output are in the form of
  133. <code>{x:Number,y:Number}</code>. The DOM values are relative to the network container.
  134. </td>
  135. </tr>
  136. </table>
  137. <h3>Events</h3>
  138. <p>This is a list of all the events in the public API. They are collected here from all individual modules.</p>
  139. <table class="moduleTable">
  140. <tr class="header">
  141. <td class="eventName">name</td>
  142. <td class="eventProperties">properties</td>
  143. <td>description</td>
  144. </tr>
  145. <tr>
  146. <td>resize</td>
  147. <td class="mid">
  148. <pre class="code">
  149. {
  150. width: Number // the new width of the canvas
  151. height: Number // the new height of the canvas
  152. oldWidth: Number // the old width of the canvas
  153. oldHeight: Number // the old height of the canvas
  154. }
  155. </pre>
  156. <ul>
  157. </ul>
  158. </td>
  159. <td>Fired when the size of the canvas has been resized, either by a redraw call when the container div has
  160. changed in size, a setSize() call with new values or a setOptions() with new width and/or height values.
  161. </td>
  162. </tr>
  163. </table>
  164. <br/>
  165. <br/>
  166. <br/>
  167. <br/>
  168. <br/>
  169. <br/>
  170. <br/>
  171. </div>
  172. <!-- Bootstrap core JavaScript
  173. ================================================== -->
  174. <!-- Placed at the end of the document so the pages load faster -->
  175. <script src="../js/jquery.min.js"></script>
  176. <script src="../js/bootstrap.min.js"></script>
  177. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  178. <script src="../js/ie10-viewport-bug-workaround.js"></script>