Skip to content

create_layout does not return the 3rd dimension ('z' column) when passing dim = 3 #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gsimchoni opened this issue Sep 17, 2018 · 1 comment

Comments

@gsimchoni
Copy link

(Hi, this is a great package, thank you!)

The dim parameter in e.g. in igraph::layout_with_fr can be 2 or 3, in case a 3D layout is desired. The call:

layout3d <- create_layout(tidy_graph, layout = "fr", dim = 3)

passes without warning, and returns a data.frame with only the x and y columns, missing the z column.

I realize the source is somewhere here but it's out of my league:

layout <- cbind(x=layout[,1], y=layout[,2], extraData[, !names(extraData) %in% c('x', 'y'), drop = FALSE])

I think:

  1. If because we're dealing with ggplot2 philosophy this is intentional, there should at least be a warning, referring the user to use igraph.
  2. But preferably I would change things so a 3D layout can actually be output from this function, i.e. including the z column.

Thanks.

@thomasp85
Copy link
Owner

You are correct that this is intentional due to the 2D nature of ggplot2 and a warning would probably be welcome

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

No branches or pull requests

2 participants