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.

1091 lines
51 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
  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 - Nodes 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. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  17. <!--[if lt IE 9]>
  18. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  19. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  20. <![endif]-->
  21. <link href="../css/prettify.css" type="text/css" rel="stylesheet"/>
  22. <script type="text/javascript" src="../js/googleAnalytics.js"></script>
  23. <script type="text/javascript" src="../js/prettify/prettify.js"></script>
  24. <script src="../js/smooth-scroll.min.js"></script>
  25. <script language="JavaScript">
  26. smoothScroll.init();
  27. </script>
  28. <script type="text/javascript" src="../js/toggleTable.js"></script>
  29. </head>
  30. <body onload="prettyPrint();">
  31. <div class="navbar-wrapper">
  32. <div class="container">
  33. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  34. <div class="container">
  35. <div class="navbar-header">
  36. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
  37. aria-expanded="false" aria-controls="navbar">
  38. <span class="sr-only">Toggle navigation</span>
  39. <span class="icon-bar"></span>
  40. <span class="icon-bar"></span>
  41. <span class="icon-bar"></span>
  42. </button>
  43. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  44. </div>
  45. <div id="navbar" class="navbar-collapse collapse">
  46. <ul class="nav navbar-nav">
  47. <li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
  48. <li><a href="http://www.visjs.org/blog.html">Blog</a></li>
  49. <li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
  50. <li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
  51. <li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
  52. <li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
  53. <li><a href="http://www.visjs.org/index.html#licenses">License</a></li>
  54. </ul>
  55. <form class="navbar-form navbar-right" role="search">
  56. <input name="q" id="tipue_search_input" autocomplete="off" type="text" class="form-control" placeholder="Enter keywords">
  57. <button type="button" class="btn btn-default" onclick="vis.initSiteSearch(true);">Go!</button>
  58. </form>
  59. <div id="search-results-wrapper" class="panel panel-default">
  60. <div class="panel-body">
  61. <div id="tipue_search_content"></div>
  62. </div>
  63. </div>
  64. <div id="keyword-info" class="panel panel-success">
  65. <div class="panel-body">
  66. Found <span id="keyword-count"></span> results. Click <a id="keyword-jumper-button" href="">here</a> to jump to the first keyword occurence!
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </nav>
  72. </div>
  73. </div>
  74. <a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img
  75. style="position: absolute; top: 0; right: 0; border: 0;"
  76. src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
  77. alt="Fork me on GitHub"
  78. data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
  79. <div class="container full">
  80. <h1>Network - nodes</h1>
  81. <p>Handles the creation and deletion of nodes and contains the global node options and styles.</p>
  82. <h3>Options</h3>
  83. <p>The options for the nodes have to be contained in an object titled 'nodes'. All of these options can be supplied per node as well. Obviously, 'id' should not be defined globally but per node. Options defined
  84. in the global nodes object, are applied to all nodes. If a node has options of its own, those will be used instead of the global options.</p>
  85. <p><b><i>When you have given a node an option, you will override the global option for that property, and also the group option for that property if the node is in a group. If you then set that option to <code>null</code>,
  86. it will revert back to the default value.</i></b>
  87. </p>
  88. <p>Click on the full options or shorthand options to show how these options are supposed to be used.</p>
  89. <ul class="nav nav-tabs">
  90. <li role="presentation" class="active" onclick="toggleTab(this)"><a href="#">options hidden</a></li>
  91. <li role="presentation" onclick="toggleTab(this);" targetNode="fullOptions"><a href="#">full options</a></li>
  92. <li role="presentation" onclick="toggleTab(this);" targetNode="shortOptions"><a href="#">shorthand options</a></li>
  93. </ul>
  94. <br>
  95. <pre class="prettyprint lang-js options top hidden" id="fullOptions">
  96. // these are all options in full.
  97. var options = {
  98. nodes:{
  99. borderWidth: 1,
  100. borderWidthSelected: 2,
  101. brokenImage:undefined,
  102. chosen: true,
  103. color: {
  104. border: '#2B7CE9',
  105. background: '#97C2FC',
  106. highlight: {
  107. border: '#2B7CE9',
  108. background: '#D2E5FF'
  109. },
  110. hover: {
  111. border: '#2B7CE9',
  112. background: '#D2E5FF'
  113. }
  114. },
  115. fixed: {
  116. x:false,
  117. y:false
  118. },
  119. font: {
  120. color: '#343434',
  121. size: 14, // px
  122. face: 'arial',
  123. background: 'none',
  124. strokeWidth: 0, // px
  125. strokeColor: '#ffffff',
  126. align: 'center',
  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. group: undefined,
  159. heightConstraint: false,
  160. hidden: false,
  161. icon: {
  162. face: 'FontAwesome',
  163. code: undefined,
  164. size: 50, //50,
  165. color:'#2B7CE9'
  166. },
  167. image: undefined,
  168. label: undefined,
  169. labelHighlightBold: true,
  170. level: undefined,
  171. mass: 1,
  172. physics: true,
  173. scaling: {
  174. min: 10,
  175. max: 30,
  176. label: {
  177. enabled: false,
  178. min: 14,
  179. max: 30,
  180. maxVisible: 30,
  181. drawThreshold: 5
  182. },
  183. customScalingFunction: function (min,max,total,value) {
  184. if (max === min) {
  185. return 0.5;
  186. }
  187. else {
  188. let scale = 1 / (max - min);
  189. return Math.max(0,(value - min)*scale);
  190. }
  191. }
  192. },
  193. shadow:{
  194. enabled: false,
  195. color: 'rgba(0,0,0,0.5)',
  196. size:10,
  197. x:5,
  198. y:5
  199. },
  200. shape: 'ellipse',
  201. shapeProperties: {
  202. borderDashes: false, // only for borders
  203. borderRadius: 6, // only for box shape
  204. interpolation: false, // only for image and circularImage shapes
  205. useImageSize: false, // only for image and circularImage shapes
  206. useBorderWithImage: false // only for image shape
  207. }
  208. size: 25,
  209. title: undefined,
  210. value: undefined,
  211. widthConstraint: false,
  212. x: undefined,
  213. y: undefined
  214. }
  215. }
  216. network.setOptions(options);
  217. </pre>
  218. <pre class="prettyprint lang-js options top hidden" id="shortOptions">
  219. // only the options that have shorthand notations are shown.
  220. var options = {
  221. nodes:{
  222. color: '#ff0000',
  223. fixed: false,
  224. font: '12px arial red',
  225. scaling: {
  226. label: true
  227. },
  228. shadow: true
  229. }
  230. }
  231. network.setOptions(options);
  232. </pre>
  233. <p>These options can also be set per individual node. All of the individual options are explained here:</p>
  234. <table class="options" id="optionTable">
  235. <tr>
  236. <th>Name</th>
  237. <th>Type</th>
  238. <th>Default</th>
  239. <th>Description</th>
  240. </tr>
  241. <tr>
  242. <td>borderWidth</td>
  243. <td>Number</td>
  244. <td><code>1</code></td>
  245. <td>The width of the border of the node.</td>
  246. </tr>
  247. <tr>
  248. <td>borderWidthSelected</td>
  249. <td>Number</td>
  250. <td><code>2</code></td>
  251. <td>The width of the border of the node when it is selected. When undefined, the borderWidth * 2 is used.</td>
  252. </tr>
  253. <tr>
  254. <td>brokenImage</td>
  255. <td>String</td>
  256. <td><code>undefined</code></td>
  257. <td>When the shape is set to <code>image</code> or <code>circularImage</code>, this option can be an URL to
  258. a backup image in case the URL supplied in the image option cannot be resolved.
  259. </td>
  260. </tr>
  261. <tr class='toggle collapsible' onclick="toggleTable('optionTable','chosen', this);">
  262. <td><span parent="chosen" class="right-caret"></span> chosen</td>
  263. <td>Object or Boolean</td>
  264. <td><code>true</code></td>
  265. <td>
  266. When true, selecting or hovering on a node will change it and its label's characteristics according the default.
  267. When false, no change to the node or its label will occur when the node is chosen.
  268. If an object is supplied, finer-grained adjustment of node and label characteristics is available when a node is chosen.
  269. </td>
  270. </tr>
  271. <tr parent="chosen" class="hidden">
  272. <td class="indent">chosen.node</td>
  273. <td>Function or Boolean</td>
  274. <td>undefined</td>
  275. <td>
  276. When true, selecting or hovering on a node will change its characteristics according the default.
  277. When false, no change to the node will occur when the node is chosen.
  278. <p>
  279. If a function is supplied, it is called when the node is chosen.
  280. <pre class="code">
  281. function(values, id, selected, hovering) {
  282. values.<i>property</i> = <i>chosenValue</i>;
  283. }</pre>
  284. </p>
  285. <p>
  286. Any of the incoming arguments may be used to determine characteristic changes.
  287. If a property is not specifically assigned by the supplied function, it will be left unchanged.
  288. A specific function may be assigned to each particular node in its options, or to all in the network's <code>nodes</code> options.
  289. </p>
  290. <p>
  291. The properties define the characteristics that can be changed as follows:
  292. </p>
  293. <table>
  294. <tr><th>Property</th><th>Node Reference</th></tr>
  295. <tr><td>color</td><td>see color.background</td></tr>
  296. <tr><td>borderWidth</td><td>see borderWidth</td></tr>
  297. <tr><td>borderColor</td><td>see color.border</td></tr>
  298. <tr><td>size</td><td>see size</td></tr>
  299. <tr><td>borderDashes</td><td>see shapeProperties.borderDashes</td></tr>
  300. <tr><td>borderRadius</td><td>see shapeProperties.borderRadius</td></tr>
  301. <tr><td>shadow</td><td>see shadow.enabled</td></tr>
  302. <tr><td>shadowColor</td><td>see shadow.color</td></tr>
  303. <tr><td>shadowSize</td><td>see shadow.size</td></tr>
  304. <tr><td>shadowX</td><td>see shadow.x</td></tr>
  305. <tr><td>shadowY</td><td>see shadow.y</td></tr>
  306. </table>
  307. <br/>
  308. </td>
  309. </tr>
  310. <tr parent="chosen" class="hidden">
  311. <td class="indent">chosen.label</td>
  312. <td>Function or Boolean</td>
  313. <td>undefined</td>
  314. <td>
  315. When true, selecting or hovering on a node will change its label's characteristics according the default.
  316. When false, no change to the node's label will occur when the node is chosen.
  317. <p>
  318. If a function is supplied, it is called when the node is chosen.
  319. <pre class="code">
  320. function(values, id, selected, hovering) {
  321. values.<i>property</i> = <i>chosenValue</i>;
  322. }</pre>
  323. </p>
  324. <p>
  325. Any of the incoming arguments may be used to determine characteristic changes.
  326. If a property is not specifically assigned by the supplied function, it will be left unchanged.
  327. A specific function may be assigned to each particular node in its options, or to all in the network's <code>nodes</code> options.
  328. </p>
  329. <p>
  330. The properties define the characteristics that can be changed as follows:
  331. </p>
  332. <table>
  333. <tr><th>Property</th><th>Node Reference</th></tr>
  334. <tr><td>color</td><td>see font.color</td></tr>
  335. <tr><td>size</td><td>see font.size</td></tr>
  336. <tr><td>face</td><td>see font.face</td></tr>
  337. <tr><td>mod</td><td>font modifier ('bold', 'italic', etc.)</td></tr>
  338. <tr><td>vadjust</td><td>see font.vadjust</td></tr>
  339. <tr><td>strokeWidth</td><td>see font.strokeWidth</td></tr>
  340. <tr><td>strokeColor</td><td>see font.strokeColor</td></tr>
  341. </table>
  342. <br/>
  343. </td>
  344. </tr>
  345. <tr class='toggle collapsible' onclick="toggleTable('optionTable','color', this);">
  346. <td><span parent="color" class="right-caret"></span> color</td>
  347. <td>Object or String</td>
  348. <td><code>Object</code></td>
  349. <td>The color object contains the color information of the node in every situation. When the node only needs
  350. a single color, a color value like <code>'rgba(120,32,14,1)'</code>, <code>'#ffffff'</code> or <code>'red'</code>
  351. can be supplied instead of an object.
  352. </td>
  353. </tr>
  354. <tr parent="color" class="hidden">
  355. <td class="indent">color.border</td>
  356. <td>String</td>
  357. <td><code>'#2B7CE9'</code></td>
  358. <td>The color of the border of the node when it is not selected or hovered over <i>(assuming hover is
  359. enabled in the interaction module)</i>.
  360. </td>
  361. </tr>
  362. <tr parent="color" class="hidden">
  363. <td class="indent">color.background</td>
  364. <td>String</td>
  365. <td><code>'#D2E5FF'</code></td>
  366. <td>The color of the background of the node when it is not selected or hovered over <i>(assuming hover is
  367. enabled in the interaction module)</i>.
  368. </td>
  369. </tr>
  370. <tr parent="color" class="hidden">
  371. <td class="indent">color.highlight</td>
  372. <td>Object or String</td>
  373. <td><code>Object</code></td>
  374. <td>The color the node when it is selected. Alternatively you can just supply a string color value.</td>
  375. </tr>
  376. <tr parent="color" class="hidden">
  377. <td class="indent2">color.highlight.border</td>
  378. <td>String</td>
  379. <td><code>'#2B7CE9'</code></td>
  380. <td>The color of the border of the node when it is selected.</td>
  381. </tr>
  382. <tr parent="color" class="hidden">
  383. <td class="indent2">color.highlight.background</td>
  384. <td>String</td>
  385. <td><code>'#D2E5FF'</code></td>
  386. <td>The color of the background of the node when it is selected.</td>
  387. </tr>
  388. <tr parent="color" class="hidden">
  389. <td class="indent">color.hover</td>
  390. <td>Object or String</td>
  391. <td><code>Object</code></td>
  392. <td>The color the node when the mouse hovers over it <i>(assuming hover is enabled in the interaction
  393. module)</i>. Shorthand like above is also supported.
  394. </td>
  395. </tr>
  396. <tr parent="color" class="hidden">
  397. <td class="indent2">color.hover.border</td>
  398. <td>String</td>
  399. <td><code>'#2B7CE9'</code></td>
  400. <td>The color of the border of the node when the mouse hovers over it <i>(assuming hover is enabled in the
  401. interaction module)</i>.
  402. </td>
  403. </tr>
  404. <tr parent="color" class="hidden">
  405. <td class="indent2">color.hover.background</td>
  406. <td>String</td>
  407. <td><code>'#D2E5FF'</code></td>
  408. <td>The color of the background of the node when the mouse hovers over it <i>(assuming hover is enabled in
  409. the interaction module)</i>.
  410. </td>
  411. </tr>
  412. <tr class='toggle collapsible' onclick="toggleTable('optionTable','fixed', this);">
  413. <td><span parent="fixed" class="right-caret"></span> fixed</td>
  414. <td>Object or Boolean</td>
  415. <td><code>Object</code></td>
  416. <td>When true, the node will not move but IS part of the physics simulation. When defined as an object,
  417. movement in either X or Y direction can be disabled.
  418. </td>
  419. </tr>
  420. <tr parent="fixed" class="hidden">
  421. <td class="indent">fixed.x</td>
  422. <td>Boolean</td>
  423. <td><code>false</code></td>
  424. <td>When true, the node will not move in the X direction.</td>
  425. </tr>
  426. <tr parent="fixed" class="hidden">
  427. <td class="indent">fixed.y</td>
  428. <td>Boolean</td>
  429. <td><code>false</code></td>
  430. <td>When true, the node will not move in the Y direction.</td>
  431. </tr>
  432. <tr class='toggle collapsible' onclick="toggleTable('optionTable','font', this);">
  433. <td><span parent="font" class="right-caret"></span> font</td>
  434. <td>Object or String</td>
  435. <td><code>false</code></td>
  436. <td>This object defines the details of the label. A shorthand is also supported in the form <code>'size face
  437. color'</code> for example: <code>'14px arial red'</code>.
  438. </td>
  439. </tr>
  440. <tr parent="font" class="hidden">
  441. <td class="indent">font.color</td>
  442. <td>String</td>
  443. <td><code>'#343434'</code></td>
  444. <td>Color of the label text.</td>
  445. </tr>
  446. <tr parent="font" class="hidden">
  447. <td class="indent">font.size</td>
  448. <td>Number</td>
  449. <td><code>14</code></td>
  450. <td>Size of the label text.</td>
  451. </tr>
  452. <tr parent="font" class="hidden">
  453. <td class="indent">font.face</td>
  454. <td>String</td>
  455. <td><code>'arial'</code></td>
  456. <td>Font face (or font family) of the label text.</td>
  457. </tr>
  458. <tr parent="font" class="hidden">
  459. <td class="indent">font.background</td>
  460. <td>String</td>
  461. <td><code>undefined</code></td>
  462. <td>When not <code>undefined</code> but a <b>color string</b>, a background rectangle will be drawn behind
  463. the label in the supplied color.
  464. </td>
  465. </tr>
  466. <tr parent="font" class="hidden">
  467. <td class="indent">font.strokeWidth</td>
  468. <td>Number</td>
  469. <td><code>0</code></td>
  470. <td>As an alternative to the background rectangle, a stroke can be drawn around the text. When a value
  471. higher than 0 is supplied, the stroke will be drawn.
  472. </td>
  473. </tr>
  474. <tr parent="font" class="hidden">
  475. <td class="indent">font.strokeColor</td>
  476. <td>String</td>
  477. <td><code>'#ffffff'</code></td>
  478. <td>This is the color of the stroke <i>assuming the value for stroke is higher than 0</i>.</td>
  479. </tr>
  480. <tr parent="font" class="hidden">
  481. <td class="indent">font.align</td>
  482. <td>String</td>
  483. <td><code>'center'</code></td>
  484. <td>This can be set to 'left' to make the label left-aligned. Otherwise,
  485. defaults to 'center'.</td>
  486. </tr>
  487. <tr parent="font" class="hidden">
  488. <td class="indent">font.vadjust</td>
  489. <td>String</td>
  490. <td><code>0</code></td>
  491. <td>A font-specific correction to the vertical positioning of the base font in the label text. (Positive is down.)</td>
  492. </tr>
  493. <tr parent="font" class="hidden">
  494. <td class="indent">font.multi</td>
  495. <td>Boolean or String</td>
  496. <td><code>false</code></td>
  497. <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.
  498. 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>
  499. </tr>
  500. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','bold', this);">
  501. <td><span parent="bold" class="right-caret"></span> font.bold</td>
  502. <td>Object or String</td>
  503. <td><code>false</code></td>
  504. <td>This object defines the details of the bold font in the label. A shorthand is also supported in the form <code>'size face
  505. color'</code> for example: <code>'14px arial red'</code>.
  506. </td>
  507. </tr>
  508. <tr parent="bold" class="hidden">
  509. <td class="indent">font.bold.color</td>
  510. <td>String</td>
  511. <td><code>'#343434'</code></td>
  512. <td>Color of the bold font in the label text. Defaults to the base font's color.</td>
  513. </tr>
  514. <tr parent="bold" class="hidden">
  515. <td class="indent">font.bold.size</td>
  516. <td>Number</td>
  517. <td><code>14</code></td>
  518. <td>Size of the bold font in the label text. Defaults to the base font's size.</td>
  519. </tr>
  520. <tr parent="bold" class="hidden">
  521. <td class="indent">font.bold.face</td>
  522. <td>String</td>
  523. <td><code>'arial'</code></td>
  524. <td>Font face (or font family) of the bold font in the label text. Defaults to the base font's face.</td>
  525. </tr>
  526. <tr parent="bold" class="hidden">
  527. <td class="indent">font.bold.mod</td>
  528. <td>String</td>
  529. <td><code>'bold'</code></td>
  530. <td>A string added to the face and size when determining the bold font in the label text.</td>
  531. </tr>
  532. <tr parent="bold" class="hidden">
  533. <td class="indent">font.bold.vadjust</td>
  534. <td>String</td>
  535. <td><code>0</code></td>
  536. <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>
  537. </tr>
  538. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','ital', this);">
  539. <td><span parent="ital" class="right-caret"></span> font.ital</td>
  540. <td>Object or String</td>
  541. <td><code>false</code></td>
  542. <td>This object defines the details of the italic font in the label. A shorthand is also supported in the form <code>'size face
  543. color'</code> for example: <code>'14px arial red'</code>.
  544. </td>
  545. </tr>
  546. <tr parent="ital" class="hidden">
  547. <td class="indent">font.ital.color</td>
  548. <td>String</td>
  549. <td><code>'#343434'</code></td>
  550. <td>Color of the italic font in the label text. Defaults to the base font's color.</td>
  551. </tr>
  552. <tr parent="ital" class="hidden">
  553. <td class="indent">font.ital.size</td>
  554. <td>Number</td>
  555. <td><code>14</code></td>
  556. <td>Size of the italic font in the label text. Defaults to the base font's size.</td>
  557. </tr>
  558. <tr parent="ital" class="hidden">
  559. <td class="indent">font.ital.face</td>
  560. <td>String</td>
  561. <td><code>'arial'</code></td>
  562. <td>Font face (or font family) of the italic font in the label text. Defaults to the base font's face.</td>
  563. </tr>
  564. <tr parent="ital" class="hidden">
  565. <td class="indent">font.ital.mod</td>
  566. <td>String</td>
  567. <td><code>'italic'</code></td>
  568. <td>A string added to the face and size when determining the italic font in the label text.</td>
  569. </tr>
  570. <tr parent="ital" class="hidden">
  571. <td class="indent">font.ital.vadjust</td>
  572. <td>String</td>
  573. <td><code>0</code></td>
  574. <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>
  575. </tr>
  576. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','boldital', this);">
  577. <td><span parent="boldital" class="right-caret"></span> font.boldital</td>
  578. <td>Object or String</td>
  579. <td><code>false</code></td>
  580. <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
  581. color'</code> for example: <code>'14px arial red'</code>.
  582. </td>
  583. </tr>
  584. <tr parent="boldital" class="hidden">
  585. <td class="indent">font.boldital.color</td>
  586. <td>String</td>
  587. <td><code>'#343434'</code></td>
  588. <td>Color of the bold italic font in the label text. Defaults to the base font's color.</td>
  589. </tr>
  590. <tr parent="boldital" class="hidden">
  591. <td class="indent">font.boldital.size</td>
  592. <td>Number</td>
  593. <td><code>14</code></td>
  594. <td>Size of the bold italic font in the label text. Defaults to the base font's size.</td>
  595. </tr>
  596. <tr parent="boldital" class="hidden">
  597. <td class="indent">font.boldital.face</td>
  598. <td>String</td>
  599. <td><code>'arial'</code></td>
  600. <td>Font face (or font family) of the bold italic font in the label text. Defaults to the base font's face.</td>
  601. </tr>
  602. <tr parent="boldital" class="hidden">
  603. <td class="indent">font.boldital.mod</td>
  604. <td>String</td>
  605. <td><code>'bold'</code></td>
  606. <td>A string added to the face and size when determining the bold italic font in the label text.</td>
  607. </tr>
  608. <tr parent="boldital" class="hidden">
  609. <td class="indent">font.boldital.vadjust</td>
  610. <td>String</td>
  611. <td><code>0</code></td>
  612. <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>
  613. </tr>
  614. <tr parent="font" class='hidden toggle collapsible' onclick="toggleTable('optionTable','mono', this);">
  615. <td><span parent="mono" class="right-caret"></span> font.mono</td>
  616. <td>Object or String</td>
  617. <td><code>false</code></td>
  618. <td>This object defines the details of the monospaced font in the label. A shorthand is also supported in the form <code>'size face
  619. color'</code> for example: <code>'15px courier red'</code>.
  620. </td>
  621. </tr>
  622. <tr parent="mono" class="hidden">
  623. <td class="indent">font.mono.color</td>
  624. <td>String</td>
  625. <td><code>'#343434'</code></td>
  626. <td>Color of the monospaced font in the label text. Defaults to the base font's color.</td>
  627. </tr>
  628. <tr parent="mono" class="hidden">
  629. <td class="indent">font.mono.size</td>
  630. <td>Number</td>
  631. <td><code>15</code></td>
  632. <td>Size of the monospaced font in the label text. Defaults to the base font's size.</td>
  633. </tr>
  634. <tr parent="mono" class="hidden">
  635. <td class="indent">font.mono.face</td>
  636. <td>String</td>
  637. <td><code>'courier new'</code></td>
  638. <td>Font face (or font family) of the monospaced font in the label text.</td>
  639. </tr>
  640. <tr parent="mono" class="hidden">
  641. <td class="indent">font.mono.mod</td>
  642. <td>String</td>
  643. <td><code>''</code></td>
  644. <td>A string added to the face and size when determining the monospaced font in the label text.</td>
  645. </tr>
  646. <tr parent="mono" class="hidden">
  647. <td class="indent">font.mono.vadjust</td>
  648. <td>String</td>
  649. <td><code>2</code></td>
  650. <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>
  651. </tr>
  652. <tr>
  653. <td>group</td>
  654. <td>String</td>
  655. <td><code>undefined</code></td>
  656. <td>When not <code>undefined</code>, the node will belong to the defined group. Styling information of
  657. that group will apply to this node. Node specific styling overrides group styling.
  658. </td>
  659. </tr>
  660. <tr class='toggle collapsible' onclick="toggleTable('optionTable','heightConstraint', this);">
  661. <td><span parent="heightConstraint" class="right-caret"></span> heightConstraint</td>
  662. <td>Number, Boolean or Object</td>
  663. <td><code>false</code></td>
  664. <td>If false, no heightConstraint is applied. If a number is specified, the value is used as the minimum height of the node. The node's height will be be set to the minimum if less than the value.</td>
  665. </tr>
  666. <tr parent="heightConstraint" class="hidden">
  667. <td class="indent">heightConstraint.minimum</td>
  668. <td>Number</td>
  669. <td><code>undefined</code></td>
  670. <td>If a number is specified, the value is used as the minimum height of the node. The node's height will be be set to the minimum if less than the value.</td>
  671. </tr>
  672. <tr parent="heightConstraint" class="hidden">
  673. <td class="indent">heightConstraint.valign</td>
  674. <td>String</td>
  675. <td><code>'middle'</code></td>
  676. <td>Valid values are <code>'top'</code>, <code>'middle'</code>, and <code>'bottom'</code>.
  677. When specified, if the height of the label text is less than the minimum (including any top or bottom margins), it will be offset vertically to the designated position.</td>
  678. </tr>
  679. <tr>
  680. <td>hidden</td>
  681. <td>Boolean</td>
  682. <td><code>false</code></td>
  683. <td>When true, the node will not be shown. It will still be part of the physics simulation though!</td>
  684. </tr>
  685. <tr class='toggle collapsible' onclick="toggleTable('optionTable','icon', this);">
  686. <td><span parent="icon" class="right-caret"></span> icon</td>
  687. <td>Object</td>
  688. <td><code>Object</code></td>
  689. <td>These options are only used when the shape is set to <code>icon</code>.</td>
  690. </tr>
  691. <tr parent="icon" class="hidden">
  692. <td class="indent">icon.face</td>
  693. <td>String</td>
  694. <td><code>'FontAwesome'</code></td>
  695. <td>These options are only used when the shape is set to <code>icon</code>. The possible options for the
  696. face are: <code>'FontAwesome'</code> and <code>'Ionicons'</code>.
  697. </td>
  698. </tr>
  699. <tr parent="icon" class="hidden">
  700. <td class="indent">icon.code</td>
  701. <td>String</td>
  702. <td><code>undefined</code></td>
  703. <td>This is the code of the icon, for example <code>'\uf007'</code>.</td>
  704. </tr>
  705. <tr parent="icon" class="hidden">
  706. <td class="indent">icon.size</td>
  707. <td>Number</td>
  708. <td><code>50</code></td>
  709. <td>The size of the icon.</td>
  710. </tr>
  711. <tr parent="icon" class="hidden">
  712. <td class="indent">icon.color</td>
  713. <td>String</td>
  714. <td><code>'#2B7CE9'</code></td>
  715. <td>The color of the icon.</td>
  716. </tr>
  717. <tr>
  718. <td>id</td>
  719. <td>String</td>
  720. <td><code>undefined</code></td>
  721. <td>The id of the node. The id is mandatory for nodes and they have to be unique. This should obviously be set per node, not globally.</td>
  722. </tr>
  723. <tr>
  724. <td>image</td>
  725. <td>String</td>
  726. <td><code>undefined</code></td>
  727. <td>When the shape is set to <code>image</code> or <code>circularImage</code>, this option should be the URL
  728. to an image. If the image cannot be found, the brokenImage option can be used.
  729. </td>
  730. </tr>
  731. <tr>
  732. <td>label</td>
  733. <td>String</td>
  734. <td><code>undefined</code></td>
  735. <td>The label is the piece of text shown in or under the node, depending on the shape.</td>
  736. </tr>
  737. <tr>
  738. <td>labelHighlightBold</td>
  739. <td>Boolean</td>
  740. <td><code>true</code></td>
  741. <td>Determines whether or not the label becomes bold when the node is selected.</td>
  742. </tr>
  743. <tr>
  744. <td>level</td>
  745. <td>Number</td>
  746. <td><code>undefined</code></td>
  747. <td>When using the hierarchical layout, the level determines where the node is going to be positioned.</td>
  748. </tr>
  749. <tr class='toggle collapsible' onclick="toggleTable('optionTable','margin', this);">
  750. <td><span parent="margin" class="right-caret"></span> margin</td>
  751. <td>Object or Number</td>
  752. <td><code>5</code></td>
  753. <td>If a number is specified, the margins of the label are set to that value on all sides. These options are only used when the shape is set to <code>box</code>, <code>circle</code>, <code>database</code>, <code>icon</code> or <code>text</code>.</td>
  754. </tr>
  755. <tr parent="margin" class="hidden">
  756. <td class="indent">margin.top</td>
  757. <td>Number</td>
  758. <td><code>5</code></td>
  759. <td>The top margin of the label is set to this value.</td>
  760. </tr>
  761. <tr parent="margin" class="hidden">
  762. <td class="indent">margin.right</td>
  763. <td>Number</td>
  764. <td><code>5</code></td>
  765. <td>The right margin of the label is set to this value.</td>
  766. </tr>
  767. <tr parent="margin" class="hidden">
  768. <td class="indent">margin.bottom</td>
  769. <td>Number</td>
  770. <td><code>5</code></td>
  771. <td>The bottom margin of the label is set to this value.</td>
  772. </tr>
  773. <tr parent="margin" class="hidden">
  774. <td class="indent">margin.left</td>
  775. <td>Number</td>
  776. <td><code>5</code></td>
  777. <td>The left margin of the label is set to this value.</td>
  778. </tr>
  779. <tr>
  780. <td>mass</td>
  781. <td>Number</td>
  782. <td><code>1</code></td>
  783. <td>The barnesHut physics model (which is enabled by default) is based on an inverted gravity model. By
  784. increasing the mass of a node, you increase it's repulsion. Values lower than 1 are not recommended.
  785. </td>
  786. </tr>
  787. <tr>
  788. <td>physics</td>
  789. <td>Boolean</td>
  790. <td><code>true</code></td>
  791. <td>When false, the node is not part of the physics simulation. It will not move except for from manual
  792. dragging.
  793. </td>
  794. </tr>
  795. <tr class='toggle collapsible' onclick="toggleTable('optionTable','scaling', this);">
  796. <td><span parent="scaling" class="right-caret"></span> scaling</td>
  797. <td>Object</td>
  798. <td><code>Object</code></td>
  799. <td>If the <code>value</code> option is specified, the size of the nodes will be scaled according to the
  800. properties in this object. All node shapes can be scaled, but some only when label scaling is enabled as
  801. their size is based on the size of the label.
  802. Only scalable when label scaling is enabled are:
  803. <code>ellipse</code>, <code>circle</code>, <code>database</code>, <code>box</code>, <code>text</code>.
  804. Always scalable are:
  805. <code>image</code>, <code>circularImage</code>, <code>diamond</code>, <code>dot</code>,
  806. <code>star</code>, <code>triangle</code>, <code>triangleDown</code>, <code>square</code> and
  807. <code>icon</code>. Keep in mind that when using scaling, the <code>size</code> option is neglected.
  808. </td>
  809. </tr>
  810. <tr parent="scaling" class="hidden">
  811. <td class="indent">scaling.min</td>
  812. <td>Number</td>
  813. <td><code>10</code></td>
  814. <td>If nodes have a value, their sizes are determined by the value, the scaling function and the min max
  815. values. The min value is the minimum allowed value.
  816. </td>
  817. </tr>
  818. <tr parent="scaling" class="hidden">
  819. <td class="indent">scaling.max</td>
  820. <td>Number</td>
  821. <td><code>30</code></td>
  822. <td>This is the maximum allowed size when the nodes are scaled using the value option.</td>
  823. </tr>
  824. <tr parent="scaling" class="hidden">
  825. <td class="indent">scaling.label</td>
  826. <td>Object or Boolean</td>
  827. <td><code>Object</code></td>
  828. <td>This can be false if the label is not allowed to scale with the node. If true it will scale using
  829. default settigns. For further customization, you can supply an object.
  830. </td>
  831. </tr>
  832. <tr parent="scaling" class="hidden">
  833. <td class="indent2">scaling.label.enabled</td>
  834. <td>Boolean</td>
  835. <td><code>false</code></td>
  836. <td>Toggle the scaling of the label on or off. If this option is not defined, it is set to true if any of
  837. the properties in this object are defined.
  838. </td>
  839. </tr>
  840. <tr parent="scaling" class="hidden">
  841. <td class="indent2">scaling.label.min</td>
  842. <td>Number</td>
  843. <td><code>14</code></td>
  844. <td>The minimum font-size used for labels when scaling.</td>
  845. </tr>
  846. <tr parent="scaling" class="hidden">
  847. <td class="indent2">scaling.label.max</td>
  848. <td>Number</td>
  849. <td><code>30</code></td>
  850. <td>The maximum font-size used for labels when scaling.</td>
  851. </tr>
  852. <tr parent="scaling" class="hidden">
  853. <td class="indent2">scaling.label.maxVisible</td>
  854. <td>Number</td>
  855. <td><code>30</code></td>
  856. <td>When zooming in, the font is drawn larger as well. You can limit the perceived font size using this
  857. option. If set to 30, the font will never look larger than size 30 zoomed at 100%.
  858. </td>
  859. </tr>
  860. <tr parent="scaling" class="hidden">
  861. <td class="indent2">scaling.label.drawThreshold</td>
  862. <td>Number</td>
  863. <td><code>5</code></td>
  864. <td>When zooming out, the font will be drawn smaller. This defines a lower limit for when the font is drawn.
  865. When using font scaling, you can use this together with the maxVisible to first show labels of important
  866. nodes when zoomed out and only show the rest when zooming in.
  867. </td>
  868. </tr>
  869. <tr parent="scaling" class="hidden">
  870. <td class="indent">scaling.customScalingFunction</td>
  871. <td>Function</td>
  872. <td>in description</td>
  873. <td>If nodes have <code>value</code> fields, this function determines how the size of the nodes are scaled
  874. based on their values. The default function is:
  875. <pre>
  876. function (min,max,total,value) {
  877. if (max === min) {
  878. return 0.5;
  879. }
  880. else {
  881. var scale = 1 / (max - min);
  882. return Math.max(0,(value - min)*scale);
  883. }
  884. }
  885. </pre>
  886. The function receives the minimum value of the set, the maximum value, the total sum of all values and
  887. finally the value of the node or edge it works on. <b>It has to return a value between 0 and 1.</b> The
  888. nodes and edges then calculate their size as follows:
  889. <pre>
  890. var scale = customScalingFunction(min,max,total,value);
  891. var diff = maxSize - minSize;
  892. mySize = minSize + diff * scale;
  893. </pre>
  894. Please note: <code>maxSize</code> and <code>minSize</code> are the values <code>scaling.max</code>
  895. and <code>scaling.min</code> provided in the options.
  896. </td>
  897. </tr>
  898. <tr class='toggle collapsible' onclick="toggleTable('optionTable','shadow', this);">
  899. <td><span parent="shadow" class="right-caret"></span> shadow</td>
  900. <td>Object or Boolean</td>
  901. <td><code>Object</code></td>
  902. <td>When true, the node casts a shadow using the default settings. This can be further refined by supplying
  903. an object.
  904. </td>
  905. </tr>
  906. <tr parent="shadow" class="hidden">
  907. <td class="indent">shadow.enabled</td>
  908. <td>Boolean</td>
  909. <td><code>false</code></td>
  910. <td>Toggle the casting of shadows. If this option is not defined, it is set to true if any of the properties
  911. in this object are defined.
  912. </td>
  913. </tr>
  914. <tr parent="shadow" class="hidden">
  915. <td class="indent">shadow.color</td>
  916. <td>String</td>
  917. <td><code>'rgba(0,0,0,0.5)'</code></td>
  918. <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>
  919. </tr>
  920. <tr parent="shadow" class="hidden">
  921. <td class="indent">shadow.size</td>
  922. <td>Number</td>
  923. <td><code>10</code></td>
  924. <td>The blur size of the shadow.</td>
  925. </tr>
  926. <tr parent="shadow" class="hidden">
  927. <td class="indent">shadow.x</td>
  928. <td>Number</td>
  929. <td><code>5</code></td>
  930. <td>The x offset.</td>
  931. </tr>
  932. <tr parent="shadow" class="hidden">
  933. <td class="indent">shadow.y</td>
  934. <td>Number</td>
  935. <td><code>5</code></td>
  936. <td>The y offset.</td>
  937. </tr>
  938. <tr>
  939. <td>shape</td>
  940. <td>String</td>
  941. <td><code>'ellipse'</code></td>
  942. <td>The shape defines what the node looks like. There are two types of nodes. One type has the label inside
  943. of it and the other type has the label underneath it. The types with the label inside of it are:
  944. <code>ellipse</code>, <code>circle</code>, <code>database</code>, <code>box</code>, <code>text</code>.
  945. The ones with the label outside of it are: <code>image</code>, <code>circularImage</code>,
  946. <code>diamond</code>, <code>dot</code>, <code>star</code>, <code>triangle</code>,
  947. <code>triangleDown</code>, <code>square</code> and <code>icon</code>.
  948. </td>
  949. </tr>
  950. <tr class='toggle collapsible' onclick="toggleTable('optionTable','shapeProperties', this);">
  951. <td><span parent="shapeProperties" class="right-caret"></span> shapeProperties</td>
  952. <td>Object</td>
  953. <td><code>Object</code></td>
  954. <td>This object contains configuration for specific shapes
  955. </td>
  956. </tr>
  957. <tr parent="shapeProperties" class="hidden">
  958. <td class="indent">shapeProperties.borderDashes</td>
  959. <td>Array or Boolean</td>
  960. <td><code>false</code></td>
  961. <td>This property applies to all shapes that have borders.
  962. You set the dashes by supplying an Array. Array formart: [dash length, gap length].
  963. You can also use a Boolean, false is disable and true is default [5,15].
  964. </td>
  965. </tr>
  966. <tr parent="shapeProperties" class="hidden">
  967. <td class="indent">shapeProperties.borderRadius</td>
  968. <td>Number</td>
  969. <td><code>6</code></td>
  970. <td>This property is used only for the <code>box</code> shape. It allows you to determine the roundness of the corners of the shape.
  971. </td>
  972. </tr>
  973. <tr parent="shapeProperties" class="hidden">
  974. <td class="indent">shapeProperties.interpolation</td>
  975. <td>Boolean</td>
  976. <td><code>true</code></td>
  977. <td>This property only applies to the <code>image</code> and <code>circularImage</code> shapes. When true, the image is resampled when scaled down, resulting in a nicer image at the cost of computional time.</i>
  978. </td>
  979. </tr>
  980. <tr parent="shapeProperties" class="hidden">
  981. <td class="indent">shapeProperties.useImageSize</td>
  982. <td>Boolean</td>
  983. <td><code>false</code></td>
  984. <td>This property only applies to the <code>image</code> and <code>circularImage</code> shapes. When false, the size option is used, when true, the size of the image is used. <br><i><b>Important</b>:
  985. if this is set to true, the image cannot be scaled with the value option!</i>
  986. </td>
  987. </tr>
  988. <tr parent="shapeProperties" class="hidden">
  989. <td class="indent">shapeProperties.useBorderWithImage</td>
  990. <td>Boolean</td>
  991. <td><code>false</code></td>
  992. <td>This property only applies to the <code>image</code> shape.
  993. When true, the color object is used. A rectangle with the background color is
  994. drawn behind it and it has a border. This means all border options are taken into account.
  995. </td>
  996. </tr>
  997. <tr>
  998. <td>size</td>
  999. <td>Number</td>
  1000. <td><code>25</code></td>
  1001. <td>The size is used to determine the size of node shapes that do not have the label inside of them. These
  1002. shapes are: <code>image</code>, <code>circularImage</code>, <code>diamond</code>, <code>dot</code>,
  1003. <code>star</code>, <code>triangle</code>, <code>triangleDown</code>, <code>square</code> and
  1004. <code>icon</code></td>
  1005. </tr>
  1006. <tr>
  1007. <td>title</td>
  1008. <td>String or Element</td>
  1009. <td><code>undefined</code></td>
  1010. <td>Title to be displayed when the user hovers over the node. The title can be an HTML element or a string
  1011. containing plain text or HTML.
  1012. </td>
  1013. </tr>
  1014. <tr>
  1015. <td>value</td>
  1016. <td>Number</td>
  1017. <td><code>undefined</code></td>
  1018. <td>When a value is set, the nodes will be scaled using the options in the scaling object defined above.
  1019. </td>
  1020. </tr>
  1021. <tr class='toggle collapsible' onclick="toggleTable('optionTable','widthConstraint', this);">
  1022. <td><span parent="widthConstraint" class="right-caret"></span> widthConstraint</td>
  1023. <td>Number, Boolean or Object</td>
  1024. <td><code>false</code></td>
  1025. <td>If false, no widthConstraint is applied. If a number is specified, the minimum and maximum widths of the node are set to the value. The node's label's lines will be broken on spaces to stay below the maximum and the node's width will be set to the minimum if less than the value.</td>
  1026. </tr>
  1027. <tr parent="widthConstraint" class="hidden">
  1028. <td class="indent">widthConstraint.minimum</td>
  1029. <td>Number</td>
  1030. <td><code>undefined</code></td>
  1031. <td>If a number is specified, the minimum width of the node is set to the value. The node's width will be set to the minimum if less than the value.</td>
  1032. </tr>
  1033. <tr parent="widthConstraint" class="hidden">
  1034. <td class="indent">widthConstraint.maximum</td>
  1035. <td>Number</td>
  1036. <td><code>undefined</code></td>
  1037. <td>If a number is specified, the maximum width of the node is set to the value. The node's label's lines will be broken on spaces to stay below the maximum.</td>
  1038. </tr>
  1039. <tr>
  1040. <td>x</td>
  1041. <td>Number</td>
  1042. <td><code>undefined</code></td>
  1043. <td>This gives a node an initial x position. When using the hierarchical layout, either the x or y position
  1044. is set by the layout engine depending on the type of view. The other value remains untouched. When using
  1045. stabilization, the stabilized position may be different from the initial one. To lock the node to that
  1046. position use the physics or fixed options.
  1047. </td>
  1048. </tr>
  1049. <tr>
  1050. <td>y</td>
  1051. <td>Number</td>
  1052. <td><code>undefined</code></td>
  1053. <td>This gives a node an initial y position. When using the hierarchical layout, either the x or y position
  1054. is set by the layout engine depending on the type of view. The other value remains untouched. When using
  1055. stabilization, the stabilized position may be different from the initial one. To lock the node to that
  1056. position use the physics or fixed options.
  1057. </td>
  1058. </tr>
  1059. </table>
  1060. </div>
  1061. <!-- Bootstrap core JavaScript
  1062. ================================================== -->
  1063. <!-- Placed at the end of the document so the pages load faster -->
  1064. <script src="../js/jquery.min.js"></script>
  1065. <script src="../js/bootstrap.min.js"></script>
  1066. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  1067. <script src="../js/ie10-viewport-bug-workaround.js"></script>
  1068. <!-- jquery extensions -->
  1069. <script src="../js/jquery.highlight.js"></script>
  1070. <script src="../js/jquery.url.min.js"></script>
  1071. <!-- Tipue vendor js -->
  1072. <script src="../js/tipuesearch.config.js"></script>
  1073. <script src="../js/tipuesearch.js"></script>
  1074. <!-- controller -->
  1075. <script src="../js/main.js"></script>