1

I came across this solution for controlling the x-position of nodes in D3 Sankey diagrams:

d3 sankey charts - manually position node along x axis

I made the appropriate modifications to the code and to my data, but some of the nodes appear on the right edge when they should be appearing on the left. Below is the result I get:

enter image description here

All of the nodes with a single number have xPos=0 in the data, but some are showing up with xPos=2. What am I doing wrong?

Community
  • 1
  • 1
user3433489
  • 911
  • 2
  • 10
  • 24

1 Answers1

1

After two frustrating hours, I realized that the problem is with the way the link data is being written. Of the nodes with xPos=0, some where written as targets, and some were written as sources. Those written only as targets were placed on the right edge (xPos=2). So I basically re-wrote the data as a directed graph. All nodes with a single digit are now written as sources.

enter image description here

user3433489
  • 911
  • 2
  • 10
  • 24