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.

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