Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
d3.js Uncaught (in promise) TypeError: d3.forceSimulation is not a function

I am new to d3.js and I am trying to learn by changing/looking at chunks of code.

I am running into the following issue: I get a Uncaught (in promise) TypeError: d3.forceSimulation is not a function

This is the line where I am getting the error:

const simulation = d3.forceSimulation(nodes)
    // .force('charge', d3.forceManyBody().strength(5))
    .force('x', d3.forceX().x(function(d) {
        return xCenter[d.category]
    }))
    .force('y', d3.forceY().y(0))
    .force('collision', d3.forceCollide().radius(d => 1.1*d.r*Math.sqrt(2)))
  //.force('collision', collide)
    .on('tick', ticked)

I have the following d3.js version loading in my html: <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>

If I load <script src="./../d3.v6.js"></script> nothing will render. What might be the problem here?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should also include d3-force in your scripts.

<script src="https://cdn.jsdelivr.net/npm/d3-force@3"></script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!