briatte / briatte/ggnetwork

geom_nodes() not sizing by nodal attributes

Open
#60 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
154
Forks
29
PR merge metrics
No merged PRs in 30d

Description

geom_nodes() doesn't seem to be sizing nodes properly when its fed sizes that are related to node attributes.

```r
## repex
data(flo)
n <- network(flo, directed = FALSE)
n%v%'labels' = paste(n%v%'vertex.names', sna::degree(n))

# each time i run this the size of each node changes
ggplot(n, aes(x, y, xend = xend, yend = yend)) +
geom_edges(colour = "steelblue") +
geom_nodes(size = degree(n), shape = 21, colour = "steelblue", fill = "white") +
geom_nodetext(aes(label = labels))+
theme_blank()
```
Plot_Zoom

P.S. thank you for creating and sharing this package. It's my favorite network visualization tool.

Contributor guide

Open the contributing guide

Research direction

Start with the supplied R reproduction using geom_nodes(size = degree(n)) and inspect how geom_nodes evaluates node attributes. The issue is resolved when repeated plots use stable, correctly sized nodes for the same degree values.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.