how do you set a fixed link distance with d3 v4
<p>All the API examples seem to be for v3 still.
I'm trying to understand how to create a force graph with links of a fixed distance, like:
<a href="http://bl.ocks.org/d3noob/5141278" rel="noreferrer">http://bl.ocks.org/d3noob/5141278</a></p>

<p>I looked at link_distance but not sure how to apply it:
<a href="https://github.com/d3/d3-force/blob/master/README.md#link_distance" rel="noreferrer">https://github.com/d3/d3-force/blob/master/README.md#link_distance</a></p>

<p>Creating a graph like this:</p>

<pre><code>  let simulation = d3.forceSimulation()
      .force("link", d3.forceLink().id(function(d) { return d.id; }))
      .force("charge", d3.forceManyBody().strength(-150))
      .force("center", d3.forceCenter(width / 2, height / 2));
</code></pre>

<p>I tried various combos like:</p>

<pre><code>  // .force("link", d3.forceLink().distance(20).strength(1))
  // .force("linkDistance", 20)
  // .force("link", d3.forceLink().id(function(d) { return d.id; }))
</code></pre>

<p>but no luck!</p>

<p>So it seems link_distance can't be fixed? 
its a result of strength and (distance, whatever that is)</p>

<p>So how do I apply <code>strength</code> and <code>distance</code> to links in d3 v4 ?
Is it applied to the simulation or something else?</p>