diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-27 12:42:48 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-27 12:42:48 -0400 |
| commit | 210e8feae2fb4842bfb2de38666e6c41671fef3c (patch) | |
| tree | cbdafa34b1a6260bb20236d7e9de9eb1b690a1c5 /www/lib/vis/examples/timeline/editing/updateDataOnEvent.html | |
| parent | e7e7baeaad90229ccb3e0f45f4ebd77be7d79b14 (diff) | |
removed lib
Diffstat (limited to 'www/lib/vis/examples/timeline/editing/updateDataOnEvent.html')
| -rw-r--r-- | www/lib/vis/examples/timeline/editing/updateDataOnEvent.html | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/www/lib/vis/examples/timeline/editing/updateDataOnEvent.html b/www/lib/vis/examples/timeline/editing/updateDataOnEvent.html deleted file mode 100644 index 985551ee..00000000 --- a/www/lib/vis/examples/timeline/editing/updateDataOnEvent.html +++ /dev/null @@ -1,90 +0,0 @@ -<html> -<head> - <title>Timeline | Update data on event</title> - - <style type="text/css"> - body { - font: 11pt verdana; - } - - .vis.timeline .item.past { - filter: alpha(opacity=50); - opacity: 0.5; - } - </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 style="width: 600px;"> - When the custom time bar is shown, the user can drag this bar to a specific - time. The Timeline sends an event that the custom time is changed, after - which the contents of the timeline can be changed according to the specified - time in past or future. -</p> - -<div id="customTime"> </div> -<p></p> - -<div id="mytimeline"></div> - - -<script> - // create a data set - var data = new vis.DataSet([ - { - id: 1, - start: new Date((new Date()).getTime() - 60 * 1000), - end: new Date(), - content: 'Dynamic event' - } - ]); - - // specify options - var options = { - showCurrentTime: true - }; - - // create a timeline - var container = document.getElementById('mytimeline'); - timeline = new vis.Timeline(container, data, options); - - timeline.addCustomTime(new Date()); - - // add event listener - timeline.on('timechange', function (event) { - document.getElementById("customTime").innerHTML = "Custom Time: " + event.time; - - var item = data.get(1); - if (event.time > item.start) { - item.end = new Date(event.time); - var now = new Date(); - if (event.time < now) { - item.content = "Dynamic event (past)"; - item.className = 'past'; - } - else if (event.time > now) { - item.content = "Dynamic event (future)"; - item.className = 'future'; - } - else { - item.content = "Dynamic event (now)"; - item.className = 'now'; - } - - data.update(item); - } - }); - - // set a custom range from -2 minute to +3 minutes current time - var start = new Date((new Date()).getTime() - 2 * 60 * 1000); - var end = new Date((new Date()).getTime() + 3 * 60 * 1000); - timeline.setWindow(start, end, {animation: false}); - -</script> - -</body> -</html> |
