Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Line breaks in Node Labels Sankey Diagrams

Hello, I am using R, Plotly for Sankey Diagrams. I am facing an issue while placing line breaks for the node labels.
I tried using <br> (HTML Line breaker), but this reflects only in hover labels but not in node labels.

Ex: I have nodes of different sized labels.

node_labels <- c(“ABC XXX”, “DEF XXX”, “XYZ XXX”)
I tried replacing them like,
“ABC
XXX”… etc.,
but this seems to change the text representation when hovered but not for the label itself.

Tried with other variants like <br/>,<br />, but these are giving out an empty plot.

Please let me know if there is any other way.

Thank you in advance!
Karthik

1 Like