pkgnet icon indicating copy to clipboard operation
pkgnet copied to clipboard

Enable visNetwork legends for graphs with a single grouping

Open jameslamb opened this issue 6 years ago • 0 comments

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.

jameslamb avatar Feb 10 '19 06:02 jameslamb