From 15d8a326f74266e6c80c00fe5d616637d9c2d293 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 5 Mar 2015 13:06:35 +0100 Subject: [PATCH] add zoom to graphers --- timeside/server/templates/timeside/item_detail.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); -- 2.39.5