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.

978 lines
31 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. <!DOCTYPE html>
  2. <html lang="en"><head>
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="description" content="">
  7. <meta name="author" content="">
  8. <link rel="icon" HREF="favicon.ico">
  9. <title>graph3d - vis.js - A dynamic, browser based visualization library.</title>
  10. <!-- Bootstrap core CSS -->
  11. <link href="../css/bootstrap.css" rel="stylesheet">
  12. <!-- Tipue vendor css -->
  13. <link href="../css/tipuesearch.css" rel="stylesheet">
  14. <link href="../css/style.css" rel="stylesheet">
  15. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  16. <!--[if lt IE 9]>
  17. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  18. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  19. <![endif]-->
  20. <link href="../css/prettify.css" type="text/css" rel="stylesheet"/>
  21. <script type="text/javascript" src="../js/googleAnalytics.js"></script>
  22. <script type="text/javascript" src="../js/prettify/prettify.js"></script>
  23. <script src="../js/smooth-scroll.min.js"></script>
  24. <script language="JavaScript">
  25. smoothScroll.init();
  26. </script>
  27. <script type="text/javascript" src="../js/toggleTable.js"></script>
  28. </head>
  29. <body onload="prettyPrint();">
  30. <div class="navbar-wrapper">
  31. <div class="container">
  32. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  33. <div class="container">
  34. <div class="navbar-header">
  35. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
  36. aria-expanded="false" aria-controls="navbar">
  37. <span class="sr-only">Toggle navigation</span>
  38. <span class="icon-bar"></span>
  39. <span class="icon-bar"></span>
  40. <span class="icon-bar"></span>
  41. </button>
  42. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  43. </div>
  44. <div id="navbar" class="navbar-collapse collapse">
  45. <ul class="nav navbar-nav">
  46. <li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
  47. <li><a href="http://www.visjs.org/blog.html">Blog</a></li>
  48. <li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
  49. <li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
  50. <li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
  51. <li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
  52. <li><a href="http://www.visjs.org/index.html#licenses">License</a></li>
  53. </ul>
  54. <form class="navbar-form navbar-right" role="search">
  55. <input name="q" id="tipue_search_input" autocomplete="off" type="text" class="form-control" placeholder="Enter keywords">
  56. <button type="submit" class="btn btn-default">Go!</button>
  57. </form>
  58. <div id="search-results-wrapper" class="panel panel-default">
  59. <div class="panel-body">
  60. <div id="tipue_search_content"></div>
  61. </div>
  62. </div>
  63. <div id="keyword-info" class="panel panel-success">
  64. <div class="panel-body">
  65. Found <span id="keyword-count"></span> results. Click <a id="keyword-jumper-button" href="">here</a> to jump to the first keyword occurence!
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </nav>
  71. </div>
  72. </div>
  73. <a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
  74. <div class="container full">
  75. <h1>Graph3d</h1>
  76. <h2 id="Overview">Overview</h2>
  77. <p>
  78. Graph3d is an interactive visualization chart to draw data in a three dimensional
  79. graph. You can freely move and zoom in the graph by dragging and scrolling in the
  80. window. Graph3d also supports animation of a graph.
  81. </p>
  82. <p>
  83. Graph3d uses <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Canvas">HTML canvas</a>
  84. to render graphs, and can render up to a few thousands of data points smoothly.
  85. </p>
  86. <h2 id="Contents">Contents</h2>
  87. <ul>
  88. <li><a href="#Overview">Overview</a></li>
  89. <li><a href="#Loading">Loading</a></li>
  90. <li><a href="#Data_Format">Data Format</a></li>
  91. <li><a href="#Configuration_Options">Configuration Options</a></li>
  92. <li><a href="#Methods">Methods</a></li>
  93. <li><a href="#Events">Events</a></li>
  94. <li><a href="#Data_Policy">Data Policy</a></li>
  95. </ul>
  96. <h2 id="Example">Example</h2>
  97. <p>
  98. The following code shows how to create a Graph3d and provide it with data.
  99. More examples can be found in the <a href="../examples">examples</a> directory.
  100. </p>
  101. <pre class="prettyprint lang-html">
  102. &lt;!DOCTYPE HTML&gt;
  103. &lt;html&gt;
  104. &lt;head&gt;
  105. &lt;title&gt;Graph 3D demo&lt;/title&gt;
  106. &lt;style&gt;
  107. body {font: 10pt arial;}
  108. &lt;/style&gt;
  109. &lt;script type="text/javascript" src="../../dist/vis.js"&gt;&lt;/script&gt;
  110. &lt;script type="text/javascript"&gt;
  111. var data = null;
  112. var graph = null;
  113. function custom(x, y) {
  114. return (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
  115. }
  116. // Called when the Visualization API is loaded.
  117. function drawVisualization() {
  118. // Create and populate a data table.
  119. var data = new vis.DataSet();
  120. // create some nice looking data with sin/cos
  121. var steps = 50; // number of datapoints will be steps*steps
  122. var axisMax = 314;
  123. var axisStep = axisMax / steps;
  124. for (var x = 0; x &lt; axisMax; x+=axisStep) {
  125. for (var y = 0; y &lt; axisMax; y+=axisStep) {
  126. var value = custom(x, y);
  127. data.add({
  128. x: x,
  129. y: y,
  130. z: value,
  131. style: value
  132. });
  133. }
  134. }
  135. // specify options
  136. var options = {
  137. width: '600px',
  138. height: '600px',
  139. style: 'surface',
  140. showPerspective: true,
  141. showGrid: true,
  142. showShadow: false,
  143. keepAspectRatio: true,
  144. verticalRatio: 0.5
  145. };
  146. // create a graph3d
  147. var container = document.getElementById('mygraph');
  148. graph3d = new vis.Graph3d(container, data, options);
  149. }
  150. &lt;/script&gt;
  151. &lt;/head&gt;
  152. &lt;body onload="drawVisualization();"&gt;
  153. &lt;div id="mygraph"&gt;&lt;/div&gt;
  154. &lt;/body&gt;
  155. &lt;/html&gt;
  156. </pre>
  157. <h2 id="Loading">Loading</h2>
  158. <p>
  159. The class name of the Graph3d is <code>vis.Graph3d</code>.
  160. When constructing a Graph3d, an HTML DOM container must be provided to attach
  161. the graph to. Optionally, data and options can be provided.
  162. Data is a vis <code>DataSet</code> or an <code>Array</code>, described in
  163. section <a href="#Data_Format">Data Format</a>.
  164. Options is a name-value map in the JSON format. The available options
  165. are described in section <a href="#Configuration_Options">Configuration Options</a>.
  166. </p>
  167. <pre class="prettyprint lang-js">var graph = new vis.Graph3d(container [, data] [, options]);</pre>
  168. <p>
  169. Data and options can be set or changed later on using the functions
  170. <code>Graph3d.setData(data)</code> and <code>Graph3d.setOptions(options)</code>.
  171. </p>
  172. <h2 id="Data_Format">Data Format</h2>
  173. <p>
  174. Graph3d can load data from an <code>Array</code>, a <code>DataSet</code> (offering 2 way data binding), or a <code>DataView</code> (offering 1 way data binding).
  175. JSON objects are added to this DataSet by using the <code>add()</code> function.
  176. Data points must have properties <code>x</code>, <code>y</code>, and <code>z</code>,
  177. and can optionally have a property <code>style</code> and <code>filter</code>.
  178. <h3>Definition</h3>
  179. <p>
  180. The DataSet JSON objects are defined as:
  181. </p>
  182. <table class="properties">
  183. <tr>
  184. <th>Name</th>
  185. <th>Type</th>
  186. <th>Required</th>
  187. <th>Description</th>
  188. </tr>
  189. <tr>
  190. <td>x</td>
  191. <td>number</td>
  192. <td>yes</td>
  193. <td>Location on the x-axis.</td>
  194. </tr>
  195. <tr>
  196. <td>y</td>
  197. <td>number</td>
  198. <td>yes</td>
  199. <td>Location on the y-axis.</td>
  200. </tr>
  201. <tr>
  202. <td>z</td>
  203. <td>number</td>
  204. <td>yes</td>
  205. <td>Location on the z-axis.</td>
  206. </tr>
  207. <tr>
  208. <td>style</td>
  209. <td>number</td>
  210. <td>no</td>
  211. <td>The data value, required for graph styles <code>dot-color</code> and
  212. <code>dot-size</code>.
  213. </td>
  214. </tr>
  215. <tr>
  216. <td>filter</td>
  217. <td>*</td>
  218. <td>no</td>
  219. <td>Filter values used for the animation.
  220. This column may have any type, such as a number, string, or Date.</td>
  221. </tr>
  222. </table>
  223. <h2 id="Configuration_Options">Configuration Options</h2>
  224. <p>
  225. Options can be used to customize the graph. Options are defined as a JSON object.
  226. All options are optional.
  227. </p>
  228. <pre class="prettyprint lang-js">
  229. var options = {
  230. width: '100%',
  231. height: '400px',
  232. style: 'surface'
  233. };
  234. </pre>
  235. <p>
  236. The following options are available.
  237. </p>
  238. <table class="options" id="optionTable">
  239. <tr>
  240. <th>Name</th>
  241. <th>Type</th>
  242. <th>Default</th>
  243. <th>Description</th>
  244. </tr>
  245. <tr>
  246. <td>animationInterval</td>
  247. <td>number</td>
  248. <td>1000</td>
  249. <td>The animation interval in milliseconds. This determines how fast
  250. the animation runs.</td>
  251. </tr>
  252. <tr>
  253. <td>animationPreload</td>
  254. <td>boolean</td>
  255. <td>false</td>
  256. <td>If false, the animation frames are loaded as soon as they are requested.
  257. if <code>animationPreload</code> is true, the graph will automatically load
  258. all frames in the background, resulting in a smoother animation as soon as
  259. all frames are loaded. The load progress is shown on screen.</td>
  260. </tr>
  261. <tr>
  262. <td>animationAutoStart</td>
  263. <td>boolean</td>
  264. <td>false</td>
  265. <td>If true, the animation starts playing automatically after the graph
  266. is created.</td>
  267. </tr>
  268. <tr>
  269. <td>axisColor</td>
  270. <td>string</td>
  271. <td>'#4D4D4D'</td>
  272. <td>The color of the axis lines and the text along the axis.</td>
  273. </tr>
  274. <tr class='toggle collapsible' onclick="toggleTable('optionTable','backgroundColor', this);">
  275. <td><span parent="backgroundColor" class="right-caret"></span> backgroundColor</td>
  276. <td>string or Object</td>
  277. <td>Object</td>
  278. <td>The background color for the main area of the chart.
  279. Can be either a simple HTML color string, for example: 'red' or '#00cc00',
  280. or an object with the following properties.</td>
  281. </tr>
  282. <tr parent="backgroundColor" class="hidden">
  283. <td class="indent">backgroundColor.fill</td>
  284. <td>string</td>
  285. <td>'white'</td>
  286. <td>The chart fill color, as an HTML color string.</td>
  287. </tr>
  288. <tr parent="backgroundColor" class="hidden">
  289. <td class="indent">backgroundColor.stroke</td>
  290. <td>string</td>
  291. <td>'gray'</td>
  292. <td>The color of the chart border, as an HTML color string.</td>
  293. </tr>
  294. <tr>
  295. <tr parent="backgroundColor" class="hidden">
  296. <td class="indent">backgroundColor.strokeWidth</td>
  297. <td>number</td>
  298. <td>1</td>
  299. <td>The border width, in pixels.</td>
  300. </tr>
  301. <tr class='toggle collapsible' onclick="toggleTable('optionTable','cameraPosition', this);">
  302. <td><span parent="cameraPosition" class="right-caret"></span> cameraPosition</td>
  303. <td>Object</td>
  304. <td>Object</td>
  305. <td>Set the initial rotation and position of the camera.
  306. All parameters are optional.
  307. </tr>
  308. <tr parent="cameraPosition" class="hidden">
  309. <td class="indent">cameraPosition.horizontal</td>
  310. <td>number</td>
  311. <td>1.0</td>
  312. <td>Value in radians. It can have any
  313. value, but is normally in the range of 0 and 2*Pi.</td>
  314. </tr>
  315. <tr parent="cameraPosition" class="hidden">
  316. <td class="indent">cameraPosition.vertical</td>
  317. <td>number</td>
  318. <td>0.5</td>
  319. <td>Value in radians between 0 and 0.5*Pi.</td>
  320. </tr>
  321. <tr parent="cameraPosition" class="hidden">
  322. <td class="indent">cameraPosition.distance</td>
  323. <td>number</td>
  324. <td>1.7</td>
  325. <td>The (normalized) distance from the
  326. camera to the center of the graph, in the range of 0.71 to 5.0. A
  327. larger distance puts the graph further away, making it smaller.</p>
  328. </tr>
  329. <tr class='toggle collapsible' onclick="toggleTable('optionTable','dataColor', this);">
  330. <td><span parent="dataColor" class="right-caret"></span> dataColor</td>
  331. <td>string or object</td>
  332. <td>Object</td>
  333. <td>When <code>dataColor</code> is a string, it will set the color for both border and fill color of dots and bars. Applicable for styles <code>dot-size</code>, <code>bar-size</code>, and <code>line</code>. When an object, it can contain the properties descibed below.</td>
  334. </tr>
  335. <tr parent="dataColor" class="hidden">
  336. <td class="indent">dataColor.fill</td>
  337. <td>string</td>
  338. <td>'#7DC1FF'</td>
  339. <td>The fill color of the dots or bars. Applicable when using styles <code>dot-size</code>, <code>bar-size</code>, or <code>line</code>.</td>
  340. </tr>
  341. <tr parent="dataColor" class="hidden">
  342. <td class="indent">dataColor.stroke</td>
  343. <td>string</td>
  344. <td>'#3267D2'</td>
  345. <td>The border color of the dots or bars. Applicable when using styles <code>dot-size</code> or <code>bar-size</code>.</td>
  346. </tr>
  347. <tr parent="dataColor" class="hidden">
  348. <td class="indent">dataColor.strokeWidth</td>
  349. <td>number</td>
  350. <td>1</td>
  351. <td>The line width of dots, bars and lines. Applicable for all styles.</td>
  352. </tr>
  353. <tr>
  354. <td>dotSizeRatio</td>
  355. <td>number</td>
  356. <td>0.02</td>
  357. <td>Ratio of the size of the dots with respect to the width of the graph.</td>
  358. </tr>
  359. <tr>
  360. <td>dotSizeMinFraction</td>
  361. <td>number</td>
  362. <td>0.5</td>
  363. <td>Size of minimum-value dot as a fraction of dotSizeRatio.
  364. Applicable when using style <code>dot-size</code>.</td>
  365. </td>
  366. </tr>
  367. <tr>
  368. <td>dotSizeMaxFraction</td>
  369. <td>number</td>
  370. <td>2.5</td>
  371. <td>Size of maximum-value dot as a fraction of dotSizeRatio.
  372. Applicable when using style <code>dot-size</code>.</td>
  373. </td>
  374. </tr>
  375. <tr>
  376. <td>gridColor</td>
  377. <td>string</td>
  378. <td>'#D3D3D3'</td>
  379. <td>The color of the grid lines.</td>
  380. </tr>
  381. <tr>
  382. <td>height</td>
  383. <td>string</td>
  384. <td>'400px'</td>
  385. <td>The height of the graph in pixels or as a percentage.</td>
  386. </tr>
  387. <tr>
  388. <td>keepAspectRatio</td>
  389. <td>boolean</td>
  390. <td>true</td>
  391. <td>If <code>keepAspectRatio</code> is true, the x-axis and the y-axis
  392. keep their aspect ratio. If false, the axes are scaled such that they
  393. both have the same, maximum with.</td>
  394. </tr>
  395. <tr>
  396. <td>onclick</td>
  397. <td>function</td>
  398. <td>none</td>
  399. <td>Event handler for a click event with signature <code>function onclick(point)</code>.<br>
  400. Parameter <code>point</code> contains data for the nearest graph element relative to the click in
  401. the line of sight. It is an object with the fields:
  402. <ul>
  403. <li><code>id </code> - id of nearest node to the click</li>
  404. <li><code>x </code> - x-coordinate in graph units</li>
  405. <li><code>y </code> - y-coordinate in graph units</li>
  406. <li><code>z </code> - z-coordinate in graph units</li>
  407. <li><code>style</code> - if present, the data value for this point</li>
  408. </ul>
  409. </td>
  410. </tr>
  411. <tr>
  412. <td>showAnimationControls</td>
  413. <td>boolean</td>
  414. <td>true</td>
  415. <td>If true, animation controls are created at the bottom of the Graph.
  416. The animation controls consists of buttons previous, start/stop, next,
  417. and a slider showing the current frame.
  418. Only applicable when the provided data contains an animation.</td>
  419. </tr>
  420. <tr>
  421. <td>showGrid</td>
  422. <td>boolean</td>
  423. <td>true</td>
  424. <td>If true, grid lines are drawn in the x-y surface (the bottom of the 3d
  425. graph).</td>
  426. </tr>
  427. <tr>
  428. <td>showXAxis</td>
  429. <td>boolean</td>
  430. <td>true</td>
  431. <td>If true, X axis and X axis labels are drawn.</td>
  432. </tr>
  433. <tr>
  434. <td>showYAxis</td>
  435. <td>boolean</td>
  436. <td>true</td>
  437. <td>If true, Y axis and Y axis labels are drawn.</td>
  438. </tr>
  439. <tr>
  440. <td>showZAxis</td>
  441. <td>boolean</td>
  442. <td>true</td>
  443. <td>If true, Z axis and Z axis labels are drawn.</td>
  444. </tr>
  445. <tr>
  446. <td>showPerspective</td>
  447. <td>boolean</td>
  448. <td>true</td>
  449. <td>If true, the graph is drawn in perspective: points and lines which
  450. are further away are drawn smaller.
  451. Note that the graph currently does not support a gray colored bottom side
  452. when drawn in perspective.
  453. </td>
  454. </tr>
  455. <tr>
  456. <td>showLegend</td>
  457. <td>boolean</td>
  458. <td>none</td>
  459. <td>If true, a legend is drawn for the graph (if the graph type supports it).
  460. By default a legend is drawn for dot and dot-color style graphs.
  461. </td>
  462. </tr>
  463. <tr>
  464. <td>showShadow</td>
  465. <td>boolean</td>
  466. <td>false</td>
  467. <td>Show shadow on the graph.</td>
  468. </tr>
  469. <tr>
  470. <td>style</td>
  471. <td>string</td>
  472. <td>'dot'</td>
  473. <td>The style of the 3d graph. Available styles:
  474. <code>bar</code>,
  475. <code>bar-color</code>,
  476. <code>bar-size</code>,
  477. <code>dot</code>,
  478. <code>dot-line</code>,
  479. <code>dot-color</code>,
  480. <code>dot-size</code>,
  481. <code>line</code>,
  482. <code>grid</code>,
  483. or <code>surface</code></td>
  484. </tr>
  485. <tr>
  486. <td>tooltip</td>
  487. <td>boolean | function</td>
  488. <td>false</td>
  489. <td>Show a tooltip showing the values of the hovered data point.
  490. The contents of the tooltip can be customized by providing a callback
  491. function as <code>tooltip</code>. In this case the function is called
  492. with an object containing parameters <code>x</code>,
  493. <code>y</code>, <code>z</code>, and <code>data</code>
  494. (the source JS object for the point) as an argument,
  495. and must return a string which may contain HTML.
  496. </td>
  497. </tr>
  498. <tr class='toggle collapsible' onclick="toggleTable('optionTable','tooltipStyle', this);">
  499. <td><span parent="tooltipStyle" class="right-caret"></span> tooltipStyle</td>
  500. <td>Object</td>
  501. <td>Object</td>
  502. </td>
  503. <td>Tooltip style properties.
  504. Provided properties will be merged with the default object.
  505. </td>
  506. </tr>
  507. <!-- Can't define separate entries for content, line and dot objects here,
  508. because toggleTable() can't handle multiple levels of collapsibles -->
  509. <tr parent="tooltipStyle" class="hidden">
  510. <td class="indent">tooltipStyle.content.padding</td>
  511. <td>string</td>
  512. <td>'10px'</td>
  513. <td></td>
  514. </tr>
  515. <tr parent="tooltipStyle" class="hidden">
  516. <td class="indent">tooltipStyle.content.border</td>
  517. <td>string</td>
  518. <td>'1px solid #4d4d4d'</td>
  519. <td></td>
  520. </tr>
  521. <tr parent="tooltipStyle" class="hidden">
  522. <td class="indent">tooltipStyle.content.color</td>
  523. <td>string</td>
  524. <td>'#1a1a1a'</td>
  525. <td></td>
  526. </tr>
  527. <tr parent="tooltipStyle" class="hidden">
  528. <td class="indent">tooltipStyle.content.background</td>
  529. <td>string</td>
  530. <td>'rgba(255,255,255,0.7)'</td>
  531. <td></td>
  532. </tr>
  533. <tr parent="tooltipStyle" class="hidden">
  534. <td class="indent">tooltipStyle.content.borderRadius</td>
  535. <td>string</td>
  536. <td>'2px'</td>
  537. <td></td>
  538. </tr>
  539. <tr parent="tooltipStyle" class="hidden">
  540. <td class="indent">tooltipStyle.content.boxShadow</td>
  541. <td>string</td>
  542. <td>'5px 5px 10px rgba(128,128,128,0.5)'</td>
  543. <td></td>
  544. </tr>
  545. <tr parent="tooltipStyle" class="hidden">
  546. <td class="indent">tooltipStyle.line.height</td>
  547. <td>string</td>
  548. <td>'40px'</td>
  549. <td></td>
  550. </tr>
  551. <tr parent="tooltipStyle" class="hidden">
  552. <td class="indent">tooltipStyle.line.width</td>
  553. <td>string</td>
  554. <td>'0'</td>
  555. <td></td>
  556. </tr>
  557. <tr parent="tooltipStyle" class="hidden">
  558. <td class="indent">tooltipStyle.line.borderLeft</td>
  559. <td>string</td>
  560. <td>'1px solid #4d4d4d'</td>
  561. <td></td>
  562. </tr>
  563. <tr parent="tooltipStyle" class="hidden">
  564. <td class="indent">tooltipStyle.dot.height</td>
  565. <td>string</td>
  566. <td>'0'</td>
  567. <td></td>
  568. </tr>
  569. <tr parent="tooltipStyle" class="hidden">
  570. <td class="indent">tooltipStyle.dot.width</td>
  571. <td>string</td>
  572. <td>'0'</td>
  573. <td></td>
  574. </tr>
  575. <tr parent="tooltipStyle" class="hidden">
  576. <td class="indent">tooltipStyle.dot.border</td>
  577. <td>string</td>
  578. <td>'5px solid #4d4d4d'</td>
  579. <td></td>
  580. </tr>
  581. <tr parent="tooltipStyle" class="hidden">
  582. <td class="indent">tooltipStyle.dot.borderRadius</td>
  583. <td>string</td>
  584. <td>'5px'</td>
  585. <td></td>
  586. </tr>
  587. <tr>
  588. <td>valueMax</td>
  589. <td>number</td>
  590. <td>none</td>
  591. <td>The maximum value for the value-axis. Only available in combination
  592. with the styles <code>dot-color</code> and <code>dot-size</code>.</td>
  593. </tr>
  594. <tr>
  595. <td>valueMin</td>
  596. <td>number</td>
  597. <td>none</td>
  598. <td>The minimum value for the value-axis. Only available in combination
  599. with the styles <code>dot-color</code> and <code>dot-size</code>.</td>
  600. </tr>
  601. <tr>
  602. <td>verticalRatio</td>
  603. <td>number</td>
  604. <td>0.5</td>
  605. <td>A value between 0.1 and 1.0. This scales the vertical size of the graph
  606. When keepAspectRatio is set to false, and verticalRatio is set to 1.0,
  607. the graph will be a cube.</td>
  608. </tr>
  609. <tr>
  610. <td>width</td>
  611. <td>string</td>
  612. <td>'400px'</td>
  613. <td>The width of the graph in pixels or as a percentage.</td>
  614. </tr>
  615. <tr>
  616. <td>xBarWidth</td>
  617. <td>number</td>
  618. <td>none</td>
  619. <td>The width of bars in x direction. By default, the width is equal to the smallest distance
  620. between the data points.
  621. Only applicable for styles <code>'bar'</code> and <code>'bar-color'</code>.</td>
  622. </tr>
  623. <tr>
  624. <td>xCenter</td>
  625. <td>string</td>
  626. <td>'55%'</td>
  627. <td>The horizontal center position of the graph, as a percentage or in
  628. pixels.</td>
  629. </tr>
  630. <tr>
  631. <td>xMax</td>
  632. <td>number</td>
  633. <td>from data</td>
  634. <td>The maximum value for the x-axis.
  635. If not set, the largest value for x in the data set is used.
  636. </td>
  637. </tr>
  638. <tr>
  639. <td>xMin</td>
  640. <td>number</td>
  641. <td>from data</td>
  642. <td>The minimum value for the x-axis.
  643. If not set, the smallest value for x in the data set is used.
  644. </td>
  645. </tr>
  646. <tr>
  647. <td>xStep</td>
  648. <td>number</td>
  649. <td>none</td>
  650. <td>Step size for the grid on the x-axis.</td>
  651. </tr>
  652. <tr>
  653. <td>xValueLabel</td>
  654. <td>function</td>
  655. <td>none</td>
  656. <td>A function for custom formatting of the labels along the x-axis,
  657. for example <code>function (x) {return (x * 100) + '%'}</code>.
  658. </td>
  659. </tr>
  660. <tr>
  661. <td>yBarWidth</td>
  662. <td>number</td>
  663. <td>none</td>
  664. <td>The width of bars in y direction. By default, the width is equal to the smallest distance
  665. between the data points.
  666. Only applicable for styles <code>'bar'</code> and <code>'bar-color'</code>.</td>
  667. </tr>
  668. <tr>
  669. <td>yCenter</td>
  670. <td>string</td>
  671. <td>'45%'</td>
  672. <td>The vertical center position of the graph, as a percentage or in
  673. pixels.</td>
  674. </tr>
  675. <tr>
  676. <td>yMax</td>
  677. <td>number</td>
  678. <td>from data</td>
  679. <td>The maximum value for the y-axis.
  680. If not set, the largest value for y in the data set is used.
  681. </td>
  682. </tr>
  683. <tr>
  684. <td>yMin</td>
  685. <td>number</td>
  686. <td>from data</td>
  687. <td>The minimum value for the y-axis.
  688. If not set, the smallest value for y in the data set is used.
  689. </td>
  690. </tr>
  691. <tr>
  692. <td>yStep</td>
  693. <td>number</td>
  694. <td>none</td>
  695. <td>Step size for the grid on the y-axis.</td>
  696. </tr>
  697. <tr>
  698. <td>yValueLabel</td>
  699. <td>function</td>
  700. <td>none</td>
  701. <td>A function for custom formatting of the labels along the y-axis,
  702. for example <code>function (y) {return (y * 100) + '%'}</code>.
  703. </td>
  704. </tr>
  705. <tr>
  706. <td>zMax</td>
  707. <td>number</td>
  708. <td>from data</td>
  709. <td>The maximum value for the z-axis.
  710. If not set, the largest value for z in the data set is used.
  711. </td>
  712. </tr>
  713. <tr>
  714. <td>zMin</td>
  715. <td>number</td>
  716. <td>from data</td>
  717. <td>The minimum value for the z-axis.
  718. If not set, the smallest value for z in the data set is used.
  719. </td>
  720. </tr>
  721. <tr>
  722. <td>zStep</td>
  723. <td>number</td>
  724. <td>none</td>
  725. <td>Step size for the grid on the z-axis.</td>
  726. </tr>
  727. <tr>
  728. <td>zValueLabel</td>
  729. <td>function</td>
  730. <td>none</td>
  731. <td>A function for custom formatting of the labels along the z-axis,
  732. for example <code>function (z) {return (z * 100) + '%'}</code>.
  733. </td>
  734. </tr>
  735. <tr>
  736. <td>xLabel</td>
  737. <td>String</td>
  738. <td>x</td>
  739. <td>Label on the X axis.</td>
  740. </tr>
  741. <tr>
  742. <td>yLabel</td>
  743. <td>String</td>
  744. <td>y</td>
  745. <td>Label on the Y axis.</td>
  746. </tr>
  747. <tr>
  748. <td>zLabel</td>
  749. <td>String</td>
  750. <td>z</td>
  751. <td>Label on the Z axis.</td>
  752. </tr>
  753. <tr>
  754. <td>filterLabel</td>
  755. <td>String</td>
  756. <td>time</td>
  757. <td>Label for the filter column.</td>
  758. </tr>
  759. <tr>
  760. <td>legendLabel</td>
  761. <td>String</td>
  762. <td>value</td>
  763. <td>Label for the style description.</td>
  764. </tr>
  765. </table>
  766. <h2 id="Methods">Methods</h2>
  767. <p>
  768. Graph3d supports the following methods.
  769. </p>
  770. <table class="methods">
  771. <tr>
  772. <th>Method</th>
  773. <th>Return Type</th>
  774. <th>Description</th>
  775. </tr>
  776. <tr>
  777. <td>animationStart()</td>
  778. <td>none</td>
  779. <td>Start playing the animation.
  780. Only applicable when animation data is available.</td>
  781. </tr>
  782. <tr>
  783. <td>animationStop()</td>
  784. <td>none</td>
  785. <td>Stop playing the animation.
  786. Only applicable when animation data is available.</td>
  787. </tr>
  788. <tr>
  789. <td>getCameraPosition()</td>
  790. <td>An object with parameters <code>horizontal</code>,
  791. <code>vertical</code> and <code>distance</code></td>
  792. <td>Returns an object with parameters <code>horizontal</code>,
  793. <code>vertical</code> and <code>distance</code>,
  794. which each one of them is a number, representing the rotation and position
  795. of the camera.</td>
  796. </tr>
  797. <tr>
  798. <td>redraw()</td>
  799. <td>none</td>
  800. <td>Redraw the graph. Useful after the camera position is changed externally,
  801. when data is changed, or when the layout of the webpage changed.</td>
  802. </tr>
  803. <tr>
  804. <td>setData(data)</td>
  805. <td>none</td>
  806. <td>Replace the data in the Graph3d.</td>
  807. </tr>
  808. <tr>
  809. <td>setOptions(options)</td>
  810. <td>none</td>
  811. <td>Update options of Graph3d.
  812. The provided options will be merged with current options.</td>
  813. </tr>
  814. <tr>
  815. <td>setSize(width, height)</td>
  816. <td>none</td>
  817. <td>Parameters <code>width</code> and <code>height</code> are strings,
  818. containing a new size for the graph. Size can be provided in pixels
  819. or in percentages.</td>
  820. </tr>
  821. <tr>
  822. <td>setCameraPosition (pos)</td>
  823. <td>{horizontal:&nbsp;1.0, vertical:&nbsp;0.5, distance:&nbsp;1.7}</td>
  824. <td>Set the rotation and position of the camera. Parameter <code>pos</code>
  825. is an object which contains three parameters: <code>horizontal</code>,
  826. <code>vertical</code>, and <code>distance</code>.
  827. Parameter <code>horizontal</code> is a value in radians and can have any
  828. value (but normally in the range of 0 and 2*Pi).
  829. Parameter <code>vertical</code> is a value in radians between 0 and 0.5*Pi.
  830. Parameter <code>distance</code> is the (normalized) distance from the
  831. camera to the center of the graph, in the range of 0.71 to 5.0. A
  832. larger distance puts the graph further away, making it smaller.
  833. All parameters are optional.
  834. </td>
  835. </tr>
  836. </table>
  837. <h2 id="Events">Events</h2>
  838. <p>
  839. Graph3d fires events after the camera position has been changed.
  840. The event can be catched by creating a listener.
  841. Here an example on how to catch a <code>cameraPositionChange</code> event.
  842. </p>
  843. <pre class="prettyprint lang-js">
  844. function onCameraPositionChange(event) {
  845. alert('The camera position changed to:\n' +
  846. 'Horizontal: ' + event.horizontal + '\n' +
  847. 'Vertical: ' + event.vertical + '\n' +
  848. 'Distance: ' + event.distance);
  849. }
  850. // assuming var graph3d = new vis.Graph3d(document.getElementById('mygraph'));
  851. graph3d.on('cameraPositionChange', onCameraPositionChange);
  852. </pre>
  853. <p>
  854. The following events are available.
  855. </p>
  856. <table class="events">
  857. <tr>
  858. <th>name</th>
  859. <th>Properties</th>
  860. <th>Description</th>
  861. </tr>
  862. <tr>
  863. <td>cameraPositionChange</td>
  864. <td>
  865. <ul>
  866. <li><code>horizontal</code>: Number. The horizontal angle of the camera.</li>
  867. <li><code>vertical</code>: Number. The vertical angle of the camera.</li>
  868. <li><code>distance</code>: Number. The distance of the camera to the center of the graph.</li>
  869. </ul>
  870. </td>
  871. <td>The camera position changed. Fired after the user modified the camera position
  872. by moving (dragging) the graph, or by zooming (scrolling),
  873. but not after a call to <code>setCameraPosition</code> method.
  874. The new camera position can be retrieved by calling the method
  875. <code>getCameraPosition</code>.</td>
  876. </tr>
  877. </table>
  878. <h2 id="Data_Policy">Data Policy</h2>
  879. <p>
  880. All code and data are processed and rendered in the browser. No data is sent to any server.
  881. </p>
  882. </div>
  883. <!-- Bootstrap core JavaScript
  884. ================================================== -->
  885. <!-- Placed at the end of the document so the pages load faster -->
  886. <script src="../js/jquery.min.js"></script>
  887. <script src="../js/bootstrap.min.js"></script>
  888. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  889. <script src="../js/ie10-viewport-bug-workaround.js"></script>
  890. <!-- jquery extensions -->
  891. <script src="../js/jquery.highlight.js"></script>
  892. <script src="../js/jquery.url.min.js"></script>
  893. <!-- Tipue vendor js -->
  894. <script src="../js/tipuesearch.config.js"></script>
  895. <script src="../js/tipuesearch.js"></script>
  896. <!-- controller -->
  897. <script src="../js/main.js"></script>