title: How to custom colour a network chart?
body: <p>I have a directed force chart and I wanted to add custom colour how would I go about saying if the label = US or Russia I wanted them to be coloured blue and red, else I want everything else to be the same colour this is my code for my nodes, I created separate variables for US and Russia but I'm unsure what I'm supposed to do next:</p>
  <pre><code>const usa = nodes.filter(d =&gt; d.label == &quot;UNITED STATES&quot;)
      console.log(usa)
  const russia = nodes.filter(d =&gt; d.label == &quot;RUSSIA&quot;)
  
  const node = svg.append(&quot;g&quot;)
      .selectAll(&quot;circle&quot;)
      .data(nodes)
      .join(&quot;circle&quot;)
      .attr(&quot;r&quot;, 1)
      .attr(&quot;fill&quot;, &quot;#F2D974&quot;)
      .attr(&quot;fill-opacity&quot;, 0.4)
  simulation.on(&quot;tick&quot;, () =&gt; {
    link
        .attr(&quot;x1&quot;, d =&gt; d.source.x)
        .attr(&quot;y1&quot;, d =&gt; d.source.y)
        .attr(&quot;x2&quot;, d =&gt; d.target.x)
        .attr(&quot;y2&quot;, d =&gt; d.target.y);
    node
        .attr(&quot;cx&quot;, d =&gt; d.x)
        .attr(&quot;cy&quot;, d =&gt; d.y)
     });
  </code></pre>