summaryrefslogtreecommitdiff
path: root/www/lib/vis/examples/timeline/editing/editingItems.html
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2017-09-21 12:49:18 -0400
committerPliable Pixels <pliablepixels@gmail.com>2017-09-21 12:49:18 -0400
commitb28028ac4082842143b0f528d6bc539da6ccb419 (patch)
tree1e26ea969a781ed8e323fca4e3c76345113fc694 /www/lib/vis/examples/timeline/editing/editingItems.html
parent676270d21beed31d767a06c89522198c77d5d865 (diff)
mega changes, including updates and X
Diffstat (limited to 'www/lib/vis/examples/timeline/editing/editingItems.html')
-rw-r--r--www/lib/vis/examples/timeline/editing/editingItems.html77
1 files changed, 77 insertions, 0 deletions
diff --git a/www/lib/vis/examples/timeline/editing/editingItems.html b/www/lib/vis/examples/timeline/editing/editingItems.html
new file mode 100644
index 00000000..186a363c
--- /dev/null
+++ b/www/lib/vis/examples/timeline/editing/editingItems.html
@@ -0,0 +1,77 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Timeline | Manipulation example</title>
+
+ <style>
+ body, html {
+ font-family: arial, sans-serif;
+ font-size: 11pt;
+ }
+ </style>
+
+ <script src="../../../dist/vis.js"></script>
+ <link href="../../../dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
+ <script src="../../googleAnalytics.js"></script>
+</head>
+<body>
+
+<p>An editable timeline allows to drag items around, create new items, and remove items. Changes are logged in the browser console.</p>
+
+<div id="visualization"></div>
+
+<script>
+ // create a dataset with items
+ // we specify the type of the fields `start` and `end` here to be strings
+ // containing an ISO date. The fields will be outputted as ISO dates
+ // automatically getting data from the DataSet via items.get().
+ var items = new vis.DataSet({
+ type: { start: 'ISODate', end: 'ISODate' }
+ });
+
+ // add items to the DataSet
+ items.add([
+ {id: 1, content: 'item 1<br>start', start: '2014-01-23'},
+ {id: 2, content: 'item 2', start: '2014-01-18'},
+ {id: 3, content: 'item 3', start: '2014-01-21'},
+ {id: 4, content: 'item 4', start: '2014-01-19', end: '2014-01-24'},
+ {id: 5, content: 'item 5', start: '2014-01-28', type:'point'},
+ {id: 6, content: 'item 6', start: '2014-01-26'}
+ ]);
+
+ // log changes to the console
+ items.on('*', function (event, properties) {
+ console.log(event, properties.items);
+ });
+
+ var container = document.getElementById('visualization');
+ var options = {
+ start: '2014-01-10',
+ end: '2014-02-10',
+ height: '300px',
+
+ // allow selecting multiple items using ctrl+click, shift+click, or hold.
+ multiselect: true,
+
+ // allow manipulation of items
+ editable: true,
+
+ /* alternatively, enable/disable individual actions:
+
+ editable: {
+ add: true,
+ updateTime: true,
+ updateGroup: true,
+ remove: true
+ },
+
+ */
+
+ showCurrentTime: true
+ };
+
+ var timeline = new vis.Timeline(container, items, options);
+
+</script>
+</body>
+</html> \ No newline at end of file