title: Improving D3 Sequence Sunburst Example
body: <p>This <code>D3</code> example served as my starting point: </p>
  
  <p><a href="http://bl.ocks.org/kerryrodden/7090426" rel="nofollow noreferrer">http://bl.ocks.org/kerryrodden/7090426</a></p>
  
  <p><img src="https://i.stack.imgur.com/FDgt5.gif" alt="enter image description here"></p>
  
  <hr>
  
  <p><strong>I wanted to change data that feeds the diagram, and I made following new example</strong>:</p>
  
  <p><a href="http://jsfiddle.net/ZGVK3/" rel="nofollow noreferrer">http://jsfiddle.net/ZGVK3/</a></p>
  
  <p><img src="https://i.stack.imgur.com/QQbYE.gif" alt="enter image description here"></p>
  
  <p>One can notice at least two problems:</p>
  
  <ol>
  <li>Legend is wrong. This is because it still contains 'hardcoded' names from original example.</li>
  <li>All nodes are colored black. This is because the color scheme is also 'hardcoded' only for node names from original example.</li>
  </ol>
  
  <p>How to improve the original example (or my jsfiddle, it doesn't matter) so that legend and coloring are self-adjusted to the data that feeds the diagram?</p>