Skip to contents

Uses ECharts-GL Scatter3DSeries, Grid3DModel, Cartesian3D, and OrbitControl. Coordinates are independently scaled to equal box dimensions. Perspective projection scales coordinates by camera depth; orthographic projection keeps parallel lines parallel. Exported point positions match the configured browser view. Browser rotation/zoom is interactive; saving the R widget exports its configured initial camera.

Usage

Scatter3DConfig(
  dat_path = NULL,
  title = NULL,
  origin = NULL,
  writer = NULL,
  x = NULL,
  y = NULL,
  z = NULL,
  group = NULL,
  alpha = 20,
  beta = 40,
  projection = "perspective",
  distance = 250,
  view_size = 190,
  point_size = 8,
  opacity = NULL,
  mode = "points",
  order = "input",
  line_width = 2,
  xlab = NULL,
  ylab = NULL,
  zlab = NULL,
  palette = NULL,
  fit = NULL,
  fit_params = NULL,
  n_fit = 25L,
  fit_alpha = 0.35
)

Arguments

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

title

Optional Character: Chart title. Declared here because it is the one property every chart type has; palette is not (four take a colormap instead), and axis labels and margins are cartesian-only.

origin

Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it.

writer

Optional Named character: Which interface wrote the config, as name and version. Absent on an authored config.

x, y, z

Optional Character: Numeric coordinate column bindings.

group

Optional Character: Group column binding.

alpha

Numeric [-80, 80]: Camera elevation in degrees.

beta

Numeric [-180, 180]: Camera azimuth in degrees.

projection

Character {"perspective", "orthographic"}: Camera projection.

distance

Numeric [100, 400]: Perspective camera distance from the center of the 100-unit cube. Narrow and portrait layouts increase the distance to preserve space for axes.

view_size

Numeric [175, 400]: Orthographic viewing extent for a 100-unit cube.

point_size

Numeric (0, 100]: Marker diameter in pixels.

opacity

Optional Numeric [0, 1]: Point and line opacity. NULL sets it from the number of complete observations, as in draw_scatter()'s point_alpha, and draws paths alone (mode = "lines") opaque.

mode

Character c("points", "lines", "both"): Geometry to draw.

order

Character c("input", "x"): Order within complete path runs. Missing coordinates break paths; sorting never joins across those breaks.

line_width

Numeric (0, 100]: Path width in pixels.

xlab, ylab, zlab

Optional Character: Axis names.

palette

Optional Character: Group colors.

fit

Optional Character: Model of z on x and y drawn as a surface per group: "glm", "gam", or an rtemis supervised learning algorithm name such as "LINAD", which requires the rtemis package (>= 1.4.1). See draw_scatter(). NULL draws no surface.

fit_params

Optional Named list: Arguments passed to the learner named in fit. See draw_scatter().

n_fit

Integer [2, Inf): Grid points per axis for fitted surfaces.

fit_alpha

Numeric [0, 1]: Opacity of fitted surfaces.

Value

Scatter3DConfig: Validated portable settings.

Examples

setup_Scatter3DConfig(x = "Sepal.Length", y = "Sepal.Width", z = "Petal.Length")
#> <rtemis.draw::Scatter3DConfig>
#>  @ type      : chr "scatter3d"
#>  @ dat_path  : NULL
#>  @ title     : NULL
#>  @ origin    : Named chr [1:24] "default" "default" "user" "user" "user" "default" ...
#>  .. - attr(*, "names")= chr [1:24] "dat_path" "title" "x" "y" ...
#>  @ writer    : NULL
#>  @ x         : chr "Sepal.Length"
#>  @ y         : chr "Sepal.Width"
#>  @ z         : chr "Petal.Length"
#>  @ group     : NULL
#>  @ alpha     : num 20
#>  @ beta      : num 40
#>  @ projection: chr "perspective"
#>  @ distance  : num 250
#>  @ view_size : num 190
#>  @ point_size: num 8
#>  @ opacity   : NULL
#>  @ mode      : chr "points"
#>  @ order     : chr "input"
#>  @ line_width: num 2
#>  @ xlab      : NULL
#>  @ ylab      : NULL
#>  @ zlab      : NULL
#>  @ palette   : NULL
#>  @ fit       : NULL
#>  @ fit_params: NULL
#>  @ n_fit     : int 25
#>  @ fit_alpha : num 0.35