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.

650 lines
28 KiB

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. <link href="../css/style.css" rel="stylesheet">
  14. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  15. <!--[if lt IE 9]>
  16. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  17. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  18. <![endif]-->
  19. <link href="../css/prettify.css" type="text/css" rel="stylesheet"/>
  20. <script type="text/javascript" src="../js/googleAnalytics.js"></script>
  21. <script type="text/javascript" src="../js/prettify/prettify.js"></script>
  22. <script src="../js/smooth-scroll.min.js"></script>
  23. <script language="JavaScript">
  24. smoothScroll.init();
  25. </script>
  26. <script type="text/javascript" src="../js/toggleTable.js"></script>
  27. </head>
  28. <body onload="prettyPrint();">
  29. <div class="navbar-wrapper">
  30. <div class="container">
  31. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  32. <div class="container">
  33. <div class="navbar-header">
  34. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
  35. aria-expanded="false" aria-controls="navbar">
  36. <span class="sr-only">Toggle navigation</span>
  37. <span class="icon-bar"></span>
  38. <span class="icon-bar"></span>
  39. <span class="icon-bar"></span>
  40. </button>
  41. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  42. </div>
  43. <div id="navbar" class="navbar-collapse collapse">
  44. <ul class="nav navbar-nav">
  45. <li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
  46. <li><a href="http://www.visjs.org/blog.html">Blog</a></li>
  47. <li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
  48. <li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
  49. <li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
  50. <li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
  51. <li><a href="http://www.visjs.org/index.html#licenses">License</a></li>
  52. </ul>
  53. </div>
  54. </div>
  55. </nav>
  56. </div>
  57. </div>
  58. <a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img
  59. style="position: absolute; top: 0; right: 0; border: 0;"
  60. src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
  61. alt="Fork me on GitHub"
  62. data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
  63. <div class="container full">
  64. <h1>Network - nodes</h1>
  65. <p>Handles the creation and deletion of nodes and contains the global node options and styles.</p>
  66. <a class="btn btn-primary" role="button" onclick="history.back()">Back to overview.</a>
  67. <h3>Options</h3>
  68. <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
  69. 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>
  70. <p><b><i>When you have given a node an option, you will override the global option for that property. If you then set that option to <code>null</code>,
  71. it will revert back to the default value.</i></b>
  72. </p>
  73. <p>Click on the full options or shorthand options to show how these options are supposed to be used.</p>
  74. <ul class="nav nav-tabs">
  75. <li role="presentation" class="active" onclick="toggleTab(this)"><a href="#">options hidden</a></li>
  76. <li role="presentation" onclick="toggleTab(this);" targetNode="fullOptions"><a href="#">full options</a></li>
  77. <li role="presentation" onclick="toggleTab(this);" targetNode="shortOptions"><a href="#">shorthand options</a></li>
  78. </ul>
  79. <br>
  80. <pre class="prettyprint lang-js options top hidden" id="fullOptions">
  81. // these are all options in full.
  82. var options = {
  83. nodes:{
  84. borderWidth: 1,
  85. borderWidthSelected: undefined,
  86. brokenImage:undefined,
  87. color: {
  88. border: '#2B7CE9',
  89. background: '#97C2FC',
  90. highlight: {
  91. border: '#2B7CE9',
  92. background: '#D2E5FF'
  93. },
  94. hover: {
  95. border: '#2B7CE9',
  96. background: '#D2E5FF'
  97. }
  98. },
  99. fixed: {
  100. x:false,
  101. y:false
  102. },
  103. font: {
  104. color: '#343434',
  105. size: 14, // px
  106. face: 'arial',
  107. background: 'none',
  108. strokeWidth: 0, // px
  109. strokeColor: '#ffffff',
  110. align: 'horizontal'
  111. },
  112. group: undefined,
  113. hidden: false,
  114. icon: {
  115. face: 'FontAwesome',
  116. code: undefined,
  117. size: 50, //50,
  118. color:'#2B7CE9'
  119. },
  120. image: undefined,
  121. label: undefined,
  122. labelHighlightBold: true,
  123. level: undefined,
  124. mass: 1,
  125. physics: true,
  126. scaling: {
  127. min: 10,
  128. max: 30,
  129. label: {
  130. enabled: false,
  131. min: 14,
  132. max: 30,
  133. maxVisible: 30,
  134. drawThreshold: 5
  135. },
  136. customScalingFunction: function (min,max,total,value) {
  137. if (max === min) {
  138. return 0.5;
  139. }
  140. else {
  141. let scale = 1 / (max - min);
  142. return Math.max(0,(value - min)*scale);
  143. }
  144. }
  145. },
  146. shadow:{
  147. enabled: false,
  148. size:10,
  149. x:5,
  150. y:5
  151. },
  152. shape: 'ellipse',
  153. size: 25,
  154. title: undefined,
  155. value: undefined,
  156. x: undefined,
  157. y: undefined
  158. }
  159. }
  160. network.setOptions(options);
  161. </pre>
  162. <pre class="prettyprint lang-js options top hidden" id="shortOptions">
  163. // only the options that have shorthand notations are shown.
  164. var options = {
  165. nodes:{
  166. color: '#ff0000',
  167. fixed: false,
  168. font: '12px arial red',
  169. scaling: {
  170. label: true
  171. },
  172. shadow: true
  173. }
  174. }
  175. network.setOptions(options);
  176. </pre>
  177. <p>These options can also be set per individual node. All of the individual options are explained here:</p>
  178. <table class="options" id="optionTable">
  179. <tr>
  180. <th>Name</th>
  181. <th>Type</th>
  182. <th>Default</th>
  183. <th>Description</th>
  184. </tr>
  185. <tr>
  186. <td>borderWidth</td>
  187. <td>Number</td>
  188. <td><code>1</code></td>
  189. <td>The width of the border of the node.</td>
  190. </tr>
  191. <tr>
  192. <td>borderWidthSelected</td>
  193. <td>Number</td>
  194. <td><code>undefined</code></td>
  195. <td>The width of the border of the node when it is selected. When undefined, the borderWidth is used</td>
  196. </tr>
  197. <tr>
  198. <td>brokenImage</td>
  199. <td>String</td>
  200. <td><code>undefined</code></td>
  201. <td>When the shape is set to <code>image</code> or <code>circularImage</code>, this option can be an URL to
  202. a backup image in case the URL supplied in the image option cannot be resolved.
  203. </td>
  204. </tr>
  205. <tr class='toggle collapsible' onclick="toggleTable('optionTable','color', this);">
  206. <td><span parent="color" class="right-caret"></span> color</td>
  207. <td>Object or String</td>
  208. <td><code>Object</code></td>
  209. <td>The color object contains the color information of the node in every situation. When the node only needs
  210. a single color, a color value like <code>'rgba(120,32,14,1)'</code>, <code>'#ffffff'</code> or <code>'red'</code>
  211. can be supplied instead of an object.
  212. </td>
  213. </tr>
  214. <tr parent="color" class="hidden">
  215. <td class="indent">color.border</td>
  216. <td>String</td>
  217. <td><code>'#2B7CE9'</code></td>
  218. <td>The color of the border of the node when it is not selected or hovered over <i>(assuming hover is
  219. enabled in the interaction module)</i>.
  220. </td>
  221. </tr>
  222. <tr parent="color" class="hidden">
  223. <td class="indent">color.background</td>
  224. <td>String</td>
  225. <td><code>'#D2E5FF'</code></td>
  226. <td>The color of the background of the node when it is not selected or hovered over <i>(assuming hover is
  227. enabled in the interaction module)</i>.
  228. </td>
  229. </tr>
  230. <tr parent="color" class="hidden">
  231. <td class="indent">color.highlight</td>
  232. <td>Object or String</td>
  233. <td><code>Object</code></td>
  234. <td>The color the node when it is selected. Alternatively you can just supply a string color value.</td>
  235. </tr>
  236. <tr parent="color" class="hidden">
  237. <td class="indent2">color.highlight.border</td>
  238. <td>String</td>
  239. <td><code>'#2B7CE9'</code></td>
  240. <td>The color of the border of the node when it is selected.</td>
  241. </tr>
  242. <tr parent="color" class="hidden">
  243. <td class="indent2">color.highlight.background</td>
  244. <td>String</td>
  245. <td><code>'#D2E5FF'</code></td>
  246. <td>The color of the background of the node when it is selected.</td>
  247. </tr>
  248. <tr parent="color" class="hidden">
  249. <td class="indent">color.hover</td>
  250. <td>Object or String</td>
  251. <td><code>Object</code></td>
  252. <td>The color the node when the mouse hovers over it <i>(assuming hover is enabled in the interaction
  253. module)</i>. Shorthand like above is also supported.
  254. </td>
  255. </tr>
  256. <tr parent="color" class="hidden">
  257. <td class="indent2">color.hover.border</td>
  258. <td>String</td>
  259. <td><code>'#2B7CE9'</code></td>
  260. <td>The color of the border of the node when the mouse hovers over it <i>(assuming hover is enabled in the
  261. interaction module)</i>.
  262. </td>
  263. </tr>
  264. <tr parent="color" class="hidden">
  265. <td class="indent2">color.hover.background</td>
  266. <td>String</td>
  267. <td><code>'#D2E5FF'</code></td>
  268. <td>The color of the background of the node when the mouse hovers over it <i>(assuming hover is enabled in
  269. the interaction module)</i>.
  270. </td>
  271. </tr>
  272. <tr class='toggle collapsible' onclick="toggleTable('optionTable','fixed', this);">
  273. <td><span parent="fixed" class="right-caret"></span> fixed</td>
  274. <td>Object or Boolean</td>
  275. <td><code>Object</code></td>
  276. <td>When true, the node will not move but IS part of the physics simulation. When defined as an object,
  277. movement in either X or Y direction can be disabled.
  278. </td>
  279. </tr>
  280. <tr parent="fixed" class="hidden">
  281. <td class="indent">fixed.x</td>
  282. <td>Boolean</td>
  283. <td><code>false</code></td>
  284. <td>When true, the node will not move in the X direction.</td>
  285. </tr>
  286. <tr parent="fixed" class="hidden">
  287. <td class="indent">fixed.y</td>
  288. <td>Boolean</td>
  289. <td><code>false</code></td>
  290. <td>When true, the node will not move in the Y direction.</td>
  291. </tr>
  292. <tr class='toggle collapsible' onclick="toggleTable('optionTable','font', this);">
  293. <td><span parent="font" class="right-caret"></span> font</td>
  294. <td>Object or String</td>
  295. <td><code>false</code></td>
  296. <td>This object defines the details of the label. A shorthand is also supported in the form <code>'size face
  297. color'</code> for example: <code>'14px arial red'</code>.
  298. </td>
  299. </tr>
  300. <tr parent="font" class="hidden">
  301. <td class="indent">font.color</td>
  302. <td>String</td>
  303. <td><code>'#343434'</code></td>
  304. <td>Color of the label text.</td>
  305. </tr>
  306. <tr parent="font" class="hidden">
  307. <td class="indent">font.size</td>
  308. <td>Number</td>
  309. <td><code>14</code></td>
  310. <td>Size of the label text.</td>
  311. </tr>
  312. <tr parent="font" class="hidden">
  313. <td class="indent">font.face</td>
  314. <td>String</td>
  315. <td><code>'arial'</code></td>
  316. <td>Font face (or font family) of the label text.</td>
  317. </tr>
  318. <tr parent="font" class="hidden">
  319. <td class="indent">font.background</td>
  320. <td>String</td>
  321. <td><code>undefined</code></td>
  322. <td>When not <code>undefined</code> but a <b>color string</b>, a background rectangle will be drawn behind
  323. the label in the supplied color.
  324. </td>
  325. </tr>
  326. <tr parent="font" class="hidden">
  327. <td class="indent">font.strokeWidth</td>
  328. <td>Number</td>
  329. <td><code>0</code></td>
  330. <td>As an alternative to the background rectangle, a stroke can be drawn around the text. When a value
  331. higher than 0 is supplied, the stroke will be drawn.
  332. </td>
  333. </tr>
  334. <tr parent="font" class="hidden">
  335. <td class="indent">font.strokeColor</td>
  336. <td>String</td>
  337. <td><code>'#ffffff'</code></td>
  338. <td>This is the color of the stroke <i>assuming the value for stroke is higher than 0</i>.</td>
  339. </tr>
  340. <tr>
  341. <td>group</td>
  342. <td>String</td>
  343. <td><code>undefined</code></td>
  344. <td>When not <code>undefined</code>, the</td>
  345. </tr>
  346. <tr>
  347. <td>hidden</td>
  348. <td>Boolean</td>
  349. <td><code>false</code></td>
  350. <td>When true, the node will not be shown. It will still be part of the physics simulation though!</td>
  351. </tr>
  352. <tr class='toggle collapsible' onclick="toggleTable('optionTable','icon', this);">
  353. <td><span parent="icon" class="right-caret"></span> icon</td>
  354. <td>Object</td>
  355. <td><code>Object</code></td>
  356. <td>These options are only used when the shape is set to <code>icon</code>.</td>
  357. </tr>
  358. <tr parent="icon" class="hidden">
  359. <td class="indent">icon.face</td>
  360. <td>String</td>
  361. <td><code>'FontAwesome'</code></td>
  362. <td>These options are only used when the shape is set to <code>icon</code>. The possible options for the
  363. face are: <code>'FontAwesome'</code> and <code>'Ionicons'</code>.
  364. </td>
  365. </tr>
  366. <tr parent="icon" class="hidden">
  367. <td class="indent">icon.code</td>
  368. <td>String</td>
  369. <td><code>undefined</code></td>
  370. <td>This is the code of the icon, for example <code>'\uf007'</code>.</td>
  371. </tr>
  372. <tr parent="icon" class="hidden">
  373. <td class="indent">icon.size</td>
  374. <td>Number</td>
  375. <td><code>50</code></td>
  376. <td>The size of the icon.</td>
  377. </tr>
  378. <tr parent="icon" class="hidden">
  379. <td class="indent">icon.color</td>
  380. <td>String</td>
  381. <td><code>'#2B7CE9'</code></td>
  382. <td>The color of the icon.</td>
  383. </tr>
  384. <tr>
  385. <td>id</td>
  386. <td>String</td>
  387. <td><code>undefined</code></td>
  388. <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>
  389. </tr>
  390. <tr>
  391. <td>image</td>
  392. <td>String</td>
  393. <td><code>undefined</code></td>
  394. <td>When the shape is set to <code>image</code> or <code>circularImage</code>, this option should be the URL
  395. to an image. If the image cannot be found, the brokenImage option can be used.
  396. </td>
  397. </tr>
  398. <tr>
  399. <td>label</td>
  400. <td>String</td>
  401. <td><code>undefined</code></td>
  402. <td>The label is the piece of text shown in or under the node, depending on the shape.</td>
  403. </tr>
  404. <tr>
  405. <td>labelHighlightBold</td>
  406. <td>Boolean</td>
  407. <td><code>true</code></td>
  408. <td>Determines whether or not the label becomes bold when the node is selected.</td>
  409. </tr>
  410. <tr>
  411. <td>level</td>
  412. <td>Number</td>
  413. <td><code>undefined</code></td>
  414. <td>When using the hierarchical layout, the level determines where the node is going to be positioned.</td>
  415. </tr>
  416. <tr>
  417. <td>mass</td>
  418. <td>Number</td>
  419. <td><code>1</code></td>
  420. <td>The barnesHut physics model (which is enabled by default) is based on an inverted gravity model. By
  421. increasing the mass of a node, you increase it's repulsion. Values lower than 1 are not recommended.
  422. </td>
  423. </tr>
  424. <tr>
  425. <td>physics</td>
  426. <td>Boolean</td>
  427. <td><code>true</code></td>
  428. <td>When false, the node is not part of the physics simulation. It will not move except for from manual
  429. dragging.
  430. </td>
  431. </tr>
  432. <tr class='toggle collapsible' onclick="toggleTable('optionTable','scaling', this);">
  433. <td><span parent="scaling" class="right-caret"></span> scaling</td>
  434. <td>Object</td>
  435. <td><code>Object</code></td>
  436. <td>If the <code>value</code> option is specified, the size of the nodes will be scaled according to the
  437. properties in this object. All node shapes can be scaled, but some only when label scaling is enabled as
  438. their size is based on the size of the label.
  439. Only scalable when label scaling is enabled are:
  440. <code>ellipse</code>, <code>circle</code>, <code>database</code>, <code>box</code>, <code>text</code>.
  441. Always scalable are:
  442. <code>image</code>, <code>circularImage</code>, <code>diamond</code>, <code>dot</code>,
  443. <code>star</code>, <code>triangle</code>, <code>triangleDown</code>, <code>square</code> and
  444. <code>icon</code>. Keep in mind that when using scaling, the <code>size</code> option is neglected.
  445. </td>
  446. </tr>
  447. <tr parent="scaling" class="hidden">
  448. <td class="indent">scaling.min</td>
  449. <td>Number</td>
  450. <td><code>10</code></td>
  451. <td>If nodes have a value, their sizes are determined by the value, the scaling function and the min max
  452. values. The min value is the minimum allowed value.
  453. </td>
  454. </tr>
  455. <tr parent="scaling" class="hidden">
  456. <td class="indent">scaling.max</td>
  457. <td>Number</td>
  458. <td><code>30</code></td>
  459. <td>This is the maximum allowed size when the nodes are scaled using the value option.</td>
  460. </tr>
  461. <tr parent="scaling" class="hidden">
  462. <td class="indent">scaling.label</td>
  463. <td>Object or Boolean</td>
  464. <td><code>Object</code></td>
  465. <td>This can be false if the label is not allowed to scale with the node. If true it will scale using
  466. default settigns. For further customization, you can supply an object.
  467. </td>
  468. </tr>
  469. <tr parent="scaling" class="hidden">
  470. <td class="indent2">scaling.label.enabled</td>
  471. <td>Boolean</td>
  472. <td><code>false</code></td>
  473. <td>Toggle the scaling of the label on or off. If this option is not defined, it is set to true if any of
  474. the properties in this object are defined.
  475. </td>
  476. </tr>
  477. <tr parent="scaling" class="hidden">
  478. <td class="indent2">scaling.label.min</td>
  479. <td>Number</td>
  480. <td><code>14</code></td>
  481. <td>The minimum font-size used for labels when scaling.</td>
  482. </tr>
  483. <tr parent="scaling" class="hidden">
  484. <td class="indent2">scaling.label.max</td>
  485. <td>Number</td>
  486. <td><code>30</code></td>
  487. <td>The maximum font-size used for labels when scaling.</td>
  488. </tr>
  489. <tr parent="scaling" class="hidden">
  490. <td class="indent2">scaling.label.maxVisible</td>
  491. <td>Number</td>
  492. <td><code>30</code></td>
  493. <td>When zooming in, the font is drawn larger as well. You can limit the perceived font size using this
  494. option. If set to 30, the font will never look larger than size 30 zoomed at 100%.
  495. </td>
  496. </tr>
  497. <tr parent="scaling" class="hidden">
  498. <td class="indent2">scaling.label.drawThreshold</td>
  499. <td>Number</td>
  500. <td><code>5</code></td>
  501. <td>When zooming out, the font will be drawn smaller. This defines a lower limit for when the font is drawn.
  502. When using font scaling, you can use this together with the maxVisible to first show labels of important
  503. nodes when zoomed out and only show the rest when zooming in.
  504. </td>
  505. </tr>
  506. <tr parent="scaling" class="hidden">
  507. <td class="indent">scaling.customScalingFunction</td>
  508. <td>Function</td>
  509. <td>in description</td>
  510. <td>If nodes have <code>value</code> fields, this function determines how the size of the nodes are scaled
  511. based on their values. The default function is:
  512. <pre>
  513. function (min,max,total,value) {
  514. if (max === min) {
  515. return 0.5;
  516. }
  517. else {
  518. var scale = 1 / (max - min);
  519. return Math.max(0,(value - min)*scale);
  520. }
  521. }
  522. </pre>
  523. The function receives the minimum value of the set, the maximum value, the total sum of all values and
  524. finally the value of the node or edge it works on. <b>It has to return a value between 0 and 1.</b> The
  525. nodes and edges then calculate their size as follows:
  526. <pre>
  527. var scale = customScalingFunction(min,max,total,value);
  528. var diff = maxSize - minSize;
  529. mySize = minSize + diff * scale;
  530. </pre>
  531. Please note: <code>maxSize</code> and <code>minSize</code> are the values <code>scaling.max</code>
  532. and <code>scaling.min</code> provided in the options.
  533. </td>
  534. </tr>
  535. <tr class='toggle collapsible' onclick="toggleTable('optionTable','shadow', this);">
  536. <td><span parent="shadow" class="right-caret"></span> shadow</td>
  537. <td>Object or Boolean</td>
  538. <td><code>Object</code></td>
  539. <td>When true, the node casts a shadow using the default settings. This can be further refined by supplying
  540. an object.
  541. </td>
  542. </tr>
  543. <tr parent="shadow" class="hidden">
  544. <td class="indent">shadow.enabled</td>
  545. <td>Boolean</td>
  546. <td><code>false</code></td>
  547. <td>Toggle the casting of shadows. If this option is not defined, it is set to true if any of the properties
  548. in this object are defined.
  549. </td>
  550. </tr>
  551. <tr parent="shadow" class="hidden">
  552. <td class="indent">shadow.size</td>
  553. <td>Number</td>
  554. <td><code>10</code></td>
  555. <td>The blur size of the shadow.</td>
  556. </tr>
  557. <tr parent="shadow" class="hidden">
  558. <td class="indent">shadow.x</td>
  559. <td>Number</td>
  560. <td><code>5</code></td>
  561. <td>The x offset.</td>
  562. </tr>
  563. <tr parent="shadow" class="hidden">
  564. <td class="indent">shadow.y</td>
  565. <td>Number</td>
  566. <td><code>5</code></td>
  567. <td>The y offset.</td>
  568. </tr>
  569. <tr>
  570. <td>shape</td>
  571. <td>String</td>
  572. <td><code>'ellipse'</code></td>
  573. <td>The shape defines what the node looks like. There are two types of nodes. One type has the label inside
  574. of it and the other type has the label underneath it. The types with the label inside of it are:
  575. <code>ellipse</code>, <code>circle</code>, <code>database</code>, <code>box</code>, <code>text</code>.
  576. The ones with the label outside of it are: <code>image</code>, <code>circularImage</code>,
  577. <code>diamond</code>, <code>dot</code>, <code>star</code>, <code>triangle</code>,
  578. <code>triangleDown</code>, <code>square</code> and <code>icon</code>.
  579. </td>
  580. </tr>
  581. <tr>
  582. <td>size</td>
  583. <td>Number</td>
  584. <td><code>25</code></td>
  585. <td>The size is used to determine the size of node shapes that do not have the label inside of them. These
  586. shapes are: <code>image</code>, <code>circularImage</code>, <code>diamond</code>, <code>dot</code>,
  587. <code>star</code>, <code>triangle</code>, <code>triangleDown</code>, <code>square</code> and
  588. <code>icon</code></td>
  589. </tr>
  590. <tr>
  591. <td>title</td>
  592. <td>String or Element</td>
  593. <td><code>undefined</code></td>
  594. <td>Title to be displayed when the user hovers over the node. The title can be an HTML element or a string
  595. containing plain text or HTML.
  596. </td>
  597. </tr>
  598. <tr>
  599. <td>value</td>
  600. <td>Number</td>
  601. <td><code>undefined</code></td>
  602. <td>When a value is set, the nodes will be scaled using the options in the scaling object defined above.
  603. </td>
  604. </tr>
  605. <tr>
  606. <td>x</td>
  607. <td>Number</td>
  608. <td><code>undefined</code></td>
  609. <td>This gives a node an initial x position. When using the hierarchical layout, either the x or y position
  610. is set by the layout engine depending on the type of view. The other value remains untouched. When using
  611. stabilization, the stabilized position may be different from the initial one. To lock the node to that
  612. position use the physics or fixed options.
  613. </td>
  614. </tr>
  615. <tr>
  616. <td>y</td>
  617. <td>Number</td>
  618. <td><code>undefined</code></td>
  619. <td>This gives a node an initial y position. When using the hierarchical layout, either the x or y position
  620. is set by the layout engine depending on the type of view. The other value remains untouched. When using
  621. stabilization, the stabilized position may be different from the initial one. To lock the node to that
  622. position use the physics or fixed options.
  623. </td>
  624. </tr>
  625. </table>
  626. </div>
  627. <!-- Bootstrap core JavaScript
  628. ================================================== -->
  629. <!-- Placed at the end of the document so the pages load faster -->
  630. <script src="../js/jquery.min.js"></script>
  631. <script src="../js/bootstrap.min.js"></script>
  632. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  633. <script src="../js/ie10-viewport-bug-workaround.js"></script>
  634. <!-- controller -->
  635. <script src="../js/main.js"></script>