Skip to contents

A materialized grid of predictions z = f(x, y), independent of the model that produced them. Corresponds to ECharts-GL SurfaceSeries in src/chart/surface/SurfaceSeries.js. The grid uses flat color shading and no wireframe, matching the rtemislive surface contract. Each grid rectangle is split along ECharts-GL's top-left to bottom-right diagonal. Missing z values remove every adjacent rectangle; they are not interpolated.

Usage

SurfaceLayer(
  x = c(0, 1),
  y = c(0, 1),
  z = NULL,
  name = "Surface",
  color = "#6ca3a0",
  opacity = 0.35
)

Arguments

x, y

Numeric: Finite, distinct grid coordinates, at least two per axis.

z

Numeric matrix: Predictions, with x along rows and y along columns. NA removes adjacent cells. At least one complete grid cell is required.

name

Character: Legend label; matching names link legend selection.

color

Character: Surface fill color.

opacity

Numeric [0, 1]: Surface opacity.

Value

SurfaceLayer: Validated prediction grid.

Details

Coordinates are sorted together with the prediction matrix. SVG export uses the configured orthographic camera and splits intersecting polygons to order visible surfaces, paths and points. Dense or highly intersecting surfaces may require a coarser prediction grid for practical vector output.

Examples

SurfaceLayer(x = 0:2, y = 0:2, z = outer(0:2, 0:2, `+`))
#> <rtemis.draw::SurfaceLayer>
#>  @ x      : int [1:3] 0 1 2
#>  @ y      : int [1:3] 0 1 2
#>  @ z      : int [1:3, 1:3] 0 1 2 1 2 3 2 3 4
#>  @ name   : chr "Surface"
#>  @ color  : chr "#6ca3a0"
#>  @ opacity: num 0.35