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.

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