Skip to content

Conversation

@teunbrand
Copy link
Collaborator

This PR aims to fix #370.

It reviews all the Stats defined in ggraph and inserts early returns of empty data.

Comment on lines 189 to 194
compute_layer = function(data, params, layout) {
if (empty(data)) {
return(data)
}
StatEdgeLink2$compute_layer(data, params, layout)
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably it'd be better to handle this in ggforce::StatLink2.

Comment on lines -237 to -239
if (nrow(data) == 0) {
return(data)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because data was returned regardless of the condition, I removed these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some stats fail when the filter selects no data

1 participant