Line
| Property | Default | Meaning |
|---|---|---|
from | [0, 0] | Segment start in the selected coordinate space |
to | [1, 1] | Segment end in the selected coordinate space |
space | Automatic | Use ambient data coordinates when available; otherwise local geometry |
Line draws one segment from from to to, each an { x, y } or [x, y] pair of lengths.
The defaults are [0, 0] and [1, 1] in the selected coordinate space.
Outside a coordinate context, these describe the diagonal of its own allocated
rectangle. Local fractions use that rectangle's width and height.
Line always disables fill. It otherwise inherits stroke color, width, and cap style; caps may be butt, round, or square. Stroke width is px, em, or a fraction of the shorter allocated side. An explicit px width is useful for very shallow or zero-height lines.
Endpoints do not determine the element's layout size. A small diagonal in a large allocation still takes up the full allocation, and points can extend outside it. Set dimensions explicitly for a predictable rule or connector. Use Arrow for arrowheads or Network and Edge for connections between named elements.
Inside Graph, Plot, or GeoMap, both
numeric endpoints use the ambient coordinates automatically. Set space="local"
for a local decoration, or space="data" to require a coordinate context.
Existing graph drawings that relied on the old local default need space="local".
These endpoints are longitude/latitude in degrees. The segment stays straight
between the projected endpoints; use a sampled Polyline for a
curved route. If either endpoint is hidden by the projection, the line is omitted.
No coordinate context is an error for space="data". Numeric endpoints contribute
to ordinary Graph/Plot limit inference; custom projections still need explicit
output limits. Tagged px/em/% pairs remain local, and a custom projection rejects
pairs mixing a data number with a tagged length. Stroke lengths retain their
ordinary layout meaning. See Projections.
Data inputs may use arbitrary numeric records, including {theta, r} and
{x, y, z}, when the enclosing projection interprets those names.