The link mark draws straight lines between two points [x1, y1] and [x2, y2] in quantitative dimensions. It is similar to the arrow mark, except it draws a straight line — or geodesic when used with a spherical projection.
For example, the chart below shows the rising inequality (and population) in various U.S. cities from 1980 to 2015. Each link represents two observations of a city: the city’s population (x) and inequality (y) in 1980, and the same in 2015. The link’s stroke redundantly encodes the change in inequality: red indicates rising inequality, while blue (there are only four) indicates declining inequality.
With a spherical projection and the default auto curve, the link mark will render a geodesic: the shortest path between two points on the surface of the sphere. Setting the curve to linear will instead draw a straight line between the projected points. For example, below we draw two links from San Francisco to Paris.
Like a rule, a link can also serve as annotation. Whereas a rule is strictly horizontal or vertical, however, a link can generate diagonal lines. The following chart depicts the gender gap in wages, segmented by education and age, in the U.S. A regular grid would make the gender disparity much less clear, even with the domains explicitly set to be equal.
x1 - the starting horizontal position; bound to the x scale
y1 - the starting vertical position; bound to the y scale
x2 - the ending horizontal position; bound to the x scale
y2 - the ending vertical position; bound to the y scale
For vertical or horizontal links, the x option can be specified as shorthand for x1 and x2, and the y option can be specified as shorthand for y1 and y2, respectively.
The link mark supports the standard mark options. The stroke defaults to currentColor. The fill defaults to none. The strokeWidth and strokeMiterlimit default to one.
The link mark supports curve options to control interpolation between points, and marker options to add a marker (such as a dot or an arrowhead) on each of the control points. Since a link always has two points by definition, only the following curves (or a custom curve) are recommended: linear, step, step-after, step-before, bump-x, or bump-y. Note that the linear curve is incapable of showing a fill since a straight line has zero area. For a curved link, you can use a bent arrow (with no arrowhead, if desired).