score:1

you need to target the text and line parts of the axis

d3.select('.axis').selectAll('text')
     .transition()
     .duration(duration)
     .ease(d3.easeLinear)
     .style("opacity", opacity);
d3.select('.axis').selectAll('line')
     .transition()
     .duration(duration)
     .ease(d3.easeLinear)
     .style("opacity", opacity);

Related Query