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

195
Views
How to get nodes in the new version of D3?

The D3 examples I've seen use an old version of D3 with tree.nodes(root).reverse() to retrieve nodes array. It does not work with the latest version of D3. How do I get nodes array in the new version?

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

0

Create a tree layout object:

const layout = d3.tree();

Build a root object from your data:

const root = d3.hierarchy(data, d => d.children);

Extract nodes from the tree:

const tree = layout(root);
const nodes = tree.descendants();

Should work for D3 V7 (see a working example here)

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!