From fb3a96ec6232bb8a01fbbb3e36189b7da47b69b3 Mon Sep 17 00:00:00 2001 From: Simon Diemert Date: Wed, 26 Aug 2015 14:22:53 -0700 Subject: [PATCH] fixed disappearing visualizations due to window resizing bug. --- views/visualization.hbs | 10 ++++++++-- visualizations/ratioViz.html | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/views/visualization.hbs b/views/visualization.hbs index 9a49029..2cb3983 100644 --- a/views/visualization.hbs +++ b/views/visualization.hbs @@ -45,6 +45,7 @@ break; } + } /** @@ -90,6 +91,7 @@ $("#chart").hide(); break; default: + console.log("changeViz: default case") $("#lineVizToggle").hide(); $("#barVizToggle").hide(); $("#pieChart").hide(); @@ -100,6 +102,10 @@ break; } + + //this is a bit of a hack, it causes the visualizations to be re-rendered everytime you + //change the visualization we are looking at. + $(window).trigger('resize'); } @@ -260,7 +266,7 @@ var d = new Date(data.latest*1000); $("#exec-date").show(); - $("#exec-date").text("Latest Execution: " + d.getFullYear()+"-"+ ("0"+(d.getMonth()+1)).slice(-2) +"-"+d.getDate()); + $("#exec-date").text("Latest Execution: " + d.getFullYear()+"-"+ ("0"+(d.getMonth()+1)).slice(-2) +"-"+("0"+d.getDate()).slice(-2)); }else{ @@ -340,9 +346,9 @@ if(data.script === 'ratioViz'){ - barVis({{{json visualization}}}, "#barChart"); lineVis({{{json visualization}}}, "#lineChart"); pieVis({{{json visualization}}}, "#pieChart"); + barVis({{{json visualization}}}, "#barChart"); }else{ diff --git a/visualizations/ratioViz.html b/visualizations/ratioViz.html index aadddb7..4e917b4 100644 --- a/visualizations/ratioViz.html +++ b/visualizations/ratioViz.html @@ -749,10 +749,6 @@ .selectAll(".pie") .data(allData) .enter().append("g") - .call(function(d){ - console.log(d); - return; - }) .attr("class", "pie") .attr("transform", function (d, i) { return "translate(" + i * pieSpacing + ",0)";