setFocus: Set Focus

View source: R/NGLVieweR.R

setFocusR Documentation

Set Focus

Description

Set Focus

Usage

setFocus(NGLVieweR, focus = 0)

Arguments

NGLVieweR

A NGLVieweR object.

focus

Set focus between 0 (default) to 100.

Details

The focus sets the clipping planes and the fog (the NGL.js stage parameters clipNear, clipFar, fogNear and fogFar). Without setFocus() the viewer uses the NGL.js defaults (with the default clipScale = "relative" these equal focus 0). Values of these four parameters given in stageParameters() win over setFocus().

Value

setFocus parameter in NGLVieweR htmlwidgets object.

See Also

updateFocus()

Other options: setQuality(), snapShot(), updateFocus(), updateFullscreen()

Examples

NGLVieweR("7CID") %>%
  addRepresentation("cartoon", 
  param=list(name="cartoon", colorValue="blue")) %>%
  setFocus(0)

NGLVieweR documentation built on Oct. 20, 2026, 1:07 a.m.