Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda