d3.js bilevel partition - truncate text condition on click of outermost ring
<p>Additional question to the answer found here: <a href="https://stackoverflow.com/questions/21770344/truncate-text-in-d3">Truncate text in d3</a></p>

<pre><code>.text(function (d) {
 if(d.name.length &gt; 5)
     return d.name.substring(0,5)+'...';
 else
     return d.name;                       
 });
</code></pre>

<p>I'd like to add a condition where if the text is a label in the outermost ring of a <a href="http://bl.ocks.org/vgrocha/1580af34e56ee6224d33" rel="nofollow noreferrer">bilevel partition chart</a>, the text is no longer truncated.</p>

<p>Possible solution would be to add something like: if outermost ring is clicked, redraw the text.</p>

<p>Edit: Sorry I forgot to mention that this condition should only happen if the outermost ring is clicked. So initially the text is truncated, and when the outermost ring is zoomed in, the truncation is removed.</p>

<pre><code>inside function click(d):
    if d.depth &gt;= 3 {
        modify firstLine, remove code that shortens the text
    }
    else if other d.depth is clicked { 
        keep/revert back to the same code
    }
</code></pre>