What layout is better to use to draw a flow chart with D3.js? D3.js is version 5.7.0.

use D3.js to draw flow chart with tree layout or force layout.
D3.js is version 5.7.0,
React is 16.0.0
the final effect is similar to the picture.
PS: canvas area initialization will have five nodes, start and end, and other three nodes. If the current node is selected, a node will be automatically generated after it is clicked on the menu bar button. If no node is selected, a node is generated by default before the end.

clipboard.png

problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

topic description

sources of topics and their own ideas

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Jun.10,2021
Menu