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

227
Views
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
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!