surface
The same surface a contour traces, shaded instead: one expression in x AND y, grid-sampled over the visible window and drawn as a continuous wash of the mark's hue — bare where the value is low, full where it is high. The two marks compose: a surface under a contour shades the field and traces its level sets over it, and keeps the shared expression written once. As with contour, y is the vertical axis, not a parameter. Not a heatmap, which is a grid of cells you hand the values to rather than a function sampled over the window.
surfacexyargandpolarplane

A surface paints a function of the plane. Its expression may use y alongside x, which only a surface and a contour allow. It takes a colour that is a single hue or a ramp — multicolour (the full spectrum) or temperature (blue through white to red) — and exposes derived min and max over the visible window. A contour of the same expression draws its level sets over it.
It is not a heatmap: a surface is sampled from an expression over the whole window, where a heatmap is a grid of cells you hand the values to.


canvas.graph{
surface(expression: sin(x) * cos(y); colour: temperature)
contour(expression: sin(x) * cos(y); at: 0; colour: grey)
}#Attributes
expressionexp, f, func, functionCan be written as shorthand: surface:valuerange[0, 40]; values outside clamp. Absent, the ramp spans the sampled extrema — which re-normalises as a parameter drags; an authored range holds still, exactly as an authored domain does.invertfalsecolourrange: to pin white at zero; any ordinary hue shades its own intensity ramp instead. Both ramps are fixed colours, identical in light and dark mode.blueredorangeyellowtealgreenpinkpurplegreyhex(…)rgb(…)multicolourtemperaturecolormulticolouropacity0.75hiddenhidden: true !cue.to{false}(at: 2) is its reveal.falselocklockedfalselayerz: before the argand plane took that letter for its coordinate.#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
min{{#id.min}}.max#Allowed in
#Examples
surface(expression: x*y; range: [-9, 9]; colour: temperature)surface(expression: x^2 + y^2)surface(expression: (x - 2)^2 + (y - 3)^2; colour: red; invert: true)surface(expression: {{sse}}; opacity: 0.5)
contour(expression: {{sse}}; at: 1, 2, 4, 8, 16)