Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
fixed disappearing visualizations due to window resizing bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiemert committed Aug 26, 2015
1 parent 4834336 commit fb3a96e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 8 additions & 2 deletions views/visualization.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
break;
}
}
/**
Expand Down Expand Up @@ -90,6 +91,7 @@
$("#chart").hide();
break;
default:
console.log("changeViz: default case")
$("#lineVizToggle").hide();
$("#barVizToggle").hide();
$("#pieChart").hide();
Expand All @@ -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');
}
</script>
<body>
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
4 changes: 0 additions & 4 deletions visualizations/ratioViz.html
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
Expand Down

0 comments on commit fb3a96e

Please sign in to comment.