$(document).ready(function(){
    var div = d3.select("body").append("div")
            .attr("class", "tooltip")
            .style("opacity", 0);

    var interactiveBrowse_ecology = d3.select("#interactiveBrowse_ecology");

    var habitat = interactiveBrowse_ecology.append("rect")
            .attr("x", 370)
            .attr("y", 260)
            .attr("width", 120)
            .attr("height", 50)
            .attr("id", "habitat")
            .style("opacity", 0.01)
            .style("fill", "#fff")
            .style("cursor", "pointer")
            .on("click", function(){
                displayPage(d3.select(this).attr("id"));
            });

    function displayPage(traitId){
        var resultPage =  WebRoot+"/trait/details/byId"+traitId;
        window.location.href = resultPage;
    }
});

@@ -430,24 +430,66 @@
  %22habitat%22)%0A
+            .attr(%22type_cvterm_id%22, %2227%22)%0A
             
@@ -674,16 +674,28 @@
 ).attr(%22
+type_cvterm_
 id%22));%0A 
@@ -797,18 +797,25 @@
 tails/by
+CvTerm
 Id
+/
 %22+traitI

Add click function in order to display a trait type by id