Skip to content
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

feat(gridView): implement feature (#24) #25

Merged
merged 10 commits into from
Mar 9, 2021
Merged

feat(gridView): implement feature (#24) #25

merged 10 commits into from
Mar 9, 2021

Conversation

swsoyee
Copy link
Owner

@swsoyee swsoyee commented Mar 7, 2021

A dirty solution, but it works.

library(r3dmol)

m1 <- r3dmol() %>%
  m_add_model(data = pdb_6zsl, format = "pdb") %>%
  m_zoom_to()

m2 <- m1 %>%
  m_set_style(style = m_style_cartoon(color = "spectrum"))

m3 <- m1 %>%
  m_set_style(style = m_style_stick())

m4 <- m1 %>%
  m_set_style(style = m_style_sphere())

m_grid(
  viewer = list(m1, m2, m3, m4),
  configs = list(rows = 2, cols = 2, control_all = TRUE),
  viewer_config = list(backgroundColor = "black")
)

截屏2021-03-07 23 47 09

@swsoyee swsoyee added the enhancement New feature or request label Mar 7, 2021
@swsoyee swsoyee added this to the v0.1.2 milestone Mar 7, 2021
@swsoyee swsoyee self-assigned this Mar 7, 2021
@swsoyee swsoyee linked an issue Mar 7, 2021 that may be closed by this pull request
@swsoyee
Copy link
Owner Author

swsoyee commented Mar 7, 2021

As I mention in 0a4e61c, some packages (dependencies) version are not available now, so the check will failed for several days. If checking locally, everything should be fine.

Copy link
Collaborator

@BradyAJohnston BradyAJohnston left a comment

Choose a reason for hiding this comment

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

Looks really good! Thanks for the really quick development on this - it's a really nice implementation. I just had some comments on the m_gri() options but that was it.

Comment on lines +59 to +64
if (is.null(rows)) {
rows <- ceiling(sqrt(length(viewer)))
}

if (is.null(cols)) {
cols <- ceiling(length(viewer) / rows)
Copy link
Owner Author

Choose a reason for hiding this comment

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

brilliant implemantation! I'm really bad at math...

@swsoyee
Copy link
Owner Author

swsoyee commented Mar 9, 2021

Looks good, wait for the checks to be completed and then merge it to master.

@BradyAJohnston
Copy link
Collaborator

Looks good! Merged 🎉🎉

@swsoyee swsoyee merged commit f9a8ef3 into master Mar 9, 2021
@swsoyee swsoyee deleted the grid-view branch March 9, 2021 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layout Support
2 participants