Skip to contents

Coordinates and optional interval bounds for a fitted curve, independent of the model or language that produced it. Uses LineSeriesOption and CustomSeriesOption in ECharts src/chart/line and src/chart/custom. Rows are sorted together by x. Missing predictions must be removed before construction; use separate layers for disconnected intervals. No fitting is performed here.

Usage

FitLayer(
  x = c(0, 1),
  y = c(0, 1),
  lower = NULL,
  upper = NULL,
  name = "Fit",
  color = "#6ca3a0",
  line_width = 2,
  opacity = 0.2,
  x_axis = 0L,
  y_axis = 0L
)

Arguments

x, y

Numeric: Finite curve coordinates with distinct x values.

lower, upper

Optional Numeric: Paired finite interval bounds at every x.

name

Character: Legend label; a matching observation label links selection.

color

Character: Curve and interval color.

line_width

Numeric (0, Inf): Curve width in pixels.

opacity

Numeric [0, 1]: Interval opacity.

x_axis, y_axis

Integer [0, Inf): Zero-based axis indices.

Value

FitLayer: Validated, serializable prediction geometry.

Examples

FitLayer(x = 1:3, y = c(2, 4, 5), lower = c(1, 3, 4), upper = c(3, 5, 6))
#> <rtemis.draw::FitLayer>
#>  @ x         : int [1:3] 1 2 3
#>  @ y         : num [1:3] 2 4 5
#>  @ lower     : num [1:3] 1 3 4
#>  @ upper     : num [1:3] 3 5 6
#>  @ name      : chr "Fit"
#>  @ color     : chr "#6ca3a0"
#>  @ line_width: num 2
#>  @ opacity   : num 0.2
#>  @ x_axis    : int 0
#>  @ y_axis    : int 0