vector
An arrow from a tail along a displacement.
vector

#Attributes
On any plane
dzZ component, in space only. There the tail is
x/y/z and the arrow is dx/dy/dz.colourColour.
paintAlso written:
colorDefault
greenwidthStroke width.
Default
2opacityOpacity.
Default
1styleHow the arrow is drawn:
solid, dashed or dotted. One value for the whole vector.soliddasheddottedDefault
solidlabelText drawn beside the element — rich text, so
$maths$ and inline formatting render. Fades and draws with the element.hiddenDeclared but not drawn. Animatable —
hidden: true !cue.to{false}(at: 2) reveals it — and unlike a cue, a hidden element still frames the plot, so the axes do not jump when it appears.Default
falselockKeeps the reader from editing this element on an
editable: graph. Nothing at all on a graph that is not editable.Also written:
lockedDefault
falsetext-sizeText size.
Default
20layerPaint order among the marks: a higher layer is drawn later, on top; equal or omitted, the marks stack in document order, later on top.
groupThe groups this mark belongs to, comma-separated:
group: 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.Only with
xplanedxX component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.Can be written as shorthand:
vector:valuedyY component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.xX coordinate of the tail. Defaults to 0, so a vector with only dx and dy starts at the origin.
Only with
xyplanedxX component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.Can be written as shorthand:
vector:valuedyY component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.xX coordinate of the tail. Defaults to 0, so a vector with only dx and dy starts at the origin.
yY coordinate of the tail. Defaults to 0.
Only with
argandplanezOn the argand plane, the number the arrow is — a complex expression (
3 + 2i, (1 + i)^2, e^(i * a), i the unit) drawn from the tail; dx and dy are not taken there. In space, the z coordinate of the tail.reOn the argand plane, the real part of the position, a number; with
im. z: gives both at once.imOn the argand plane, the imaginary part of the position, a number; with
re. z: gives both at once.Only with
polarplanedxX component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.Can be written as shorthand:
vector:valuedyY component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.rOn the polar plane, the distance from the origin; with
theta.thetaOn the polar plane, the angle anticlockwise from the right, in radians —
60deg writes it in degrees; with r. On a categorical theta (theta format:), a name.Only with
xyzplanedxX component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.Can be written as shorthand:
vector:valuedyY component. Cartesian on the ordinary and polar planes alike; on the argand plane the displacement is
z:.xX coordinate of the tail. Defaults to 0, so a vector with only dx and dy starts at the origin.
yY coordinate of the tail. Defaults to 0.
zOn the argand plane, the number the arrow is — a complex expression (
3 + 2i, (1 + i)^2, e^(i * a), i the unit) drawn from the tail; dx and dy are not taken there. In space, the z coordinate of the tail.#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
On any plane
lengthThe arrow's length from tail to head as drawn, in the plane's units (in space, the box's) — through the graph's
transform: where it has one; a dash where an axis is a log scale, names or dates.Only with
xyplaneangleThe arrow's direction, in degrees anticlockwise from the positive x axis, in [0, 360); a dash where
length is a dash, or for an arrow of no length.Only with
argandplaneangleThe arrow's direction, in degrees anticlockwise from the positive x axis, in [0, 360); a dash where
length is a dash, or for an arrow of no length.Only with
polarplaneangleThe arrow's direction, in degrees anticlockwise from the positive x axis, in [0, 360); a dash where
length is a dash, or for an arrow of no length.#Allowed in
#Examples


graph{
vector(x: 0; y: 0; dx: 3; dy: 2)
}(
x-domain: [-1, 4]
y-domain: [-1, 3]
)

graph{
vector(x: -1; y: -1; dx: 2; dy: 1; style: dashed)
}(
x-domain: [-2, 2]
y-domain: [-2, 1]
)

graph:xyz{
vector(dx: 2; dy: 0; dz: 0; label: $\mathbf{u}$)
vector(dx: 0; dy: 2; dz: 0; colour: blue; label: $\mathbf{v}$)
vector(dx: 0; dy: 0; dz: 2; colour: orange; label: $\mathbf{u} \times \mathbf{v}$)
surface(expression: 0; opacity: 0.2)
}(
x domain: [-1, 3]
y domain: [-1, 3]
z domain: [-1, 3]
aspect: equal
)#Notes
dxanddyare both required; in spacedx,dyanddzall are.