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.

1016 lines
47 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
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. chosen: true,
  111. color: {
  112. color:'#848484',
  113. highlight:'#848484',
  114. hover: '#848484',
  115. inherit: 'from',
  116. opacity:1.0
  117. },
  118. dashes: false,
  119. font: {
  120. color: '#343434',
  121. size: 14, // px
  122. face: 'arial',
  123. background: 'none',
  124. strokeWidth: 2, // px
  125. strokeColor: '#ffffff',
  126. align: 'horizontal',
  127. multi: false,
  128. vadjust: 0,
  129. bold: {
  130. color: '#343434',
  131. size: 14, // px
  132. face: 'arial',
  133. vadjust: 0,
  134. mod: 'bold'
  135. },
  136. ital: {
  137. color: '#343434',
  138. size: 14, // px
  139. face: 'arial',
  140. vadjust: 0,
  141. mod: 'italic',
  142. },
  143. boldital: {
  144. color: '#343434',
  145. size: 14, // px
  146. face: 'arial',
  147. vadjust: 0,
  148. mod: 'bold italic'
  149. },
  150. mono: {
  151. color: '#343434',
  152. size: 15, // px
  153. face: 'courier new',
  154. vadjust: 2,
  155. mod: ''
  156. }
  157. },
  158. hidden: false,
  159. hoverWidth: 1.5,
  160. label: undefined,
  161. labelHighlightBold: true,
  162. length: undefined,
  163. physics: true,
  164. scaling:{
  165. min: 1,
  166. max: 15,
  167. label: {
  168. enabled: true,
  169. min: 14,
  170. max: 30,
  171. maxVisible: 30,
  172. drawThreshold: 5
  173. },
  174. customScalingFunction: function (min,max,total,value) {
  175. if (max === min) {
  176. return 0.5;
  177. }
  178. else {
  179. var scale = 1 / (max - min);
  180. return Math.max(0,(value - min)*scale);
  181. }
  182. }
  183. },
  184. selectionWidth: 1,
  185. selfReferenceSize:20,
  186. shadow:{
  187. enabled: false,
  188. color: 'rgba(0,0,0,0.5)',
  189. size:10,
  190. x:5,
  191. y:5
  192. },
  193. smooth: {
  194. enabled: true,
  195. type: "dynamic",
  196. roundness: 0.5
  197. },
  198. title:undefined,
  199. value: undefined,
  200. width: 1,
  201. widthConstraint: false
  202. }
  203. }
  204. network.setOptions(options);
  205. </pre>
  206. <pre class="prettyprint lang-js options top hidden" id="shortOptions">
  207. // here all options that have shorthand notations are shown.
  208. var options = {
  209. edges:{
  210. arrows: 'to, from',
  211. color: 'red',
  212. font: '12px arial #ff0000',
  213. scaling:{
  214. label: true,
  215. },
  216. shadow: true,
  217. smooth: true,
  218. }
  219. }
  220. network.setOptions(options);
  221. </pre>
  222. <p>These options can also be set per individual edge.</p>
  223. <table class="options" id="optionTable">
  224. <tr>
  225. <th>Name</th>
  226. <th>Type</th>
  227. <th>Default</th>
  228. <th>Description</th>
  229. </tr>
  230. <tr class='toggle collapsible' onclick="toggleTable('optionTable','arrows', this);">
  231. <td><span parent="arrows" class="right-caret"></span> arrows</td>
  232. <td>Object or String</td>
  233. <td><code>undefined</code></td>
  234. <td>To draw an arrow with default settings a string can be supplied. For example: <code>arrows:'to, from,
  235. middle'</code> or <code>'to;from'</code>, any combination with any seperating symbol is fine. If you
  236. want to control the size of the arrowheads, you can supply an object.
  237. </td>
  238. </tr>
  239. <tr parent="arrows" class="hidden">
  240. <td class="indent">arrows.to</td>
  241. <td>Object or Boolean</td>
  242. <td><code>Object</code></td>
  243. <td>When true, an arrowhead on the 'to' side of the edge is drawn, pointing to the 'to' node with default
  244. settings. To customize the size of the arrow, supply an object.
  245. </td>
  246. </tr>
  247. <tr parent="arrows" class="hidden">
  248. <td class="indent2">arrows.to.enabled</td>
  249. <td>Boolean</td>
  250. <td><code>false</code></td>
  251. <td>Toggle the arrow on or off. This option is optional, if undefined and the scaleFactor property is set,
  252. enabled will be set to true.
  253. </td>
  254. </tr>
  255. <tr parent="arrows" class="hidden">
  256. <td class="indent2">arrows.to.scaleFactor</td>
  257. <td>Number</td>
  258. <td><code>1</code></td>
  259. <td>The scale factor allows you to change the size of the arrowhead.</td>
  260. </tr>
  261. <tr parent="arrows" class="hidden">
  262. <td class="indent2">arrows.to.type</td>
  263. <td>String</td>
  264. <td><code>arrow</code></td>
  265. <td>The type of endpoint. Possible values are: <code>arrow</code>, <code>bar</code>, <code>circle</code>. The default is <code>arrow</code>.
  266. </tr>
  267. <tr parent="arrows" class="hidden">
  268. <td class="indent">arrows.middle</td>
  269. <td>Object or Boolean</td>
  270. <td><code>Object</code></td>
  271. <td>Similar to the 'to' object, but with an arrowhead in the center of the edge. The direction of the arrow can be flipped by using a negative value for <code>arrows.middle.scaleFactor</code>.</td>
  272. </tr>
  273. <tr parent="arrows" class="hidden">
  274. <td class="indent">arrows.from</td>
  275. <td>Object or Boolean</td>
  276. <td><code>Object</code></td>
  277. <td>Exactly the same as the to object but with an arrowhead at the from node of the edge.</td>
  278. </tr>
  279. <tr>
  280. <td class="indent">arrowStrikethrough</td>
  281. <td>Boolean</td>
  282. <td><code>true</code></td>
  283. <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>
  284. </tr>
  285. <tr class='toggle collapsible' onclick="toggleTable('optionTable','chosen', this);">
  286. <td><span parent="chosen" class="right-caret"></span> chosen</td>
  287. <td>Object or Boolean</td>
  288. <td><code>true</code></td>
  289. <td>
  290. When true, selecting or hovering on an edge will change it and its label's characteristics according the default.
  291. When false, no change to the edge or its label will occur when the edge is chosen.
  292. If an object is supplied, finer-grained adjustment of edge and label characteristics is available when an edge is chosen.
  293. </td>
  294. </tr>
  295. <tr parent="chosen" class="hidden">
  296. <td class="indent">chosen.edge</td>
  297. <td>Function or Boolean</td>
  298. <td>undefined</td>
  299. <td>
  300. When true, selecting or hovering on an edge will change its characteristics according the default.
  301. When false, no change to the edge will occur when the edge is chosen.
  302. <p>
  303. If a function is supplied, it is called when the edge is chosen.
  304. <pre class="code">
  305. function(values, id, selected, hovering) {
  306. values.<i>property</i> = <i>chosenValue</i>;
  307. }</pre>
  308. </p>
  309. <p>
  310. Any of the incoming arguments may be used to determine characteristic changes.
  311. If a property is not specifically assigned by the supplied function, it will be left unchanged.
  312. A specific function may be assigned to each particular edge in its options, or to all in the network's <code>edges</code> options.
  313. </p>
  314. <p>
  315. The properties define the characteristics that can be changed as follows:
  316. </p>
  317. <table>
  318. <tr><th>Property</th><th>Edge Reference</th></tr>
  319. <tr><td>dashes</td><td>see dashes</td></tr>
  320. <tr><td>toArrow</td><td>see arrows.to.enabled</td></tr>
  321. <tr><td>toArrowScale</td><td>see arrows.to.scaleFactor</td></tr>
  322. <tr><td>toArrowType</td><td>see arrows.to.type</td></tr>
  323. <tr><td>middleArrow</td><td>see arrows.middle.enabled</td></tr>
  324. <tr><td>middleArrowScale</td><td>see arrows.middle.scaleFactor</td></tr>
  325. <tr><td>middleArrowType</td><td>see arrows.middle.type</td></tr>
  326. <tr><td>fromArrow</td><td>see arrows.from.enabled</td></tr>
  327. <tr><td>fromArrowScale</td><td>see arrows.from.scaleFactor</td></tr>
  328. <tr><td>fromArrowType</td><td>see arrows.from.type</td></tr>
  329. <tr><td>arrowStrikethrough</td><td>see arrowStrikethrough</td></tr>
  330. <tr><td>color</td><td>see color.color</td></tr>
  331. <tr><td>inheritsColor</td><td>see color.inherit</td></tr>
  332. <tr><td>opacity</td><td>see color.opacity</td></tr>
  333. <tr><td>hidden</td><td>see hidden</td></tr>
  334. <tr><td>length</td><td>see length</td></tr>
  335. <tr><td>shadow</td><td>see shadow.enabled</td></tr>
  336. <tr><td>shadowColor</td><td>see shadow.color</td></tr>
  337. <tr><td>shadowSize</td><td>see shadow.size</td></tr>
  338. <tr><td>shadowX</td><td>see shadow.x</td></tr>
  339. <tr><td>shadowY</td><td>see shadow.y</td></tr>
  340. <tr><td>width</td><td>see width</td></tr>
  341. </table>
  342. <br/>
  343. </td>
  344. </tr>
  345. <tr parent="chosen" class="hidden">
  346. <td class="indent">chosen.label</td>
  347. <td>Function or Boolean</td>
  348. <td>undefined</td>
  349. <td>
  350. When true, selecting or hovering on an edge will change its label's characteristics according the default.
  351. When false, no change to the edge's label will occur when the edge is chosen.
  352. <p>
  353. If a function is supplied, it is called when the edge is chosen.
  354. <pre class="code">
  355. function(values, id, selected, hovering) {
  356. values.<i>property</i> = <i>chosenValue</i>;
  357. }</pre>
  358. </p>
  359. <p>
  360. Any of the incoming arguments may be used to determine characteristic changes.
  361. If a property is not specifically assigned by the supplied function, it will be left unchanged.
  362. A specific function may be assigned to each particular edge in its options, or to all in the network's <code>edges</code> options.
  363. </p>
  364. <p>
  365. The properties define the characteristics that can be changed as follows:
  366. </p>
  367. <table>
  368. <tr><th>Property</th><th>Edge Reference</th></tr>
  369. <tr><td>color</td><td>see font.color</td></tr>
  370. <tr><td>size</td><td>see font.size</td></tr>
  371. <tr><td>face</td><td>see font.face</td></tr>
  372. <tr><td>mod</td><td>font modifier ('bold', 'italic', etc.)</td></tr>
  373. <tr><td>vadjust</td><td>see font.vadjust</td></tr>
  374. <tr><td>strokeWidth</td><td>see font.strokeWidth</td></tr>
  375. <tr><td>strokeColor</td><td>see font.strokeColor</td></tr>
  376. </table>
  377. <br/>
  378. </td>
  379. </tr>
  380. <tr class='toggle collapsible' onclick="toggleTable('optionTable','color', this);">
  381. <td><span parent="color" class="right-caret"></span> color</td>
  382. <td>Object or String</td>
  383. <td><code>Object</code></td>
  384. <td>The color object contains the color information of the edge in every situation. When the edge only needs
  385. a single color, a color value like <code>'rgb(120,32,14)'</code>, <code>'#ffffff'</code> or
  386. <code>'red'</code> can be supplied instead of an object.
  387. </td>
  388. </tr>
  389. <tr parent="color" class="hidden">
  390. <td class="indent">color.color</td>
  391. <td>String</td>
  392. <td><code>'#848484'</code></td>
  393. <td>The color of the edge when it is not selected or hovered over <i>(assuming hover is
  394. enabled in the interaction module)</i>.
  395. </td>
  396. </tr>
  397. <tr parent="color" class="hidden">
  398. <td class="indent">color.highlight</td>
  399. <td>String</td>
  400. <td><code>'#848484'</code></td>
  401. <td>The color the edge when it is selected.</td>
  402. </tr>
  403. <tr parent="color" class="hidden">
  404. <td class="indent">color.hover</td>
  405. <td>String</td>
  406. <td><code>'#848484'</code></td>
  407. <td>The color the edge when the mouse hovers over it <i>(assuming hover is enabled in the interaction
  408. module)</i>.
  409. </td>
  410. </tr>
  411. <tr parent="color" class="hidden">
  412. <td class="indent">color.inherit</td>
  413. <td>String or Boolean</td>
  414. <td><code>'from'</code></td>
  415. <td><i>When color, highlight or hover are defined, inherit is set to false!</i>
  416. <br><br>Supported options are: <code>true, false, 'from','to','both'</code>.
  417. <br><br>The default value is 'from' which does the same as true: the edge will inherit the color from
  418. the border of the node on the 'from' side.
  419. <br><br>When set to 'to', the border color from the 'to' node will be used.
  420. <br><br>When set to 'both', the color will fade from the from color to the to color. <b>'both' is
  421. computationally intensive</b> because the gradient is recomputed every redraw. This is required
  422. because the angles change when the nodes move.
  423. </td>
  424. </tr>
  425. <tr parent="color" class="hidden">
  426. <td class="indent">color.opacity</td>
  427. <td>Number</td>
  428. <td><code>1.0</code></td>
  429. <td>It can be useful to set the opacity of an edge without manually changing all the colors. The opacity
  430. option will convert all colors (also when using inherit) to adhere to the supplied opacity. The allowed
  431. range of the opacity option is between <code>0 and 1</code>. This is only done once so the performance
  432. impact is not too big.
  433. </td>
  434. </tr>
  435. <tr>
  436. <td>dashes</td>
  437. <td>Array or Boolean</td>
  438. <td><code>false</code></td>
  439. <td>When true, the edge will be drawn as a dashed line. You can customize the dashes by supplying an Array.
  440. Array formart: Array of numbers, gap length, dash length, gap length, dash length, ... etc. The array is
  441. repeated until the distance is filled.
  442. <i>When using dashed lines in IE versions older than 11, the line will be drawn straight, not smooth</i>.
  443. </td>
  444. </tr>
  445. <tr class='toggle collapsible' onclick="toggleTable('optionTable','font', this);">
  446. <td><span parent="font" class="right-caret"></span> font</td>
  447. <td>Object or String</td>
  448. <td><code>false</code></td>
  449. <td>This object defines the details of the label. A shorthand is also supported in the form <code>'size face
  450. color'</code> for example: <code>'14px arial red'</code>.
  451. </td>
  452. </tr>
  453. <tr parent="font" class="hidden">
  454. <td class="indent">font.color</td>
  455. <td>String</td>
  456. <td><code>'#343434'</code></td>
  457. <td>Color of the label text.</td>
  458. </tr>
  459. <tr parent="font" class="hidden">
  460. <td class="indent">font.size</td>
  461. <td>Number</td>
  462. <td><code>14</code></td>
  463. <td>Size of the label text.</td>
  464. </tr>
  465. <tr parent="font" class="hidden">
  466. <td class="indent">font.face</td>
  467. <td>String</td>
  468. <td><code>'arial'</code></td>
  469. <td>Font face (or font family) of the label text.</td>
  470. </tr>
  471. <tr parent="font" class="hidden">
  472. <td class="indent">font.background</td>
  473. <td>String</td>
  474. <td><code>undefined</code></td>
  475. <td>When not <code>undefined</code> but a <b>color string</b>, a background rectangle will be drawn behind
  476. the label in the supplied color.
  477. </td>
  478. </tr>
  479. <tr parent="font" class="hidden">
  480. <td class="indent">font.strokeWidth</td>
  481. <td>Number</td>
  482. <td><code>2</code></td>
  483. <td>As an alternative to the background rectangle, a stroke can be drawn around the text. When a value
  484. higher than 0 is supplied, the stroke will be drawn.
  485. </td>
  486. </tr>
  487. <tr parent="font" class="hidden">
  488. <td class="indent">font.strokeColor</td>
  489. <td>String</td>
  490. <td><code>'#ffffff'</code></td>
  491. <td>This is the color of the stroke <i>assuming the value for stroke is higher than 0</i>.</td>
  492. </tr>
  493. <tr parent="font" class="hidden">
  494. <td class="indent">font.align</td>
  495. <td>String</td>
  496. <td><code>'horizontal'</code></td>
  497. <td>Possible options: <code>'horizontal','top','middle','bottom'</code>. The alignment determines how the
  498. label is aligned over the edge. The default value <code>horizontal</code> aligns the label horizontally,
  499. regardless of the orientation of the edge. When an option other than <code>horizontal</code> is chosen,
  500. the label will align itself according to the edge.
  501. </td>
  502. </tr>
  503. <tr parent="font" class="hidden">
  504. <td class="indent">font.vadjust</td>
  505. <td>String</td>
  506. <td><code>0</code></td>
  507. <td>A font-specific correction to the vertical positioning of the base font in the label text. (Positive is down.)</td>
  508. </tr>
  509. <tr parent="font" class="hidden">
  510. <td class="indent">font.multi</td>
  511. <td>Boolean or String</td>
  512. <td><code>false</code></td>
  513. <td>If <code>false</code>, the label is treated as pure text drawn with the base font. If <code>true</code> or <code>'html'</code> the label may be multifonted, with bold, italic and code markup, interpreted as html. If the value is <code>'markdown'</code> or <code>'md'</code> the label may be multifonted, with bold, italic and code markup, interpreted as markdown.
  514. The bold, italic, bold-italic and monospaced fonts may be set up under in the font.bold, font.ital, font.boldital and font.mono properties, respectively.</td>
  515. </tr>
  516. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','bold', this);">
  517. <td><span parent="bold" class="right-caret"></span> font.bold</td>
  518. <td>Object or String</td>
  519. <td><code>false</code></td>
  520. <td>This object defines the details of the bold font in the label. A shorthand is also supported in the form <code>'size face
  521. color'</code> for example: <code>'14px arial red'</code>.
  522. </td>
  523. </tr>
  524. <tr parent="bold" class="hidden">
  525. <td class="indent">font.bold.color</td>
  526. <td>String</td>
  527. <td><code>'#343434'</code></td>
  528. <td>Color of the bold font in the label text. Defaults to the base font's color.</td>
  529. </tr>
  530. <tr parent="bold" class="hidden">
  531. <td class="indent">font.bold.size</td>
  532. <td>Number</td>
  533. <td><code>14</code></td>
  534. <td>Size of the bold font in the label text. Defaults to the base font's size.</td>
  535. </tr>
  536. <tr parent="bold" class="hidden">
  537. <td class="indent">font.bold.face</td>
  538. <td>String</td>
  539. <td><code>'arial'</code></td>
  540. <td>Font face (or font family) of the bold font in the label text. Defaults to the base font's face.</td>
  541. </tr>
  542. <tr parent="bold" class="hidden">
  543. <td class="indent">font.bold.mod</td>
  544. <td>String</td>
  545. <td><code>'bold'</code></td>
  546. <td>A string added to the face and size when determining the bold font in the label text.</td>
  547. </tr>
  548. <tr parent="bold" class="hidden">
  549. <td class="indent">font.bold.vadjust</td>
  550. <td>String</td>
  551. <td><code>0</code></td>
  552. <td>A font-specific correction to the vertical positioning of the bold italic font in the label text. (Positive is down.) Defaults to the base font's valign.</td>
  553. </tr>
  554. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','ital', this);">
  555. <td><span parent="ital" class="right-caret"></span> font.ital</td>
  556. <td>Object or String</td>
  557. <td><code>false</code></td>
  558. <td>This object defines the details of the italic font in the label. A shorthand is also supported in the form <code>'size face
  559. color'</code> for example: <code>'14px arial red'</code>.
  560. </td>
  561. </tr>
  562. <tr parent="ital" class="hidden">
  563. <td class="indent">font.ital.color</td>
  564. <td>String</td>
  565. <td><code>'#343434'</code></td>
  566. <td>Color of the italic font in the label text. Defaults to the base font's color.</td>
  567. </tr>
  568. <tr parent="ital" class="hidden">
  569. <td class="indent">font.ital.size</td>
  570. <td>Number</td>
  571. <td><code>14</code></td>
  572. <td>Size of the italic font in the label text. Defaults to the base font's size.</td>
  573. </tr>
  574. <tr parent="ital" class="hidden">
  575. <td class="indent">font.ital.face</td>
  576. <td>String</td>
  577. <td><code>'arial'</code></td>
  578. <td>Font face (or font family) of the italic font in the label text. Defaults to the base font's face.</td>
  579. </tr>
  580. <tr parent="ital" class="hidden">
  581. <td class="indent">font.ital.mod</td>
  582. <td>String</td>
  583. <td><code>'italic'</code></td>
  584. <td>A string added to the face and size when determining the italic font in the label text.</td>
  585. </tr>
  586. <tr parent="ital" class="hidden">
  587. <td class="indent">font.ital.vadjust</td>
  588. <td>String</td>
  589. <td><code>0</code></td>
  590. <td>A font-specific correction to the vertical positioning of the italic font in the label text. (Positive is down.) Defaults to the base font's valign.</td>
  591. </tr>
  592. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','boldital', this);">
  593. <td><span parent="boldital" class="right-caret"></span> font.boldital</td>
  594. <td>Object or String</td>
  595. <td><code>false</code></td>
  596. <td>This object defines the details of the bold italic font in the label. A shorthand is also supported in the form <code>'size face
  597. color'</code> for example: <code>'14px arial red'</code>.
  598. </td>
  599. </tr>
  600. <tr parent="boldital" class="hidden">
  601. <td class="indent">font.boldital.color</td>
  602. <td>String</td>
  603. <td><code>'#343434'</code></td>
  604. <td>Color of the bold italic font in the label text. Defaults to the base font's color.</td>
  605. </tr>
  606. <tr parent="boldital" class="hidden">
  607. <td class="indent">font.boldital.size</td>
  608. <td>Number</td>
  609. <td><code>14</code></td>
  610. <td>Size of the bold italic font in the label text. Defaults to the base font's size.</td>
  611. </tr>
  612. <tr parent="boldital" class="hidden">
  613. <td class="indent">font.boldital.face</td>
  614. <td>String</td>
  615. <td><code>'arial'</code></td>
  616. <td>Font face (or font family) of the bold italic font in the label text. Defaults to the base font's face.</td>
  617. </tr>
  618. <tr parent="boldital" class="hidden">
  619. <td class="indent">font.boldital.mod</td>
  620. <td>String</td>
  621. <td><code>'bold'</code></td>
  622. <td>A string added to the face and size when determining the bold italic font in the label text.</td>
  623. </tr>
  624. <tr parent="boldital" class="hidden">
  625. <td class="indent">font.boldital.vadjust</td>
  626. <td>String</td>
  627. <td><code>0</code></td>
  628. <td>A font-specific correction to the vertical positioning of the bold italic font in the label text. (Positive is down.) Defaults to the base font's valign.</td>
  629. </tr>
  630. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','mono', this);">
  631. <td><span parent="mono" class="right-caret"></span> font.mono</td>
  632. <td>Object or String</td>
  633. <td><code>false</code></td>
  634. <td>This object defines the details of the monospaced font in the label. A shorthand is also supported in the form <code>'size face
  635. color'</code> for example: <code>'15px courier red'</code>.
  636. </td>
  637. </tr>
  638. <tr parent="mono" class="hidden">
  639. <td class="indent">font.mono.color</td>
  640. <td>String</td>
  641. <td><code>'#343434'</code></td>
  642. <td>Color of the monospaced font in the label text. Defaults to the base font's color.</td>
  643. </tr>
  644. <tr parent="mono" class="hidden">
  645. <td class="indent">font.mono.size</td>
  646. <td>Number</td>
  647. <td><code>15</code></td>
  648. <td>Size of the monospaced font in the label text. Defaults to the base font's size.</td>
  649. </tr>
  650. <tr parent="mono" class="hidden">
  651. <td class="indent">font.mono.face</td>
  652. <td>String</td>
  653. <td><code>'courier new'</code></td>
  654. <td>Font face (or font family) of the monospaced font in the label text.</td>
  655. </tr>
  656. <tr parent="mono" class="hidden">
  657. <td class="indent">font.mono.mod</td>
  658. <td>String</td>
  659. <td><code>''</code></td>
  660. <td>A string added to the face and size when determining the monospaced font in the label text.</td>
  661. </tr>
  662. <tr parent="mono" class="hidden">
  663. <td class="indent">font.mono.vadjust</td>
  664. <td>String</td>
  665. <td><code>2</code></td>
  666. <td>A font-specific correction to the vertical positioning of the monospaced font in the label text. (Positive is down.) Defaults to the base font's valign.</td>
  667. </tr>
  668. <tr>
  669. <td>from</td>
  670. <td>Number or String</td>
  671. <td></td>
  672. <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>
  673. </tr>
  674. <tr>
  675. <td>hidden</td>
  676. <td>Boolean</td>
  677. <td><code>false</code></td>
  678. <td>When true, the edge is not drawn. It is part still part of the physics simulation however!</td>
  679. </tr>
  680. <tr>
  681. <td>hoverWidth</td>
  682. <td>Number or Function</td>
  683. <td><code>0.5</code></td>
  684. <td>Assuming the hover behaviour is enabled in the <a href="./interaction.html">interaction module</a>, the
  685. hoverWidth determines the width of the edge when the user hovers over it with the mouse. If a number is
  686. supplied, this number will be <b>added</b> to the width.
  687. Because the width can be altered by the value and the scaling functions, a constant multiplier or added
  688. value may not give the best results. To solve this, you can supply a function. Example:
  689. <pre class="code">
  690. var options: {
  691. edges: {
  692. hoverWidth: function (width) {return width+1;}
  693. }
  694. }
  695. </pre>
  696. It receives the <code>Number width</code> of the edge. In this simple example we add 1 to the width. You
  697. can taylor the logic in the function as long as it returns a <code>Number</code>.
  698. </td>
  699. </tr>
  700. <tr>
  701. <td>id</td>
  702. <td>String</td>
  703. <td><code>undefined</code></td>
  704. <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>
  705. </tr>
  706. <tr>
  707. <td>label</td>
  708. <td>String</td>
  709. <td><code>undefined</code></td>
  710. <td>The label of the edge. HTML does not work in here because the network uses HTML5 Canvas.</td>
  711. </tr>
  712. <tr>
  713. <td>labelHighlightBold</td>
  714. <td>Boolean</td>
  715. <td><code>true</code></td>
  716. <td>Determines whether or not the label becomes bold when the edge is selected.</td>
  717. </tr>
  718. <tr>
  719. <td>length</td>
  720. <td>Number</td>
  721. <td><code>undefined</code></td>
  722. <td>The physics simulation gives edges a spring length. This value can override the length of the spring in
  723. rest.
  724. </td>
  725. </tr>
  726. <tr>
  727. <td>physics</td>
  728. <td>Boolean</td>
  729. <td><code>true</code></td>
  730. <td>When true, the edge is part of the physics simulation. When false, it will not act as a spring.</td>
  731. </tr>
  732. <tr class='toggle collapsible' onclick="toggleTable('optionTable','scaling', this);">
  733. <td><span parent="scaling" class="right-caret"></span> scaling</td>
  734. <td>Object</td>
  735. <td><code>Object</code></td>
  736. <td>If the <code>value</code> option is specified, the width of the edges will be scaled according to the
  737. properties in this object. Keep in mind that when using scaling, the <code>width</code> option is
  738. neglected.
  739. </td>
  740. </tr>
  741. <tr parent="scaling" class="hidden">
  742. <td class="indent">scaling.min</td>
  743. <td>Number</td>
  744. <td><code>1</code></td>
  745. <td>If edges have a value, their widths are determined by the value, the scaling function and the min max
  746. values. The min value is the minimum allowed value.
  747. </td>
  748. </tr>
  749. <tr parent="scaling" class="hidden">
  750. <td class="indent">scaling.max</td>
  751. <td>Number</td>
  752. <td><code>15</code></td>
  753. <td>This is the maximum allowed width when the edges are scaled using the value option.</td>
  754. </tr>
  755. <tr parent="scaling" class="hidden">
  756. <td class="indent">scaling.label</td>
  757. <td>Object or Boolean</td>
  758. <td><code>Object</code></td>
  759. <td>When false, the label is not allowed to scale with the edge. If true it will scale using default
  760. settigns. For further customization, you can supply an object.
  761. </td>
  762. </tr>
  763. <tr parent="scaling" class="hidden">
  764. <td class="indent2">scaling.label.enabled</td>
  765. <td>Boolean</td>
  766. <td><code>false</code></td>
  767. <td>Toggle the scaling of the label on or off. If this option is not defined, it is set to true if any of
  768. the properties in this object are defined.
  769. </td>
  770. </tr>
  771. <tr parent="scaling" class="hidden">
  772. <td class="indent2">scaling.label.min</td>
  773. <td>Number</td>
  774. <td><code>14</code></td>
  775. <td>The minimum font-size used for labels when scaling.</td>
  776. </tr>
  777. <tr parent="scaling" class="hidden">
  778. <td class="indent2">scaling.label.max</td>
  779. <td>Number</td>
  780. <td><code>30</code></td>
  781. <td>The maximum font-size used for labels when scaling.</td>
  782. </tr>
  783. <tr parent="scaling" class="hidden">
  784. <td class="indent2">scaling.label.maxVisible</td>
  785. <td>Number</td>
  786. <td><code>30</code></td>
  787. <td>When zooming in, the font is drawn larger as well. You can limit the perceived font size using this
  788. option. If set to 30, the font will never look larger than size 30 zoomed at 100%.
  789. </td>
  790. </tr>
  791. <tr parent="scaling" class="hidden">
  792. <td class="indent2">scaling.label.drawThreshold</td>
  793. <td>Number</td>
  794. <td><code>5</code></td>
  795. <td>When zooming out, the font will be drawn smaller. This defines a lower limit for when the font is drawn.
  796. When using font scaling, you can use this together with the maxVisible to first show labels of important
  797. edges when zoomed out and only show the rest when zooming in.
  798. </td>
  799. </tr>
  800. <tr parent="scaling" class="hidden">
  801. <td class="indent">scaling.customScalingFunction</td>
  802. <td>Function</td>
  803. <td>in description</td>
  804. <td>If edges have <code>value</code> fields, this function determines how the size of the nodes are scaled
  805. based on their values. The default function is:
  806. <pre>
  807. function (min,max,total,value) {
  808. if (max === min) {
  809. return 0.5;
  810. }
  811. else {
  812. var scale = 1 / (max - min);
  813. return Math.max(0,(value - min)*scale);
  814. }
  815. }
  816. </pre>
  817. The function receives the minimum value of the set, the maximum value, the total sum of all values and
  818. finally the value of the node or edge it works on. <b>It has to return a value between 0 and 1.</b> The
  819. nodes and edges then calculate their size as follows:
  820. <pre>
  821. var scale = customScalingFunction(min,max,total,value);
  822. var diff = maxWidth - minWidth;
  823. myWidth = minWidth + diff * scale;
  824. </pre>
  825. Please note: <code>maxWidth</code> and <code>minWidth</code> are the values <code>scaling.max</code>
  826. and <code>scaling.min</code> provided in the options.
  827. </td>
  828. </tr>
  829. <tr>
  830. <td>selectionWidth</td>
  831. <td>Number or Function</td>
  832. <td><code>1</code></td>
  833. <td>The selectionWidth determines the width of the edge when the edge is selected. If a number is supplied,
  834. this number will be <b>added</b> to the width.
  835. Because the width can be altered by the value and the scaling functions, a constant multiplier or added
  836. value may not give the best results. To solve this, you can supply a function. Example:
  837. <pre class="code">
  838. var options: {
  839. edges: {
  840. selectionWidth: function (width) {return width*2;}
  841. }
  842. }
  843. </pre>
  844. It receives the <code>Number width</code> of the edge. In this simple example multiply the width by 2.
  845. You can taylor the logic in the function as long as it returns a <code>Number</code>.
  846. </td>
  847. </tr>
  848. <tr>
  849. <td>selfReferenceSize</td>
  850. <td>Number</td>
  851. <td><code>false</code></td>
  852. <td>When the to and from nodes are the same, a circle is drawn. This is the radius of that circle.</td>
  853. </tr>
  854. <tr class='toggle collapsible' onclick="toggleTable('optionTable','shadow', this);">
  855. <td><span parent="shadow" class="right-caret"></span> shadow</td>
  856. <td>Object or Boolean</td>
  857. <td><code>Object</code></td>
  858. <td>When true, the edge casts a shadow using the default settings. This can be further refined by supplying
  859. an object.
  860. </td>
  861. </tr>
  862. <tr parent="shadow" class="hidden">
  863. <td class="indent">shadow.enabled</td>
  864. <td>Boolean</td>
  865. <td><code>false</code></td>
  866. <td>Toggle the casting of shadows. If this option is not defined, it is set to true if any of the properties
  867. in this object are defined.
  868. </td>
  869. </tr>
  870. <tr parent="shadow" class="hidden">
  871. <td class="indent">shadow.color</td>
  872. <td>String</td>
  873. <td><code>'rgba(0,0,0,0.5)'</code></td>
  874. <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>
  875. </tr>
  876. <tr parent="shadow" class="hidden">
  877. <td class="indent">shadow.size</td>
  878. <td>Number</td>
  879. <td><code>10</code></td>
  880. <td>The blur size of the shadow.</td>
  881. </tr>
  882. <tr parent="shadow" class="hidden">
  883. <td class="indent">shadow.x</td>
  884. <td>Number</td>
  885. <td><code>5</code></td>
  886. <td>The x offset.</td>
  887. </tr>
  888. <tr parent="shadow" class="hidden">
  889. <td class="indent">shadow.y</td>
  890. <td>Number</td>
  891. <td><code>5</code></td>
  892. <td>The y offset.</td>
  893. </tr>
  894. <tr class='toggle collapsible' onclick="toggleTable('optionTable','smooth', this);">
  895. <td><span parent="smooth" class="right-caret"></span> smooth</td>
  896. <td>Object or Boolean</td>
  897. <td><code>Object</code></td>
  898. <td>When true, the edge is drawn as a dynamic quadratic bezier curve. The drawing of these curves takes longer than
  899. that of straight curves but it looks better.
  900. There is a difference between dynamic smooth curves and static smooth curves. The dynamic smooth curves
  901. have an invisible support node that takes part in the physics simulation. If you have a lot of edges,
  902. you may want to consider picking a different type of smooth curves then dynamic for better performance.
  903. </td>
  904. </tr>
  905. <tr parent="smooth" class="hidden">
  906. <td class="indent">smooth.enabled</td>
  907. <td>Boolean</td>
  908. <td><code>true</code></td>
  909. <td>Toggle smooth curves on and off. This is an optional option. If any of the other properties in this
  910. object are set, this option will be set to true.
  911. </td>
  912. </tr>
  913. <tr parent="smooth" class="hidden">
  914. <td class="indent">smooth.type</td>
  915. <td>String</td>
  916. <td><code>'dynamic'</code></td>
  917. <td>Possible options: <code>'dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal',
  918. 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'</code>. Take a look at <a href="http://visjs.org/examples/network/edgeStyles/smooth.html">this example</a> to see what these look like
  919. and pick the one that you like best!
  920. <br><br>
  921. When using dynamic, the edges will have an invisible support node guiding the shape. This node is part of the
  922. physics simulation.
  923. </td>
  924. </tr>
  925. <tr parent="smooth" class="hidden">
  926. <td class="indent">smooth.forceDirection</td>
  927. <td>String or Boolean</td>
  928. <td><code>false</code></td>
  929. <td>Accepted options: <code>['horizontal', 'vertical', 'none']</code>. This options is only used with the cubicBezier curves. When true, horizontal is chosen, when false,
  930. 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.
  931. </td>
  932. </tr>
  933. <tr parent="smooth" class="hidden">
  934. <td class="indent">smooth.roundness</td>
  935. <td>Number</td>
  936. <td><code>0.5</code></td>
  937. <td>Accepted range: <code>0 .. 1.0</code>. This parameter tweaks the roundness of the smooth curves for all types EXCEPT dynamic.
  938. </td>
  939. </tr>
  940. <tr>
  941. <td>title</td>
  942. <td>String</td>
  943. <td><code>undefined</code></td>
  944. <td>The title is shown in a pop-up when the mouse moves over the edge.</td>
  945. </tr>
  946. <tr>
  947. <td>to</td>
  948. <td>Number or String</td>
  949. <td></td>
  950. <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>
  951. </tr>
  952. <tr>
  953. <td>value</td>
  954. <td>Number</td>
  955. <td><code>undefined</code></td>
  956. <td>When a value is set, the edges' width will be scaled using the options in the scaling object defined
  957. above.
  958. </td>
  959. </tr>
  960. <tr>
  961. <td>width</td>
  962. <td>Number</td>
  963. <td><code>1</code></td>
  964. <td>The width of the edge. If value is set, this is not used.</td>
  965. </tr>
  966. <tr class='toggle collapsible' onclick="toggleTable('optionTable','widthConstraint', this);">
  967. <td><span parent="widthConstraint" class="right-caret"></span> widthConstraint</td>
  968. <td>Number, Boolean or Object</td>
  969. <td><code>false</code></td>
  970. <td>If false, no widthConstraint is applied. If a number is specified, the maximum width of the edge's label is set to the value. The edge's label's lines will be broken on spaces to stay below the maximum.</td>
  971. </tr>
  972. <tr parent="widthConstraint" class="hidden">
  973. <td class="indent">widthConstraint.maximum</td>
  974. <td>Number</td>
  975. <td><code>undefined</code></td>
  976. <td>If a number is specified, the maximum width of the edge's label is set to the value. The edge's label's lines will be broken on spaces to stay below the maximum.</td>
  977. </tr>
  978. </table>
  979. </div>
  980. <!-- Bootstrap core JavaScript
  981. ================================================== -->
  982. <!-- Placed at the end of the document so the pages load faster -->
  983. <script src="../js/jquery.min.js"></script>
  984. <script src="../js/bootstrap.min.js"></script>
  985. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  986. <script src="../js/ie10-viewport-bug-workaround.js"></script>
  987. <!-- jquery extensions -->
  988. <script src="../js/jquery.highlight.js"></script>
  989. <script src="../js/jquery.url.min.js"></script>
  990. <!-- Tipue vendor js -->
  991. <script src="../js/tipuesearch.config.js"></script>
  992. <script src="../js/tipuesearch.js"></script>
  993. <!-- controller -->
  994. <script src="../js/main.js"></script>