title: Iterate connected nodes in cytoscape.js
body: <p>I need to get the nodes connected to a given node, and highlight them. The "components" function looks good for this, however my traversal fails. The component collection shows a size of one and only the original node gets highlighted. </p>
  
  <pre><code>cynode = cy.getElementById(idstr);
  comps = cynode.components();    
  for (i = 0; i &lt; comps.length; i++) /* really there's only one component */
  {
      comp = comps[i];
      alert(comp.size());   /* this always returns 1!! */
      comp.nodes().addClass('nodehlt');  /* only the original node gets highlighted */
  }
  </code></pre>