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

Commit fb3a96e

Browse files
committed
fixed disappearing visualizations due to window resizing bug.
1 parent 4834336 commit fb3a96e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

views/visualization.hbs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
break;
4646
4747
}
48+
4849
}
4950
5051
/**
@@ -90,6 +91,7 @@
9091
$("#chart").hide();
9192
break;
9293
default:
94+
console.log("changeViz: default case")
9395
$("#lineVizToggle").hide();
9496
$("#barVizToggle").hide();
9597
$("#pieChart").hide();
@@ -100,6 +102,10 @@
100102
break;
101103
102104
}
105+
106+
//this is a bit of a hack, it causes the visualizations to be re-rendered everytime you
107+
//change the visualization we are looking at.
108+
$(window).trigger('resize');
103109
}
104110
</script>
105111
<body>
@@ -260,7 +266,7 @@
260266
var d = new Date(data.latest*1000);
261267
262268
$("#exec-date").show();
263-
$("#exec-date").text("Latest Execution: " + d.getFullYear()+"-"+ ("0"+(d.getMonth()+1)).slice(-2) +"-"+d.getDate());
269+
$("#exec-date").text("Latest Execution: " + d.getFullYear()+"-"+ ("0"+(d.getMonth()+1)).slice(-2) +"-"+("0"+d.getDate()).slice(-2));
264270
265271
}else{
266272
@@ -340,9 +346,9 @@
340346
341347
if(data.script === 'ratioViz'){
342348
343-
barVis({{{json visualization}}}, "#barChart");
344349
lineVis({{{json visualization}}}, "#lineChart");
345350
pieVis({{{json visualization}}}, "#pieChart");
351+
barVis({{{json visualization}}}, "#barChart");
346352
347353
}else{
348354

visualizations/ratioViz.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,6 @@
749749
.selectAll(".pie")
750750
.data(allData)
751751
.enter().append("g")
752-
.call(function(d){
753-
console.log(d);
754-
return;
755-
})
756752
.attr("class", "pie")
757753
.attr("transform", function (d, i) {
758754
return "translate(" + i * pieSpacing + ",0)";

0 commit comments

Comments
 (0)