pkgnet
pkgnet copied to clipboard
Enable visNetwork legends for graphs with a single grouping
Now that datastorm-open/visNetwork#290 has been addressed, we do not need this protection in AbstractGraphReporter
:
if (length(colorFieldValues) > 1) {
g <- visNetwork::visLegend(
graph = g
, position = "right"
, main = list(
text = colorFieldName
, style = 'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;'
)
)
}
Now creating legends in visNetwork
plots will work even if you have only a single grouping!
To close this issue, remove the if(length(...))
guard around the rest of this code, and add a test that explicitly hits the case where length(colorFieldValues)
is 1.