Skip to content

Commit

Permalink
add return values
Browse files Browse the repository at this point in the history
  • Loading branch information
nvelden committed May 31, 2021
1 parent 177bf56 commit 79a287d
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2021-05-26.
Once it is accepted, delete this file and tag the release (commit 177bf56).
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: NGLVieweR
Title: Interactive 3D Visualization of Molecular Structures
Version: 1.3.0
Version: 1.3.1
Authors@R: c(
person("Niels", "van der Velden", role = c("aut", "cre"), email = "n.s.j.vandervelden@gmail.com"),
person("Alexander", "Rose", role = "cph", comment = 'NGL.js library'))
Expand Down
11 changes: 9 additions & 2 deletions R/NGLVieweR.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ NGLVieweR <- function(data, format = NULL, width = NULL, height = NULL, elementI
#'Set stage parameters.
#'@param NGLVieweR A NGLVieweR object.
#'@param ... Options controlling the stage. Most common options are \code{backgroundColor}, \code{rotateSpeed}, \code{zoomSpeed},
#'\code{hoverTimeout} and \code{lightIntensity}. For a full list of options, see the "StageParameters" method in the official
#'\code{hoverTimeout} and \code{lightIntensity}. For a full list of options, see the "stageParameters" method in the official
#'\href{http://nglviewer.org/ngl/api/}{NGL.js} manual.
#'@return Returns list of stage parameters to \code{NGLVieweR} \code{htmlwidgets} object.
#'@seealso
#'* [updateStage()]
#'* [NGLVieweR_example()] See example "basic".
Expand Down Expand Up @@ -259,9 +260,10 @@ stageParameters <- function(NGLVieweR, ...) {
#'
#'@param NGLVieweR A NGLVieweR object.
#'@param type Type of representation. Most common options are "cartoon", "ball+stick", "line", "surface", "ribbon" and "label".
#'For a full list of options, see the "StructureRepresentation" method in the official \href{http://nglviewer.org/ngl/api/}{NGL.js} manual.
#'For a full list of options, see the "structureRepresentation" method in the official \href{http://nglviewer.org/ngl/api/}{NGL.js} manual.
#'@param param Options for the different types of representations. Most common options are \code{name}, \code{opacity}, \code{colorScheme}, \code{sele}, \code{colorValue} and \code{visibility}.
#'For a full list of options, see the general "RepresentationParameters" method and type specific Label-, Structure- and Surface- RepresentationParameters in the official \href{http://nglviewer.org/ngl/api/}{NGL.js} manual.
#'@return List of representation parameters to \code{NGLVieweR} \code{htmlwidgets} object.
#'@seealso
#'* [addSelection()]
#'* [NGLVieweR_example()] See example "basic".
Expand Down Expand Up @@ -331,6 +333,7 @@ addRepresentation <- function(NGLVieweR, type, param = list()) {
#'Set rock animation
#'@param NGLVieweR A NGLVieweR object.
#'@param rock If \code{TRUE} (default), start rocking and stop spinning.
#'@return setRock parameter to \code{TRUE} or \code{FALSE} in \code{NGLVieweR} \code{htmlwidgets} object.
#'@family animations
#'@seealso
#'* [setSpin()]
Expand All @@ -352,6 +355,7 @@ setRock <- function(NGLVieweR, rock = TRUE) {
#'Set Spin animation
#'@param NGLVieweR A NGLVieweR object.
#'@param spin If \code{TRUE} (default), start spinning and stop rocking
#'@return setSpin parameter to \code{TRUE} or \code{FALSE} in \code{NGLVieweR} \code{htmlwidgets} object.
#'@family animations
#'@seealso
#'* [setRock()]
Expand All @@ -373,6 +377,7 @@ setSpin <- function(NGLVieweR, spin = TRUE) {
#'Set Quality
#'@param NGLVieweR A NGLVieweR object.
#'@param quality Set rendering quality. Can be "low", "medium" (default) or "high".
#'@return setQuality parameter in \code{NGLVieweR} \code{htmlwidgets} object.
#'@family options
#'@examples
#'NGLVieweR("7CID") %>%
Expand All @@ -390,6 +395,7 @@ setQuality <- function(NGLVieweR, quality = "medium") {
#'Set Focus
#'@param NGLVieweR A NGLVieweR object.
#'@param focus Set focus between 0 (default) to 100.
#'@return setFocus parameter in \code{NGLVieweR} \code{htmlwidgets} object.
#'@seealso [updateFocus()]
#'@family options
#'@examples
Expand All @@ -413,6 +419,7 @@ setFocus <- function(NGLVieweR, focus = 0) {
#'See the section "selection-language" in the official \href{https://nglviewer.org/}{NGL.js} manual.
#'@param duration Optional animation time in milliseconds (default = 0).
#'@param z_offSet Optional zoom offset value (default = 0).
#'@return List of zoomMove parameters to \code{NGLVieweR} \code{htmlwidgets} object.
#'@family animations
#'@examples
#'NGLVieweR("7CID") %>%
Expand Down
28 changes: 28 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
# Round 3

## Test environments
- local R installation, R 4.0.4
- ubuntu 16.04 (on travis-ci), R 4.0.4
- win-builder (devel)

## Submission comments
- Provided \\value to remaining functions

## Reviewer comments

- Please add \\value to .Rd files regarding exported methods and explain
the functions results in the documentation. Please write about the
structure of the output (class) and also what the output means. (If a
function does not return a value, please document that too, e.g.
\\value{No return value, called for side effects} or similar)
Missing Rd-tags:
addRepresentation.Rd: \\value
setFocus.Rd: \\value
setQuality.Rd: \\value
setRock.Rd: \\value
setSpin.Rd: \\value
stageParameters.Rd: \\value
zoomMove.Rd: \\value

# Round 2
26.05.21

## Test environments
- local R installation, R 4.0.4
- ubuntu 16.04 (on travis-ci), R 4.0.4
Expand Down
5 changes: 4 additions & 1 deletion man/addRepresentation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/setFocus.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/setQuality.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/setRock.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/setSpin.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/stageParameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/zoomMove.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/NGLVieweR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ NGLVieweR("7CID") %>%

## Labels

Labels can be addded by setting the `addRepresentation()` type parameter to "label". For a full list of of options, see the LabelRepresentationParameters section in the [NGL.js](http://nglviewer.org/ngl/api/) manual. Also see the "label" tab in the [demo](https://niels-van-der-velden.shinyapps.io/shinyNGLVieweR/) app for possible label settings.
Labels can be added by setting the `addRepresentation()` type parameter to "label". For a full list of of options, see the LabelRepresentationParameters section in the [NGL.js](http://nglviewer.org/ngl/api/) manual. Also see the "label" tab in the [demo](https://niels-van-der-velden.shinyapps.io/shinyNGLVieweR/) app for possible label settings.

```{r labels, screenshot.force=FALSE}
NGLVieweR("7CID") %>%
Expand Down

0 comments on commit 79a287d

Please sign in to comment.