Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda