Some context:
I created a force diagram and I connected the div to my svg g nodes so that I can display beautiful paragraphs of text. I am trying to create transitions that disappear from inserted divs.
Problem:
Whenever I initiate a transition on the transparency style attribute of my div, it jumps out of the positioning stream. I highlighted the problem in a related fiddle . This is not related to the layout of forces, but I use external elements to place the html in the svg-based power layout.
here is an example and a fiddle :
var foreign = d3.select("body") .append("svg") .attr("height", 200) .attr("width", 300) .append("svg:g") .attr("transform", "translate(40, 20)") .append("svg:foreignObject") .attr("width", "100px") .attr("height", "50px"); var outer = foreign.append("xhtml:div") .attr("class", "outer"); var inner = outer.append("xhtml:div") .attr("class", "inner") .text("inner div"); outer.transition() .duration(3000) .style("opacity", 0.0);
And the screenshot is visual, from the violin (note how it duplicates the div)
right before the transition:

during the transition:

I am using Chrome 28 for OS X 10.6.8 to view it. It becomes even more subtle on a Safari, with elements blinking inside and out of sight.
source share