Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

d3 opacity transitions flash final state

I have a number of basic opacity transitions along the lines of

emp_line.transition()
    .duration(1250)
    .attr('opacity', 1)

However, when I run them, often these items will flash to full opacity and then back to none and fade in. Is there any way to prevent this content flickering?

like image 386
futuraprime Avatar asked Sep 06 '12 21:09

futuraprime


1 Answers

Testing this, it looks like you get the flicker with .attr('opacity'), but not with .style('opacity'), so changing the transition to .style() should fix this.

Test fiddle: http://jsfiddle.net/nrabinowitz/Y5uX6/

No idea why this should be true though :(.

like image 104
nrabinowitz Avatar answered Sep 20 '22 16:09

nrabinowitz