I'm trying to create a sankey diagram using D3 in observable based off a CSV. I would like to partition the sankey based off a boolean column of the CSV, similar to this picture: partitioned on male/female
I'm currently trying to create visualization identically to this code but with my own dataset. The only difference is in my energy array I have my variable where each object has a 1.0 or 0.0 for the partition. How can I get this variable to be reflected in the colors?
I've tried adding in a "partioned" option in the drop down and then creating a
if (linkColor === "scaled")
option where I could change the .attr("stroke", "color") but I don't think I got close. The only thing I know is that typically you change the link color with .attr("stroke", "color"). I'm very new to this all so please let me know if I can provide more information or if you have any ideas.