The sgraph R package extends the sigma.js library to enable multiline labels. The Javascript functions will start new lines on line breaks ('\n') and this function enables to easily format the details of nodes by showing the value of the relationship (edge weights) it has with other nodes. See the Shiny examples for use cases.
multiline_labels(
df_nodes,
display_val_str = "\nP-value: ",
replace_codes = TRUE,
label_str = "Label: ",
group_str = "Group: "
)sgraph object with modified node hidden atribute
Nodes data frame of a sgraph object
String that will be prepended to each edge weight
Should the label of the node replace the id ?
String that will pe prepended to the node label
String that will pe prepended to the node group