Fade language label in distribution graph
[gitphp.git] / js / modules / languagedistgraph.js
blob:a/js/modules/languagedistgraph.js -> blob:b/js/modules/languagedistgraph.js
--- a/js/modules/languagedistgraph.js
+++ b/js/modules/languagedistgraph.js
@@ -68,7 +68,8 @@
 			langLabel = centerGroup.append("text")
 				.attr("dy", -25)
 				.attr("font-size", "16")
-				.attr("text-anchor", "middle");
+				.attr("text-anchor", "middle")
+				.style('opacity', 0);
 
 			countLabel = centerGroup.append("text")
 				.attr("dy", 0)
@@ -120,14 +121,14 @@
 						d3.select(this).transition()
 							.duration(250)
 							.attr("d", grownArc);
-						langLabel.text(d.data.key);
+						langLabel.transition().style('opacity', 1).text(d.data.key);
 						countLabel.text(d.data.value);
 					})
 					.on("mouseout", function(d) {
 						d3.select(this).transition()
 							.duration(250)
 							.attr("d", arc);
-						langLabel.text("");
+						langLabel.transition().style('opacity', 0);
 						countLabel.text(count);
 					});
 

comments