title: Different shapes according to data in D3 force layout
body: <p>I am trying to have a force layout where there are two types of shapes: Circles and Triangles. However, I get an error- Cannot read property 'symbol' of undefined. This is the relevant code snippet:</p>
  
  <pre><code>var shape = {"action": "circle", "why-hard": "triangle"};    
  
  var node = g.append("g")
      .attr("class", "nodes")
      .selectAll("circle")
      .data(graph.nodes)
      .enter().append("circle")
      .attr("d", d3.svg.symbol().type(function(d) { return shape[d.type]; }))
  </code></pre>