surface
A function of the plane, shaded; in space, the surface itself.
surfacexyargandpolarxyzplane

#On a flat plane
On a flat plane a surface paints a function of the plane over the visible window, surface(f: x^2 - y^2), sampled again as the reader pans. Its letters are the plane's coordinates, x and y (or r and theta on the polar plane), and any other letter is a parameter. On the argand plane it is a function of z, coloured by domain under the default ramp.
colour is a ramp, a hue or a list of stops: multicolour, the default, runs violet at the lowest value to red at the highest; temperature runs blue through white to red; a hue shades from bare to full; teal, yellow, red runs through its stops, low end first. The ramp spans the values in the window, and moves as a parameter does; #self.value applied to an interval and a ramp pins it, colour: #self.value -> -1..1 -> temperature, and with temperature a symmetric window puts white at 0. invert flips it. A contour of the same expression draws its level sets over the wash, and keeps the expression written once.


graph{
surface(expression: sin(x) * cos(y); colour: temperature)
contour(expression: sin(x) * cos(y); levels: 0; colour: grey)
}A heatmap is a grid of cells holding the values given; a surface is a function sampled everywhere in the window. An equation is a surface only in space; on a flat plane, surface(f: x^2 + y^2 = 4) is refused: 'surface' as an equation is an implicit surface, in space on graph:xyz — on the xy plane it is a value over the plane: 'surface: x^2 - y^2'.
#In space
In space a surface is the surface itself: a height, surface(f: 16 - x^2 - y^2), or an equation in x, y and z, surface(f: x^2 + y^2 + z^2 = 9). Its faces are shaded by how they meet the light, in one blue unless colour says otherwise; a ramp colours it by height, across the box's z domain or the window #self.value -> lo..hi -> ramp pins. One linear in x, y and z is a plane, drawn exactly where it crosses the box, green and translucent unless told otherwise, and cutting cleanly through any surface it meets: surface(f: 4x + 2y - 3) is a tangent plane, surface(f: x = 1) a vertical slice. mesh draws the hairlines over a height's faces, resolution sets the cells along each side, and label, which only space takes, sets words at the surface's highest point.
#Attributes
expressionsurface(f: x^2 - y^2); on the argand plane, a function of z, domain coloured. In space, a height, surface(f: 16 - x^2 - y^2), or an equation in x, y and z, meshed where its two sides agree: surface(f: x^2 + y^2 + z^2 = 9). An equation is a surface only in space.exp, f, func, function, equation, eqCan be written as shorthand: surface:valuemeshtrueresolutioninvertfalsecolour#self.value pins the window, values outside it taking the ramp's ends: colour: #self.value -> -1..1 -> temperature puts white at zero.value-colour-stylecoloropacitylabelhiddenhidden: true !cue.to{false}(at: 2) is its reveal.falselocklockedfalselayergroupgroup: Early sown, Projected. It is drawn in the colour of the first that has one and the style of the first the graph's key: gives one, unless it writes its own colour: or style, and the footer's key names every group.#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
valuecolour: follows as #self.value: colour: #self.value -> -1..1 -> temperature pins the window the ramp spans.min{{#id.min}}.max#Allowed in
#Examples


graph{
surface(expression: x^2 + y^2)
}

graph{
surface(expression: (x - 2)^2 + (y - 3)^2; colour: red; invert: true)
}

graph{
surface(expression: {{sse}}; opacity: 0.5)
contour(expression: {{sse}}; levels: 1, 2, 4, 8, 16)
}

graph:xyz{
surface(expression: 4 - x^2 - y^2)
}(
x domain: [-2, 2]
y domain: [-2, 2]
z domain: [-4, 4]
axis position: edges
)

graph:xyz{
surface(f: x^2 + y^2 + z^2 = 4; colour: purple)
}(
x domain: [-2.5, 2.5]
y domain: [-2.5, 2.5]
z domain: [-2.5, 2.5]
aspect: equal
)

graph:xyz{
surface(expression: 2 * x^2 + y^2)
surface(expression: 4x + 2y - 3)
point(x: 1; y: 1; z: 3; label: $P$)
}(
x domain: [-2, 2]
y domain: [-2, 2]
z domain: [0, 12]
view: (35, 25)
)

graph:xyz{
surface(f: x + 2y + 3z = 6)
surface(f: x = 1; colour: orange)
}(
x domain: [-3, 3]
y domain: [-3, 3]
z domain: [-3, 3]
)