From: Guillaume Pellerin Date: Thu, 5 Mar 2015 12:06:35 +0000 (+0100) Subject: add zoom to graphers X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=15d8a326f74266e6c80c00fe5d616637d9c2d293;p=timeside.git add zoom to graphers --- diff --git a/timeside/server/templates/timeside/item_detail.html b/timeside/server/templates/timeside/item_detail.html index 12caf6f..2a0fc05 100644 --- a/timeside/server/templates/timeside/item_detail.html +++ b/timeside/server/templates/timeside/item_detail.html @@ -90,6 +90,17 @@ var timeline = function(json_url, div_id) { // 4. draw graph d3.select('#'+div_id).call(graph.draw); + var zoomLayer = wavesUI.zoomer() + .select('#'+div_id) + .on('mousemove', function(e) { + // update graph xZoom + graph.xZoom(e); + }) + .on('mouseup', function(e) { + // set the final xZoom value of the graph + graph.xZoomSet(); + }); + // to update the data, add it to the data array and redraw the graph $('#add-data').on('click', function(e) { e.preventDefault(); @@ -97,7 +108,7 @@ var timeline = function(json_url, div_id) { var datum = { start: 2, duration: 1, - height: 150 + height: 1000 }; data.push(datum);