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

92
Views
D3 Hierarchy function not calculating y property

I am currently working on a tree chart using d3 and this is my data,

data = {
  name: 'ROOT',
  id: 'root',
  children: [
      {
          name: 'A',
          id: 'A',
          description: 'This is a tooltip with a long multi line text in it',
          children: [
              {
                  name: 'AA',
                  id: 'AA',
                  description: 'This is a tooltip'
              },
              {
                  name: 'BB',
                  id: 'BB'
              }
          ]
      },
      {
          name: 'B',
          id: 'B',
          children: [
              {
                  name: 'AA',
                  id: 'AA'
              },
              {
                  name: 'BB',
                  id: 'BB'
              },
              {
                  name: 'CC',
                  id: 'CC'
              }
          ]
      }
  ]

};

When I pass this data to d3.hierarchy() and after consoling the result the y property is not defined. Can you explain why the y property is not calculated. Also the nodes calculated through descendants() also have the y property missing. Result after passing the data to d3.hierarchy()

Result of nodes calculated through descendants()

about 4 years ago · Juan Pablo Isaza
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!