Skip to content

Commit

Permalink
Merge pull request #20 from infinity-a11y/Type2_Clustering
Browse files Browse the repository at this point in the history
One-node cluster color assignment
  • Loading branch information
fpaskali authored Aug 21, 2024
2 parents 5739cfd + 3735988 commit d202eaf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions App.R
Original file line number Diff line number Diff line change
Expand Up @@ -18237,8 +18237,13 @@ server <- function(input, output, session) {

if (input$mst_cluster_type == "Area") {
for (i in 1:length(unique(data$nodes$group))) {
visNetwork_graph <- visNetwork_graph %>%
visGroups(groupname = unique(data$nodes$group)[i], color = color_palette[i])
if (sum(data$nodes$group == unique(data$nodes$group)[i]) > 1) { # Color only cluster with 2 or more nodes
visNetwork_graph <- visNetwork_graph %>%
visGroups(groupname = unique(data$nodes$group)[i], color = color_palette[i])
} else {
visNetwork_graph <- visNetwork_graph %>%
visGroups(groupname = unique(data$nodes$group)[i], color = mst_color_node())
}
}
} else {
thin_edges <- data$edges
Expand Down

0 comments on commit d202eaf

Please sign in to comment.