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.

681 lines
30 KiB

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/googleAnalytics.js"></script>
  16. <script type="text/javascript" src="../js/prettify/prettify.js"></script>
  17. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  18. <!--[if lt IE 9]>
  19. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  20. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  21. <![endif]-->
  22. <script src="../js/smooth-scroll.min.js"></script>
  23. <script language="JavaScript">
  24. smoothScroll.init();
  25. </script>
  26. <style>
  27. td.type {
  28. width: 90px;
  29. }
  30. </style>
  31. <script type="text/javascript" src="../js/toggleTable.js"></script>
  32. </head>
  33. <!-- NAVBAR
  34. ================================================== -->
  35. <body onload="prettyPrint();">
  36. <div class="navbar-wrapper">
  37. <div class="container">
  38. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  39. <div class="container">
  40. <div class="navbar-header">
  41. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
  42. aria-expanded="false" aria-controls="navbar">
  43. <span class="sr-only">Toggle navigation</span>
  44. <span class="icon-bar"></span>
  45. <span class="icon-bar"></span>
  46. <span class="icon-bar"></span>
  47. </button>
  48. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  49. </div>
  50. <div id="navbar" class="navbar-collapse collapse">
  51. <ul class="nav navbar-nav">
  52. <li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
  53. <li class="active"><a href="./docs/index.html" target="_blank">Documentation <img class="icon"
  54. src="../img/external-link-icons/external-link-icon-white.png"></a>
  55. </li>
  56. <li><a href="http://www.visjs.org/blog.html">Blog</a></li>
  57. <li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
  58. <li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
  59. <li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
  60. <li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
  61. <li><a href="http://www.visjs.org/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
  69. style="position: absolute; top: 0; right: 0; border: 0;"
  70. src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
  71. alt="Fork me on GitHub"
  72. data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
  73. <div class="container full">
  74. <h1>Network - edges</h1>
  75. <p>Handles the creation and deletion of edges and contains the global edge options and styles.</p>
  76. <h3>Options</h3>
  77. <p>The options for the edges have to be contained in an object titled 'edges'. All of these options can be supplied per edge as well. Obviously, 'id' should not be defined globally but per edge. Options defined
  78. in the global edges object, are applied to all edges. If an edge has options of its own, those will be used instead of the global options.</p>
  79. <p>Click on the full options or shorthand options to show how these options are supposed to be used.</p>
  80. <ul class="nav nav-tabs">
  81. <li role="presentation" class="active" onclick="hideOptions('fullTab','fullOptions','shortTab','shortOptions');" id="hiddenTab"><a href="#">options hidden</a></li>
  82. <li role="presentation" onclick="toggleTab('fullTab','fullOptions','shortTab','shortOptions');" id="fullTab"><a href="#">full options</a></li>
  83. <li role="presentation" onclick="toggleTab('shortTab','shortOptions','fullTab','fullOptions');" id="shortTab"><a href="#">shorthand options</a></li>
  84. </ul>
  85. <br>
  86. <pre class="prettyprint lang-js options top hidden" id="fullOptions">
  87. // these are all options in full.
  88. var options = {
  89. edges:{
  90. arrows: {
  91. to: {enabled: false, scaleFactor:1},
  92. middle: {enabled: false, scaleFactor:1},
  93. from: {enabled: false, scaleFactor:1}
  94. },
  95. color: {
  96. color:'#848484',
  97. highlight:'#848484',
  98. hover: '#848484',
  99. inherit: 'from',
  100. opacity:1.0
  101. },
  102. dashes:{
  103. enabled: false,
  104. pattern:[5,5]
  105. },
  106. font: {
  107. color: '#343434',
  108. size: 14, // px
  109. face: 'arial',
  110. background: 'none',
  111. stroke: 1, // px
  112. strokeColor: '#ffffff',
  113. align:'horizontal'
  114. },
  115. hidden: false,
  116. hoverWidth: 1.5,
  117. label: undefined,
  118. length: undefined,
  119. physics: true,
  120. scaling:{
  121. min: 1,
  122. max: 15,
  123. label: {
  124. enabled: true,
  125. min: 14,
  126. max: 30,
  127. maxVisible: 30,
  128. drawThreshold: 3
  129. },
  130. customScalingFunction: function (min,max,total,value) {
  131. if (max === min) {
  132. return 0.5;
  133. }
  134. else {
  135. var scale = 1 / (max - min);
  136. return Math.max(0,(value - min)*scale);
  137. }
  138. }
  139. },
  140. selectionWidth: 1,
  141. selfReferenceSize:20,
  142. shadow:{
  143. enabled: false,
  144. size:10,
  145. x:5,
  146. y:5
  147. },
  148. smooth: {
  149. enabled: true,
  150. dynamic: true,
  151. type: "continuous",
  152. roundness: 0.5
  153. },
  154. title:undefined,
  155. width: 1,
  156. value: undefined
  157. }
  158. }
  159. network.setOptions(options);
  160. </pre>
  161. <pre class="prettyprint lang-js options top hidden" id="shortOptions">
  162. // here all options that have shorthand notations are shown.
  163. var options = {
  164. edges:{
  165. arrows: 'to, from',
  166. color: 'red',
  167. dashes: true,
  168. font: '12px arial #ff0000',
  169. scaling:{
  170. label: true,
  171. },
  172. shadow: true,
  173. smooth: true,
  174. }
  175. }
  176. network.setOptions(options);
  177. </pre>
  178. <p>These options can also be set per individual edge.</p>
  179. <table class="moduleTable" id="optionTable">
  180. <tr class="header">
  181. <td class="name">name</td>
  182. <td class="type">type</td>
  183. <td class="default">default</td>
  184. <td class="description">description</td>
  185. </tr>
  186. <tr class='toggle collapsible' onclick="toggleTable('optionTable','arrows', this);">
  187. <td><span parent="arrows" class="right-caret"></span> arrows</td>
  188. <td class="mid">Object or String</td>
  189. <td class="mid"><code>undefined</code></td>
  190. <td>To draw an arrow with default settings a string can be supplied. For example: <code>arrows:'to, from,
  191. middle'</code> or <code>'to;from'</code>, any combination with any seperating symbol is fine. If you
  192. want to control the size of the arrowheads, you can supply an object.
  193. </td>
  194. </tr>
  195. <tr parent="arrows" class="hidden">
  196. <td class="indent">arrows.to</td>
  197. <td class="mid">Object or Boolean</td>
  198. <td class="mid"><code>Object</code></td>
  199. <td>When true, an arrowhead on the 'to' side of the edge is drawn, pointing to the 'to' node with default
  200. settings. To customize the size of the arrow, supply an object.
  201. </td>
  202. </tr>
  203. <tr parent="arrows" class="hidden">
  204. <td class="indent2">arrows.to.enabled</td>
  205. <td class="mid">Boolean</td>
  206. <td class="mid"><code>false</code></td>
  207. <td>Toggle the arrow on or off. This option is optional, if undefined and the scaleFactor property is set,
  208. enabled will be set to true.
  209. </td>
  210. </tr>
  211. <tr parent="arrows" class="hidden">
  212. <td class="indent2">arrows.to.scaleFactor</td>
  213. <td class="mid">Number</td>
  214. <td class="mid"><code>1</code></td>
  215. <td>The scale factor allows you to change the size of the arrowhead.</td>
  216. </tr>
  217. <tr parent="arrows" class="hidden">
  218. <td class="indent">arrows.middle</td>
  219. <td class="mid">Object or Boolean</td>
  220. <td class="mid"><code>Object</code></td>
  221. <td>Exactly the same as the to object but with an arrowhead in the center of the edge.</td>
  222. </tr>
  223. <tr parent="arrows" class="hidden">
  224. <td class="indent">arrows.from</td>
  225. <td class="mid">Object or Boolean</td>
  226. <td class="mid"><code>Object</code></td>
  227. <td>Exactly the same as the to object but with an arrowhead at the from node of the edge.</td>
  228. </tr>
  229. <tr class='toggle collapsible' onclick="toggleTable('optionTable','color', this);">
  230. <td><span parent="color" class="right-caret"></span> color</td>
  231. <td class="mid">Object or String</td>
  232. <td class="mid"><code>Object</code></td>
  233. <td>The color object contains the color information of the edge in every situation. When the edge only needs
  234. a single color, a color value like <code>'rgb(120,32,14)'</code>, <code>'#ffffff'</code> or
  235. <code>'red'</code> can be supplied instead of an object.
  236. </td>
  237. </tr>
  238. <tr parent="color" class="hidden">
  239. <td class="indent">color.color</td>
  240. <td class="mid">String</td>
  241. <td class="mid"><code>'#848484'</code></td>
  242. <td>The color of the border of the node when it is not selected or hovered over <i>(assuming hover is
  243. enabled in the interaction module)</i>.
  244. </td>
  245. </tr>
  246. <tr parent="color" class="hidden">
  247. <td class="indent">color.highlight</td>
  248. <td class="mid">String</td>
  249. <td class="mid"><code>'#848484'</code></td>
  250. <td>The color the edge when it is selected.</td>
  251. </tr>
  252. <tr parent="color" class="hidden">
  253. <td class="indent">color.hover</td>
  254. <td class="mid">String</td>
  255. <td class="mid"><code>'#848484'</code></td>
  256. <td>The color the edge when the mouse hovers over it <i>(assuming hover is enabled in the interaction
  257. module)</i>.
  258. </td>
  259. </tr>
  260. <tr parent="color" class="hidden">
  261. <td class="indent">color.inherit</td>
  262. <td class="mid">String or Boolean</td>
  263. <td class="mid"><code>'from'</code></td>
  264. <td><i>When color, highlight or hover are defined, inherit is set to false!</i>
  265. <br><br>Supported options are: <code>true, false, 'from','to','both'</code>.
  266. <br><br>The default value is 'from' which does the same as true: the edge will inherit the color from
  267. the border of the node on the 'from' side.
  268. <br><br>When set to 'to', the border color from the 'to' node will be used.
  269. <br><br>When set to 'both', the color will fade from the from color to the to color. <b>'both' is
  270. computationally intensive</b> because the gradient is recomputed every redraw. This is required
  271. because the angles change when the nodes move.
  272. </td>
  273. </tr>
  274. <tr parent="color" class="hidden">
  275. <td class="indent">color.opacity</td>
  276. <td class="mid">Number</td>
  277. <td class="mid"><code>1.0</code></td>
  278. <td>It can be useful to set the opacity of an edge without manually changing all the colors. The opacity
  279. option will convert all colors (also when using inherit) to adhere to the supplied opacity. The allowed
  280. range of the opacity option is between <code>0 and 1</code>. This is only done once so the performance
  281. impact is not too big.
  282. </td>
  283. </tr>
  284. <tr class='toggle collapsible' onclick="toggleTable('optionTable','dashes', this);">
  285. <td><span parent="dashes" class="right-caret"></span> dashes</td>
  286. <td class="mid">Object or Boolean</td>
  287. <td class="mid"><code>Object</code></td>
  288. <td>When true, the edge will be drawn as a dashed line. You can customize the dashes by supplying an object.
  289. <i>When using dashed lines in IE versions older than 11, the line will be drawn straight, not smooth</i>.
  290. </td>
  291. </tr>
  292. <tr parent="dashes" class="hidden">
  293. <td class="indent">dashes.enabled</td>
  294. <td class="mid">Boolean</td>
  295. <td class="mid"><code>false</code></td>
  296. <td>Toggle the dash drawing style on or off. This option is optional, if undefined and the scaleFactor
  297. property is set, enabled will be set to true.
  298. </td>
  299. </tr>
  300. <tr parent="dashes" class="hidden">
  301. <td class="indent">dashes.pattern</td>
  302. <td class="mid">Array</td>
  303. <td class="mid"><code>[5,5]</code></td>
  304. <td>Array of numbers repeating gap length, dash length, gap length, dash length, ... etc. The array is
  305. repeated until the distance is filled.
  306. </td>
  307. </tr>
  308. <tr class='toggle collapsible' onclick="toggleTable('optionTable','font', this);">
  309. <td><span parent="font" class="right-caret"></span> font</td>
  310. <td class="mid">Object or String</td>
  311. <td class="mid"><code>false</code></td>
  312. <td>This object defines the details of the label. A shorthand is also supported in the form <code>'size face
  313. color'</code> for example: <code>'14px arial red'</code>.
  314. </td>
  315. </tr>
  316. <tr parent="font" class="hidden">
  317. <td class="indent">font.color</td>
  318. <td class="mid">String</td>
  319. <td class="mid"><code>'#343434'</code></td>
  320. <td>Color of the label text.</td>
  321. </tr>
  322. <tr parent="font" class="hidden">
  323. <td class="indent">font.size</td>
  324. <td class="mid">Number</td>
  325. <td class="mid"><code>14</code></td>
  326. <td>Size of the label text.</td>
  327. </tr>
  328. <tr parent="font" class="hidden">
  329. <td class="indent">font.face</td>
  330. <td class="mid">String</td>
  331. <td class="mid"><code>'arial'</code></td>
  332. <td>Font face (or font family) of the label text.</td>
  333. </tr>
  334. <tr parent="font" class="hidden">
  335. <td class="indent">font.background</td>
  336. <td class="mid">String</td>
  337. <td class="mid"><code>undefined</code></td>
  338. <td>When not <code>undefined</code> but a <b>color string</b>, a background rectangle will be drawn behind
  339. the label in the supplied color.
  340. </td>
  341. </tr>
  342. <tr parent="font" class="hidden">
  343. <td class="indent">font.stroke</td>
  344. <td class="mid">Number</td>
  345. <td class="mid"><code>0</code></td>
  346. <td>As an alternative to the background rectangle, a stroke can be drawn around the text. When a value
  347. higher than 0 is supplied, the stroke will be drawn.
  348. </td>
  349. </tr>
  350. <tr parent="font" class="hidden">
  351. <td class="indent">font.strokeColor</td>
  352. <td class="mid">String</td>
  353. <td class="mid"><code>'#ffffff'</code></td>
  354. <td>This is the color of the stroke <i>assuming the value for stroke is higher than 0</i>.</td>
  355. </tr>
  356. <tr parent="font" class="hidden">
  357. <td class="indent">font.align</td>
  358. <td class="mid">String</td>
  359. <td class="mid"><code>'horizontal'</code></td>
  360. <td>Possible options: <code>'horizontal','top','middle','bottom'</code>. The alignment determines how the
  361. label is aligned over the edge. The default value <code>horizontal</code> aligns the label horizontally,
  362. regardless of the orientation of the edge. When an option other than <code>horizontal</code> is chosen,
  363. the label will align itself according to the edge.
  364. </td>
  365. </tr>
  366. <tr>
  367. <td>hidden</td>
  368. <td class="mid">Boolean</td>
  369. <td class="mid"><code>false</code></td>
  370. <td>When true, the edge is not drawn. It is part still part of the physics simulation however!</td>
  371. </tr>
  372. <tr>
  373. <td>hoverWidth</td>
  374. <td class="mid">Number or Function</td>
  375. <td class="mid"><code>0.5</code></td>
  376. <td>Assuming the hover behaviour is enabled in the <a href="./interaction.html">interaction module</a>, the
  377. hoverWidth determines the width of the edge when the user hovers over it with the mouse. If a number is
  378. supplied, this number will be <b>added</b> to the width.
  379. Because the width can be altered by the value and the scaling functions, a constant multiplier or added
  380. value may not give the best results. To solve this, you can supply a function. Example:
  381. <pre class="code">
  382. var options: {
  383. edges: {
  384. hoverWidth: function (width) {return width+1;}
  385. }
  386. }
  387. </pre>
  388. It receives the <code>Number width</code> of the edge. In this simple example we add 1 to the width. You
  389. can taylor the logic in the function as long as it returns a <code>Number</code>.
  390. </td>
  391. </tr>
  392. <tr>
  393. <td>id</td>
  394. <td class="mid">String</td>
  395. <td class="mid"><code>undefined</code></td>
  396. <td>The id of the edge. The id is optional for edges. When not supplied, an UUID will be assigned to the edge.</td>
  397. </tr>
  398. <tr>
  399. <td>label</td>
  400. <td class="mid">String</td>
  401. <td class="mid"><code>undefined</code></td>
  402. <td>The label of the edge. HTML does not work in here because the network uses HTML5 Canvas.</td>
  403. </tr>
  404. <tr>
  405. <td>length</td>
  406. <td class="mid">Number</td>
  407. <td class="mid"><code>undefined</code></td>
  408. <td>The physics simulation gives edges a spring length. This value can override the length of the spring in
  409. rest.
  410. </td>
  411. </tr>
  412. <tr>
  413. <td>physics</td>
  414. <td class="mid">Boolean</td>
  415. <td class="mid"><code>true</code></td>
  416. <td>When true, the edge is part of the physics simulation. When false, it will not act as a spring.</td>
  417. </tr>
  418. <tr class='toggle collapsible' onclick="toggleTable('optionTable','scaling', this);">
  419. <td><span parent="scaling" class="right-caret"></span> scaling</td>
  420. <td class="mid">Object</td>
  421. <td class="mid"><code>Object</code></td>
  422. <td>If the <code>value</code> option is specified, the width of the edges will be scaled according to the
  423. properties in this object. Keep in mind that when using scaling, the <code>width</code> option is
  424. neglected.
  425. </td>
  426. </tr>
  427. <tr parent="scaling" class="hidden">
  428. <td class="indent">scaling.min</td>
  429. <td class="mid">Number</td>
  430. <td class="mid"><code>1</code></td>
  431. <td>If edges have a value, their widths are determined by the value, the scaling function and the min max
  432. values. The min value is the minimum allowed value.
  433. </td>
  434. </tr>
  435. <tr parent="scaling" class="hidden">
  436. <td class="indent">scaling.max</td>
  437. <td class="mid">Number</td>
  438. <td class="mid"><code>15</code></td>
  439. <td>This is the maximum allowed width when the edges are scaled using the value option.</td>
  440. </tr>
  441. <tr parent="scaling" class="hidden">
  442. <td class="indent">scaling.label</td>
  443. <td class="mid">Object or Boolean</td>
  444. <td class="mid"><code>Object</code></td>
  445. <td>When false, the label is not allowed to scale with the edge. If true it will scale using default
  446. settigns. For further customization, you can supply an object.
  447. </td>
  448. </tr>
  449. <tr parent="scaling" class="hidden">
  450. <td class="indent2">scaling.label.enabled</td>
  451. <td class="mid">Boolean</td>
  452. <td class="mid"><code>false</code></td>
  453. <td>Toggle the scaling of the label on or off. If this option is not defined, it is set to true if any of
  454. the properties in this object are defined.
  455. </td>
  456. </tr>
  457. <tr parent="scaling" class="hidden">
  458. <td class="indent2">scaling.label.min</td>
  459. <td class="mid">Number</td>
  460. <td class="mid"><code>14</code></td>
  461. <td>The minimum font-size used for labels when scaling.</td>
  462. </tr>
  463. <tr parent="scaling" class="hidden">
  464. <td class="indent2">scaling.label.max</td>
  465. <td class="mid">Number</td>
  466. <td class="mid"><code>30</code></td>
  467. <td>The maximum font-size used for labels when scaling.</td>
  468. </tr>
  469. <tr parent="scaling" class="hidden">
  470. <td class="indent2">scaling.label.maxVisible</td>
  471. <td class="mid">Number</td>
  472. <td class="mid"><code>30</code></td>
  473. <td>When zooming in, the font is drawn larger as well. You can limit the perceived font size using this
  474. option. If set to 30, the font will never look larger than size 30 zoomed at 100%.
  475. </td>
  476. </tr>
  477. <tr parent="scaling" class="hidden">
  478. <td class="indent2">scaling.label.drawThreshold</td>
  479. <td class="mid">Number</td>
  480. <td class="mid"><code>3</code></td>
  481. <td>When zooming out, the font will be drawn smaller. This defines a lower limit for when the font is drawn.
  482. When using font scaling, you can use this together with the maxVisible to first show labels of important
  483. edges when zoomed out and only show the rest when zooming in.
  484. </td>
  485. </tr>
  486. <tr parent="scaling" class="hidden">
  487. <td class="indent">scaling.customScalingFunction</td>
  488. <td class="mid">Function</td>
  489. <td class="mid">in description</td>
  490. <td>If edges have <code>value</code> fields, this function determines how the size of the nodes are scaled
  491. based on their values. The default function is:
  492. <pre>
  493. function (min,max,total,value) {
  494. if (max === min) {
  495. return 0.5;
  496. }
  497. else {
  498. var scale = 1 / (max - min);
  499. return Math.max(0,(value - min)*scale);
  500. }
  501. }
  502. </pre>
  503. The function receives the minimum value of the set, the maximum value, the total sum of all values and
  504. finally the value of the node or edge it works on. <b>It has to return a value between 0 and 1.</b> The
  505. nodes and edges then calculate their size as follows:
  506. <pre>
  507. var scale = customScalingFunction(min,max,total,value);
  508. var diff = maxWidth - minWidth;
  509. myWidth = minWidth + diff * scale;
  510. </pre>
  511. </td>
  512. </tr>
  513. <tr>
  514. <td>selectionWidth</td>
  515. <td class="mid">Number or Function</td>
  516. <td class="mid"><code>1</code></td>
  517. <td>The selectionWidth determines the width of the edge when the edge is selected. If a number is supplied,
  518. this number will be <b>added</b> to the width.
  519. Because the width can be altered by the value and the scaling functions, a constant multiplier or added
  520. value may not give the best results. To solve this, you can supply a function. Example:
  521. <pre class="code">
  522. var options: {
  523. edges: {
  524. selectionWidth: function (width) {return width*2;}
  525. }
  526. }
  527. </pre>
  528. It receives the <code>Number width</code> of the edge. In this simple example multiply the width by 2.
  529. You can taylor the logic in the function as long as it returns a <code>Number</code>.
  530. </td>
  531. </tr>
  532. <tr>
  533. <td>selfReferenceSize</td>
  534. <td class="mid">Number</td>
  535. <td class="mid"><code>false</code></td>
  536. <td>When the to and from nodes are the same, a circle is drawn. This is the radius of that circle.</td>
  537. </tr>
  538. <tr class='toggle collapsible' onclick="toggleTable('optionTable','shadow', this);">
  539. <td><span parent="shadow" class="right-caret"></span> shadow</td>
  540. <td class="mid">Object or Boolean</td>
  541. <td class="mid"><code>Object</code></td>
  542. <td>When true, the edge casts a shadow using the default settings. This can be further refined by supplying
  543. an object.
  544. </td>
  545. </tr>
  546. <tr parent="shadow" class="hidden">
  547. <td class="indent">shadow.enabled</td>
  548. <td class="mid">Boolean</td>
  549. <td class="mid"><code>false</code></td>
  550. <td>Toggle the casting of shadows. If this option is not defined, it is set to true if any of the properties
  551. in this object are defined.
  552. </td>
  553. </tr>
  554. <tr parent="shadow" class="hidden">
  555. <td class="indent">shadow.size</td>
  556. <td class="mid">Number</td>
  557. <td class="mid"><code>10</code></td>
  558. <td>The blur size of the shadow.</td>
  559. </tr>
  560. <tr parent="shadow" class="hidden">
  561. <td class="indent">shadow.x</td>
  562. <td class="mid">Number</td>
  563. <td class="mid"><code>5</code></td>
  564. <td>The x offset.</td>
  565. </tr>
  566. <tr parent="shadow" class="hidden">
  567. <td class="indent">shadow.y</td>
  568. <td class="mid">Number</td>
  569. <td class="mid"><code>5</code></td>
  570. <td>The y offset.</td>
  571. </tr>
  572. <tr class='toggle collapsible' onclick="toggleTable('optionTable','smooth', this);">
  573. <td><span parent="smooth" class="right-caret"></span> smooth</td>
  574. <td class="mid">Object or Boolean</td>
  575. <td class="mid"><code>Object</code></td>
  576. <td>When true, the edge is drawn as a quadratic bezier curve. The drawing of these curves takes longer than
  577. that of straight curves but it looks better.
  578. There is a difference between dynamic smooth curves and static smooth curves. The dynamic smooth curves
  579. have an invisible support node that takes part in the physics simulation. If you have a lot of edges,
  580. you may want to consider turning off dynamic smooth curves for performance.
  581. </td>
  582. </tr>
  583. <tr parent="smooth" class="hidden">
  584. <td class="indent">smooth.enabled</td>
  585. <td class="mid">Boolean</td>
  586. <td class="mid"><code>true</code></td>
  587. <td>Toggle smooth curves on and off. This is an optional option. If any of the other properties in this
  588. object are set, this option will be set to true.
  589. </td>
  590. </tr>
  591. <tr parent="smooth" class="hidden">
  592. <td class="indent">smooth.dynamic</td>
  593. <td class="mid">Boolean</td>
  594. <td class="mid"><code>false</code></td>
  595. <td>When true, the edges will have an invisible support node guiding the shape. This node is part of the
  596. physics simulation. When false, there are a number of different approximations for smooth curves. Those
  597. can be selected in the type property.
  598. </td>
  599. </tr>
  600. <tr parent="smooth" class="hidden">
  601. <td class="indent">smooth.type</td>
  602. <td class="mid">String</td>
  603. <td class="mid"><code>'continuous'</code></td>
  604. <td>Possible options: <code>'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal',
  605. 'vertical', 'curvedCW', 'curvedCCW'</code>. Take a look at our example 26 to see what these look like
  606. and pick the one that you like best! <i>These do not do anything for dynamic smooth curves</i>.
  607. </td>
  608. </tr>
  609. <tr parent="smooth" class="hidden">
  610. <td class="indent">smooth.roundness</td>
  611. <td class="mid">Number</td>
  612. <td class="mid"><code>0.5</code></td>
  613. <td>Accepted range: <code>0 .. 1.0</code>. This parameter tweaks the roundness of the static smooth curves.
  614. </td>
  615. </tr>
  616. <tr>
  617. <td>title</td>
  618. <td class="mid">String</td>
  619. <td class="mid"><code>undefined</code></td>
  620. <td>The title is shown in a pop-up when the mouse moves over the edge.</td>
  621. </tr>
  622. <tr>
  623. <td>value</td>
  624. <td class="mid">Number</td>
  625. <td class="mid"><code>undefined</code></td>
  626. <td>When a value is set, the edges' width will be scaled using the options in the scaling object defined
  627. above.
  628. </td>
  629. </tr>
  630. <tr>
  631. <td>width</td>
  632. <td class="mid">Number</td>
  633. <td class="mid"><code>1</code></td>
  634. <td>The width of the edge. If value is set, this is not used.</td>
  635. </tr>
  636. </table>
  637. <h3>Methods</h3>
  638. <p>The nodes module has no methods.</p>
  639. <h3>Events</h3>
  640. <p>The nodes module emits no events. Click and select events are emitted from the interaction and selection
  641. modules.</p>
  642. <br/>
  643. <br/>
  644. <br/>
  645. <br/>
  646. <br/>
  647. <br/>
  648. <br/>
  649. </div>
  650. <!-- Bootstrap core JavaScript
  651. ================================================== -->
  652. <!-- Placed at the end of the document so the pages load faster -->
  653. <script src="../js/jquery.min.js"></script>
  654. <script src="../js/bootstrap.min.js"></script>
  655. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  656. <script src="../js/ie10-viewport-bug-workaround.js"></script>