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.

659 lines
29 KiB

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