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

230
Vistas
Sankey Diagram with D3 - links coloring

I'm trying to render a Sankey Diagram based on this example.

TL:DR - The color() function works for coloring the nodes but not the links.

While I got it working and rendering (I'm using latest version of D3 and React inside of Next.js), I'm having a problem coloring the links.

In the example linked above there are multiple coloring options, and for some reason none of them work for me.

They all use the 'color' function (and also the coloring of the nodes is using this function - and it works great in that case) - but I just don't manage to get it working for the links.

If I enter a simple hex value (any value, just not the color() function) it works fine.

enter image description here

My Sankey diagram is based on the example linked at the top, with most links and nodes deleted for less clutter.

This is the code for this component:

https://pastebin.com/xUCJDGWg
about 4 years ago · Juan Pablo Isaza
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