D3: Difference between layout.force & forceSimulation to build network graph
Asked Answered
A

0

9

I am a beginner of D3 and was trying to grasp the ropes on how to build a proper force-directed graph in D3. There appear to be two different ways to build it.

  1. Using layout.force. e.g
  2. Using forceSimulation. e.g

I'm more or less comfortable with the first as the code is shorter and easier to understand. However, it is hard to translate functions from one sample codes using example 2 to example 1 without a proper understanding. Would anyone be able to describe the advantages or disadvantages for each?

Thank you.

Ashlar answered 23/3, 2018 at 3:11 Comment(1)
It's due to changes in namespace from v3 to v4. From docs on changes in v4 from v3: "The force layout d3.layout.force has been renamed to d3.forceSimulation." linkDespain

© 2022 - 2024 — McMap. All rights reserved.