79690151

Date: 2025-07-04 12:07:36
Score: 1
Natty:
Report link

Plotly doesnt support visible link labels in Sankey charts `link.label` doesnt do anything

If you want to show values on the links you need to manually add annotations using `layout.annotations`. Heres a basic idea

```
const annotations = links.map((link, i) => ({
x: 0.5, // placeholder - estimate midpoints in real case
y: 0.5,
text: link.value.toString(),
showarrow: false,
font: { size: 12 }
}));

Plotly.newPlot(chartDiv, [trace], { annotations });
```
Youd need to estimate x and y per link based on node possitions not perfect but works
maybe Plotly adds native support this in the future 🤷‍♂️

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: ShamsCyber