if (!d3.selectAll(".tooltip")[0].length) {
var tooltip = d3.select("body").append("div")
.attr("class", "tooltip")
.style("opacity", 0);
}
function mouseover(d) {
tooltip.tranisition()
.duration(300)
.style("opacity", 1);
}
If I change it to tooltip[0][0] it say HTMLDivElement has no method transition. Wondering why it doesn't like this...
You've misspelt transition -- should be
tooltip.transition()