When hovering over a Sankey node, the highlighted links include more than just the links from the previous/next node. The incoming/outgoing value is correct, but for some reason when hovering a random link is highlighted from the first node to the last node. Has anyone had a similar issue or know why this might be happening?
Below is a snippet of the data. I’ve checked the source/target/value for the random link and it’s structured correctly. In fact, the random link changes each time the graph is generated so I’m pretty certain that it’s not an issue with the links, targets, or labels in the data.
Here is the code for the sankey graph:
data_trace = dict(
type=‘sankey’,
domain=dict(
x=[0, 1],
y=[0, 1]
),
hoverlabel=dict(
bgcolor=‘rgba(255, 255, 230, 1.0)’,
align=‘auto’,
bordercolor=’#000000’,
namelength=-1,
font=dict(
family=‘Helvetica’,
size=15,
color=’#000000’
)),
orientation=“h”,
valueformat=".0f",
textfont=dict(
family=“Arial Black”,
size=15,
color=‘black’
),
node=dict(
pad=30,
thickness=30,
color=["#1F1B1B",
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”,
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”,
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”,
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”,
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”,
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”,
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”,
“#CA0000”, “#FFFFF0”, “#002147”, “#e7f5fe”, “#FFFAFA”, “#660000”, “#ffdd1a”, “#156eb7”, “#6115b7”],
line=dict(
# color = “black”,
width=0.5
),
label=[“High School or GED”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”,
“Enlisted”, “School”, “Work”, “Work and School”, “Work and Reserves”, “School and Reserves”,
“Retirement”, “ROTC or Mil. Academy”, “Transferred Schools”],
),
link=dict(
source=dff[‘Source’].dropna(axis=0, how=‘any’),
target=dff[‘Target’].dropna(axis=0, how=‘any’),
value=dff[‘Value’].dropna(axis=0, how=‘any’),
color=“rgba(140, 140, 140, .025)”,
label=dff[‘Label’].dropna(axis=0, how=‘any’),
)
),