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.

863 lines
22 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>vis.js | DataSet documentation</title>
  5. <link href="css/prettify.css" type="text/css" rel="stylesheet" />
  6. <link href='css/style.css' type='text/css' rel='stylesheet'>
  7. <script type="text/javascript" src="lib/prettify/prettify.js"></script>
  8. </head>
  9. <body onload="prettyPrint();">
  10. <div id="container">
  11. <h1>DataSet documentation</h1>
  12. <h2 id="Contents">Contents</h2>
  13. <ul>
  14. <li><a href="#Overview">Overview</a></li>
  15. <li><a href="#Example">Example</a></li>
  16. <li><a href="#Construction">Construction</a></li>
  17. <li><a href="#Methods">Methods</a></li>
  18. <li><a href="#Subscriptions">Subscriptions</a></li>
  19. <li><a href="#Data_Manipulation">Data Manipulation</a></li>
  20. <li><a href="#Data_Selection">Data Selection</a></li>
  21. <li><a href="#Data_Policy">Data Policy</a></li>
  22. </ul>
  23. <h2 id="Overview">Overview</h2>
  24. <p>
  25. Vis.js comes with a flexible DataSet, which can be used to hold and
  26. manipulate unstructured data and listen for changes in the data.
  27. The DataSet is key/value based. Data items can be added, updated and
  28. removed from the DatSet, and one can subscribe to changes in the DataSet.
  29. The data in the DataSet can be filtered and ordered, and fields (like
  30. dates) can be converted to a specific type. Data can be normalized when
  31. appending it to the DataSet as well.
  32. </p>
  33. <h2 id="Example">Example</h2>
  34. <p>
  35. The following example shows how to use a DataSet.
  36. </p>
  37. <pre class="prettyprint lang-js">
  38. // create a DataSet
  39. var options = {};
  40. var data = new vis.DataSet(options);
  41. // add items
  42. // note that the data items can contain different properties and data formats
  43. data.add([
  44. {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
  45. {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
  46. {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
  47. {id: 4, text: 'item 4'}
  48. ]);
  49. // subscribe to any change in the DataSet
  50. data.on('*', function (event, properties, senderId) {
  51. console.log('event', event, properties);
  52. });
  53. // update an existing item
  54. data.update({id: 2, group: 1});
  55. // remove an item
  56. data.remove(4);
  57. // get all ids
  58. var ids = data.getIds();
  59. console.log('ids', ids);
  60. // get a specific item
  61. var item1 = data.get(1);
  62. console.log('item1', item1);
  63. // retrieve a filtered subset of the data
  64. var items = data.get({
  65. filter: function (item) {
  66. return item.group == 1;
  67. }
  68. });
  69. console.log('filtered items', items);
  70. // retrieve formatted items
  71. var items = data.get({
  72. fields: ['id', 'date'],
  73. type: {
  74. date: 'ISODate'
  75. }
  76. });
  77. console.log('formatted items', items);
  78. </pre>
  79. <h2 id="Construction">Construction</h2>
  80. <p>
  81. A DataSet can be constructed as:
  82. </p>
  83. <pre class="prettyprint lang-js">
  84. var data = new vis.DataSet([data] [, options])
  85. </pre>
  86. <p>
  87. After construction, data can be added to the DataSet using the methods
  88. <code>add</code> and <code>update</code>, as described in section
  89. <a href="#Data_Manipulation">Data Manipulation</a>.
  90. </p>
  91. <p>
  92. The parameter <code>data</code>code> is optional and can be an Array or
  93. Google DataTable with items.
  94. </p>
  95. <p>
  96. The parameter <code>options</code> is optional and is an object which can
  97. contain the following properties:
  98. </p>
  99. <table>
  100. <tr>
  101. <th>Name</th>
  102. <th>Type</th>
  103. <th>Default value</th>
  104. <th>Description</th>
  105. </tr>
  106. <tr>
  107. <td>fieldId</td>
  108. <td>String</td>
  109. <td>"id"</td>
  110. <td>
  111. The name of the field containing the id of the items.
  112. When data is fetched from a server which uses some specific
  113. field to identify items, this field name can be specified
  114. in the DataSet using the option <code>fieldId</code>.
  115. For example <a href="http://couchdb.apache.org/"
  116. target="_blank">CouchDB</a> uses the field
  117. <code>"_id"</code> to identify documents.
  118. </td>
  119. </tr>
  120. <tr>
  121. <td>type</td>
  122. <td>Object.&lt;String,&nbsp;String&gt;</td>
  123. <td>none</td>
  124. <td>
  125. An object containing field names as key, and data types as
  126. value. By default, the type of the properties of items are left
  127. unchanged. Item properties can be normalized by specifying a
  128. field type. This is useful for example to automatically convert
  129. stringified dates coming from a server into JavaScript Date
  130. objects. The available data types are listed in section
  131. <a href="#Data_Types">Data Types</a>.
  132. </td>
  133. </tr>
  134. </table>
  135. <h2 id="Methods">Methods</h2>
  136. <p>DataSet contains the following methods.</p>
  137. <table>
  138. <colgroup>
  139. <col width="200">
  140. </colgroup>
  141. <tr>
  142. <th>Method</th>
  143. <th>Return Type</th>
  144. <th>Description</th>
  145. </tr>
  146. <tr>
  147. <td>add(data [, senderId])</td>
  148. <td>Number[]</td>
  149. <td>Add data to the DataSet. Adding an item will fail when there already is an item with the same id. The function returns an array with the ids of the added items. See section <a href="#Data_Manipulation">Data Manipulation</a>.</td>
  150. </tr>
  151. <tr>
  152. <td>clear([senderId])</td>
  153. <td>Number[]</td>
  154. <td>Clear all data from the DataSet. The function returns an array with the ids of the removed items.</td>
  155. </tr>
  156. <tr>
  157. <td>distinct(field)</td>
  158. <td>Array</td>
  159. <td>Find all distinct values of a specified field. Returns an unordered array containing all distinct values. If data items do not contain the specified field are ignored.</td>
  160. </tr>
  161. <tr>
  162. <td>forEach(callback [, options])</td>
  163. <td>none</td>
  164. <td>
  165. Execute a callback function for every item in the dataset.
  166. The available options are described in section <a href="#Data_Selection">Data Selection</a>.
  167. </td>
  168. </tr>
  169. <tr>
  170. <td>
  171. get([options] [, data])<br>
  172. get(id [,options] [, data])<br>
  173. get(ids [, options] [, data])
  174. </td>
  175. <td>Object | Array | DataTable</td>
  176. <td>
  177. Get a single item, multiple items, or all items from the DataSet.
  178. Usage examples can be found in section <a href="#Getting_Data">Getting Data</a>, and the available <code>options</code> are described in section <a href="#Data_Selection">Data Selection</a>. If parameter <code>data</code> isprovided, items will be appended to this array or table, which is required in case of Google DataTable.
  179. </td>
  180. </tr>
  181. <tr>
  182. <td>
  183. getDataSet()
  184. </td>
  185. <td>DataSet</td>
  186. <td>
  187. Get the DataSet itself. In case of a DataView, this function does not
  188. return the DataSet to which the DataView is connected.
  189. </td>
  190. </tr>
  191. <tr>
  192. <td>
  193. getIds([options])
  194. </td>
  195. <td>Number[]</td>
  196. <td>
  197. Get ids of all items or of a filtered set of items.
  198. Available <code>options</code> are described in section <a href="#Data_Selection">Data Selection</a>, except that options <code>fields</code> and <code>type</code> are not applicable in case of <code>getIds</code>.
  199. </td>
  200. </tr>
  201. <tr>
  202. <td>map(callback [, options])</td>
  203. <td>Array</td>
  204. <td>
  205. Map every item in the DataSet.
  206. The available options are described in section <a href="#Data_Selection">Data Selection</a>.
  207. </td>
  208. </tr>
  209. <tr>
  210. <td>max(field)</td>
  211. <td>Object | null</td>
  212. <td>
  213. Find the item with maximum value of specified field. Returns <code>null</code> if no item is found.
  214. </td>
  215. </tr>
  216. <tr>
  217. <td>min(field)</td>
  218. <td>Object | null</td>
  219. <td>
  220. Find the item with minimum value of specified field. Returns <code>null</code> if no item is found.
  221. </td>
  222. </tr>
  223. <tr>
  224. <td>off(event, callback)</td>
  225. <td>none</td>
  226. <td>
  227. Unsubscribe from an event, remove an event listener. See section <a href="#Subscriptions">Subscriptions</a>.
  228. </td>
  229. </tr>
  230. <tr>
  231. <td>on(event, callback)</td>
  232. <td>none</td>
  233. <td>
  234. Subscribe to an event, add an event listener. See section <a href="#Subscriptions">Subscriptions</a>.
  235. </td>
  236. </tr>
  237. <tr>
  238. <td>
  239. remove(id [, senderId])<br>
  240. remove(ids [, senderId])
  241. </td>
  242. <td>Number[]</td>
  243. <td>
  244. Remove on ore multiple items by id or by the items themselves. Returns an array with the ids of the removed items. See section <a href="#Data_Manipulation">Data Manipulation</a>.
  245. </td>
  246. </tr>
  247. <tr>
  248. <td>
  249. update(id [, senderId])<br>
  250. update(ids [, senderId])
  251. </td>
  252. <td>Number[]</td>
  253. <td>
  254. Update on ore existing items. When an item doesn't exist, it will be created. Returns an array with the ids of the removed items. See section <a href="#Data_Manipulation">Data Manipulation</a>.
  255. </td>
  256. </tr>
  257. </table>
  258. <h2 id="Subscriptions">Subscriptions</h2>
  259. <p>
  260. One can subscribe on changes in a DataSet.
  261. A subscription can be created using the method <code>on</code>,
  262. and removed with <code>off</code>.
  263. </p>
  264. <pre class="prettyprint lang-js">
  265. // create a DataSet
  266. var data = new vis.DataSet();
  267. // subscribe to any change in the DataSet
  268. data.on('*', function (event, properties, senderId) {
  269. console.log('event:', event, 'properties:', properties, 'senderId:', senderId);
  270. });
  271. // add an item
  272. data.add({id: 1, text: 'item 1'}); // triggers an 'add' event
  273. data.update({id: 1, text: 'item 1 (updated)'}); // triggers an 'update' event
  274. data.remove(1); // triggers an 'remove' event
  275. </pre>
  276. <h3 id="On">On</h3>
  277. <p>
  278. Subscribe to an event.
  279. </p>
  280. Syntax:
  281. <pre class="prettyprint lang-js">DataSet.on(event, callback)</pre>
  282. Where:
  283. <ul>
  284. <li>
  285. <code>event</code> is a String containing any of the events listed
  286. in section <a href="#Events">Events</a>.
  287. </li>
  288. <li>
  289. <code>callback</code> is a callback function which will be called
  290. each time the event occurs. The callback function is described in
  291. section <a href="#Callback">Callback</a>.
  292. </li>
  293. </ul>
  294. <h3 id="Off">Off</h3>
  295. <p>
  296. Unsubscribe from an event.
  297. </p>
  298. Syntax:
  299. <pre class="prettyprint lang-js">DataSet.off(event, callback)</pre>
  300. Where <code>event</code> and <code>callback</code> correspond with the
  301. parameters used to <a href="#On">subscribe</a> to the event.
  302. <h3 id="Events">Events</h3>
  303. <p>
  304. The following events are available for subscription:
  305. </p>
  306. <table>
  307. <tr>
  308. <th>Event</th>
  309. <th>Description</th>
  310. </tr>
  311. <tr>
  312. <td>add</td>
  313. <td>
  314. The <code>add</code> event is triggered when an item
  315. or a set of items is added, or when an item is updated while
  316. not yet existing.
  317. </td>
  318. </tr>
  319. <tr>
  320. <td>update</td>
  321. <td>
  322. The <code>update</code> event is triggered when an existing item
  323. or a set of existing items is updated.
  324. </td>
  325. </tr>
  326. <tr>
  327. <td>remove</td>
  328. <td>
  329. The <code>remove</code> event is triggered when an item
  330. or a set of items is removed.
  331. </td>
  332. </tr>
  333. <tr>
  334. <td>*</td>
  335. <td>
  336. The <code>*</code> event is triggered when any of the events
  337. <code>add</code>, <code>update</code>, and <code>remove</code>
  338. occurs.
  339. </td>
  340. </tr>
  341. </table>
  342. <h3 id="Callback">Callback</h3>
  343. <p>
  344. The callback functions of subscribers are called with the following
  345. parameters:
  346. </p>
  347. <pre class="prettyprint lang-js">
  348. function (event, properties, senderId) {
  349. // handle the event
  350. });
  351. </pre>
  352. <p>
  353. where the parameters are defined as
  354. </p>
  355. <table>
  356. <tr>
  357. <th>Parameter</th>
  358. <th>Type</th>
  359. <th>Description</th>
  360. </tr>
  361. <tr>
  362. <td>event</td>
  363. <td>String</td>
  364. <td>
  365. Any of the available events: <code>add</code>,
  366. <code>update</code>, or <code>remove</code>.
  367. </td>
  368. </tr>
  369. <tr>
  370. <td>properties</td>
  371. <td>Object&nbsp;|&nbsp;null</td>
  372. <td>
  373. Optional properties providing more information on the event.
  374. In case of the events <code>add</code>,
  375. <code>update</code>, and <code>remove</code>,
  376. <code>properties</code> is always an object containing a property
  377. items, which contains an array with the ids of the affected
  378. items.
  379. </td>
  380. </tr>
  381. <tr>
  382. <td>senderId</td>
  383. <td>String&nbsp;|&nbsp;Number</td>
  384. <td>
  385. An senderId, optionally provided by the application code
  386. which triggered the event. If senderId is not provided, the
  387. argument will be <code>null</code>.
  388. </td>
  389. </tr>
  390. </table>
  391. <h2 id="Data_Manipulation">Data Manipulation</h2>
  392. <p>
  393. The data in a DataSet can be manipulated using the methods
  394. <a href="#Add"><code>add</code></a>,
  395. <a href="#Update"><code>update</code></a>,
  396. and <a href="#Remove"><code>remove</code></a>.
  397. The DataSet can be emptied using the method
  398. <a href="#Clear"><code>clear</code></a>.
  399. </p>
  400. <pre class="prettyprint lang-js">
  401. // create a DataSet
  402. var data = new vis.DataSet();
  403. // add items
  404. data.add([
  405. {id: 1, text: 'item 1'},
  406. {id: 2, text: 'item 2'},
  407. {id: 3, text: 'item 3'}
  408. ]);
  409. // update an item
  410. data.update({id: 2, text: 'item 2 (updated)'});
  411. // remove an item
  412. data.remove(3);
  413. </pre>
  414. <h3 id="Add">Add</h3>
  415. <p>
  416. Add a data item or an array with items.
  417. </p>
  418. Syntax:
  419. <pre class="prettyprint lang-js">var addedIds = DataSet.add(data [, senderId])</pre>
  420. The argument <code>data</code> can contain:
  421. <ul>
  422. <li>
  423. An <code>Object</code> containing a single item to be
  424. added. The item must contain an id.
  425. </li>
  426. <li>
  427. An <code>Array</code> or
  428. <code>google.visualization.DataTable</code> containing
  429. a list with items to be added. Each item must contain
  430. an id.
  431. </li>
  432. </ul>
  433. <p>
  434. After the items are added to the DataSet, the DataSet will
  435. trigger an event <code>add</code>. When a <code>senderId</code>
  436. is provided, this id will be passed with the triggered
  437. event to all subscribers.
  438. </p>
  439. <p>
  440. The method will throw an Error when an item with the same id
  441. as any of the added items already exists.
  442. </p>
  443. <h3 id="Update">Update</h3>
  444. <p>
  445. Update a data item or an array with items.
  446. </p>
  447. Syntax:
  448. <pre class="prettyprint lang-js">var updatedIds = DataSet.update(data [, senderId])</pre>
  449. The argument <code>data</code> can contain:
  450. <ul>
  451. <li>
  452. An <code>Object</code> containing a single item to be
  453. updated. The item must contain an id.
  454. </li>
  455. <li>
  456. An <code>Array</code> or
  457. <code>google.visualization.DataTable</code> containing
  458. a list with items to be updated. Each item must contain
  459. an id.
  460. </li>
  461. </ul>
  462. <p>
  463. The provided properties will be merged in the existing item.
  464. When an item does not exist, it will be created.
  465. </p>
  466. <p>
  467. After the items are updated, the DataSet will
  468. trigger an event <code>add</code> for the added items, and
  469. an event <code>update</code>. When a <code>senderId</code>
  470. is provided, this id will be passed with the triggered
  471. event to all subscribers.
  472. </p>
  473. <h3 id="Remove">Remove</h3>
  474. <p>
  475. Remove a data item or an array with items.
  476. </p>
  477. Syntax:
  478. <pre class="prettyprint lang-js">var removedIds = DataSet.remove(id [, senderId])</pre>
  479. <p>
  480. The argument <code>id</code> can be:
  481. </p>
  482. <ul>
  483. <li>
  484. A <code>Number</code> or <code>String</code> containing the id
  485. of a single item to be removed.
  486. </li>
  487. <li>
  488. An <code>Object</code> containing the item to be deleted.
  489. The item will be deleted by its id.
  490. </li>
  491. <li>
  492. An Array containing ids or items to be removed.
  493. </li>
  494. </ul>
  495. <p>
  496. The method ignores removal of non-existing items, and returns an array
  497. containing the ids of the items which are actually removed from the
  498. DataSet.
  499. </p>
  500. <p>
  501. After the items are removed, the DataSet will
  502. trigger an event <code>remove</code> for the removed items.
  503. When a <code>senderId</code> is provided, this id will be passed with
  504. the triggered event to all subscribers.
  505. </p>
  506. <h3 id="Clear">Clear</h3>
  507. <p>
  508. Clear the complete DataSet.
  509. </p>
  510. Syntax:
  511. <pre class="prettyprint lang-js">var removedIds = DataSet.clear([senderId])</pre>
  512. <p>
  513. After the items are removed, the DataSet will
  514. trigger an event <code>remove</code> for all removed items.
  515. When a <code>senderId</code> is provided, this id will be passed with
  516. the triggered event to all subscribers.
  517. </p>
  518. <h2 id="Data_Selection">Data Selection</h2>
  519. <p>
  520. The DataSet contains functionality to format, filter, and sort data retrieved via the
  521. methods <code>get</code>, <code>getIds</code>, <code>forEach</code>, and <code>map</code>. These methods have the following syntax:
  522. </p>
  523. <pre class="prettyprint lang-js">
  524. DataSet.get([id] [, options] [, data]);
  525. DataSet.getIds([options]);
  526. DataSet.forEach(callback [, options]);
  527. DataSet.map(callback [, options]);
  528. </pre>
  529. <p>
  530. Where <code>options</code> is an Object which can have the following
  531. properties:
  532. </p>
  533. <table>
  534. <tr>
  535. <th>Name</th>
  536. <th>Type</th>
  537. <th>Description</th>
  538. </tr>
  539. <tr>
  540. <td>fields</td>
  541. <td>String[&nbsp;]</td>
  542. <td>
  543. An array with field names.
  544. By default, all properties of the items are emitted.
  545. When <code>fields</code> is defined, only the properties
  546. whose name is specified in <code>fields</code> will be included
  547. in the returned items.
  548. </td>
  549. </tr>
  550. <tr>
  551. <td>type</td>
  552. <td>Object.&lt;String,&nbsp;String&gt;</td>
  553. <td>
  554. An object containing field names as key, and data types as value.
  555. By default, the type of the properties of an item are left
  556. unchanged. When a field type is specified, this field in the
  557. items will be converted to the specified type. This can be used
  558. for example to convert ISO strings containing a date to a
  559. JavaScript Date object, or convert strings to numbers or vice
  560. versa. The available data types are listed in section
  561. <a href="#Data_Types">Data Types</a>.
  562. </td>
  563. </tr>
  564. <tr>
  565. <td>filter</td>
  566. <td>Function</td>
  567. <td>Items can be filtered on specific properties by providing a filter
  568. function. A filter function is executed for each of the items in the
  569. DataSet, and is called with the item as parameter. The function must
  570. return a boolean. All items for which the filter function returns
  571. true will be emitted.
  572. See section <a href="#Data_Filtering">Data Filtering</a>.</td>
  573. </tr>
  574. <tr>
  575. <td>order</td>
  576. <td>String | Function</td>
  577. <td>Order the items by a field name or custom sort function.</td>
  578. </tr>
  579. <tr>
  580. <td>returnType</td>
  581. <td>String</td>
  582. <td>Determine the type of output of the get function. Allowed values are <code>Array | Object | DataTable</code>.
  583. The <code>DataTable</code> refers to a Google DataTable. The default returnType is an array. The object type will return a JSON object with the ID's as keys.</td>
  584. </tr>
  585. </table>
  586. <p>
  587. The following example demonstrates formatting properties and filtering
  588. properties from items.
  589. </p>
  590. <pre class="prettyprint lang-js">
  591. // create a DataSet
  592. var data = new vis.DataSet();
  593. data.add([
  594. {id: 1, text: 'item 1', date: '2013-06-20', group: 1, first: true},
  595. {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
  596. {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
  597. {id: 4, text: 'item 4'}
  598. ]);
  599. // retrieve formatted items
  600. var items = data.get({
  601. fields: ['id', 'date', 'group'], // output the specified fields only
  602. type: {
  603. date: 'Date', // convert the date fields to Date objects
  604. group: 'String' // convert the group fields to Strings
  605. }
  606. });
  607. </pre>
  608. <h3 id="Getting_Data">Getting Data</h3>
  609. <p>
  610. Data can be retrieved from the DataSet using the method <code>get</code>.
  611. This method can return a single item or a list with items.
  612. </p>
  613. <p>A single item can be retrieved by its id:</p>
  614. <pre class="prettyprint lang-js">
  615. var item1 = dataset.get(1);
  616. </pre>
  617. <p>A selection of items can be retrieved by providing an array with ids:</p>
  618. <pre class="prettyprint lang-js">
  619. var items = dataset.get([1, 3, 4]); // retrieve items 1, 3, and 4
  620. </pre>
  621. <p>All items can be retrieved by simply calling <code>get</code> without
  622. specifying an id:</p>
  623. <pre class="prettyprint lang-js">
  624. var items = dataset.get(); // retrieve all items
  625. </pre>
  626. <h3 id="Data_Filtering">Data Filtering</h3>
  627. <p>
  628. Items can be filtered on specific properties by providing a filter
  629. function. A filter function is executed for each of the items in the
  630. DataSet, and is called with the item as parameter. The function must
  631. return a boolean. All items for which the filter function returns
  632. true will be emitted.
  633. </p>
  634. <pre class="prettyprint lang-js">
  635. // retrieve all items having a property group with value 2
  636. var group2 = dataset.get({
  637. filter: function (item) {
  638. return (item.group == 2);
  639. }
  640. });
  641. // retrieve all items having a property balance with a value above zero
  642. var positiveBalance = dataset.get({
  643. filter: function (item) {
  644. return (item.balance > 0);
  645. }
  646. });
  647. </pre>
  648. <h3 id="Data_Types">Data Types</h3>
  649. <p>
  650. DataSet supports the following data types:
  651. </p>
  652. <table style="width: 100%">
  653. <tr>
  654. <th>Name</th>
  655. <th>Description</th>
  656. <th>Examples</th>
  657. </tr>
  658. <tr>
  659. <td>Boolean</td>
  660. <td>A JavaScript Boolean</td>
  661. <td>
  662. <code>true</code><br>
  663. <code>false</code>
  664. </td>
  665. </tr>
  666. <tr>
  667. <td>Number</td>
  668. <td>A JavaScript Number</td>
  669. <td>
  670. <code>32</code><br>
  671. <code>2.4</code>
  672. </td>
  673. </tr>
  674. <tr>
  675. <td>String</td>
  676. <td>A JavaScript String</td>
  677. <td>
  678. <code>"hello world"</code><br>
  679. <code>"2013-06-28"</code>
  680. </td>
  681. </tr>
  682. <tr>
  683. <td>Date</td>
  684. <td>A JavaScript Date object</td>
  685. <td>
  686. <code>new Date()</code><br>
  687. <code>new Date(2013, 5, 28)</code><br>
  688. <code>new Date(1372370400000)</code>
  689. </td>
  690. </tr>
  691. <tr>
  692. <td>Moment</td>
  693. <td>A Moment object, created with
  694. <a href="http://momentjs.com/" target="_blank">moment.js</a></td>
  695. <td>
  696. <code>moment()</code><br>
  697. <code>moment('2013-06-28')</code>
  698. </td>
  699. </tr>
  700. <tr>
  701. <td>ISODate</td>
  702. <td>A string containing an ISO Date</td>
  703. <td>
  704. <code>new Date().toISOString()</code><br>
  705. <code>"2013-06-27T22:00:00.000Z"</code>
  706. </td>
  707. </tr>
  708. <tr>
  709. <td>ASPDate</td>
  710. <td>A string containing an ASP Date</td>
  711. <td>
  712. <code>"/Date(1372370400000)/"</code><br>
  713. <code>"/Date(1198908717056-0700)/"</code>
  714. </td>
  715. </tr>
  716. </table>
  717. <h2 id="Data_Policy">Data Policy</h2>
  718. <p>
  719. All code and data is processed and rendered in the browser.
  720. No data is sent to any server.
  721. </p>
  722. </div>
  723. </body>
  724. </html>