We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41f6d9b commit 870c0caCopy full SHA for 870c0ca
1 file changed
server.R
@@ -1377,8 +1377,13 @@ output$degreedist <- renderPlot({
1377
if(!is.null(input$colorby_dd)){
1378
if(input$colorby_dd != "None"){
1379
ncolors <- dim(dd_plotdata())[1]
1380
- color <- brewer.pal(ncolors,"Blues")[1:ncolors]
1381
- color[is.na(color)] <- brewer.pal(9, "Blues")
+ if(ncolors == 2){
+ color <- c("#eff3ff", "#377FBC")
1382
+ } else if(ncolors < 10){
1383
+ color <- brewer.pal(ncolors,"Blues")
1384
+ } else if(ncolors >= 10){
1385
+ color <- colorRampPalette(brewer.pal(9,"Blues"))(ncolors)
1386
+ }
1387
ltext <- sort(unique(get.vertex.attribute(nw(),input$colorby_dd)))
1388
ltext <- append(ltext, "")
1389
lfill <- c(color, 0)
0 commit comments