datastorm-open / visNetwork

R package, using vis.js library for network visualization
Other
545 stars 125 forks source link

Legend nodes right-aligned when shape = "dot" and label provided #399

Open finlaycampbell opened 3 years ago

finlaycampbell commented 3 years ago

Legend nodes become right aligned when the shape is set to "dot" and a label is provided. This causes the label text to become illegible if the label is long. Example provided below.

library(visNetwork)

## legend node is center aligned when only shape provided
visNetwork(data.frame(id = 1)) %>%
  visLegend(addNodes = data.frame(shape = "dot"))

## legend node is center aligned when only label provided
visNetwork(data.frame(id = 1)) %>%
  visLegend(addNodes = data.frame(label = "test"))

## legend node is right aligned when label and shape provided
visNetwork(data.frame(id = 1)) %>%
  visLegend(addNodes = data.frame(shape = "dot", label = "test"))