Skip to content

Commit 1263861

Browse files
committed
manual: update label-pos for relative lengths
1 parent bd3da90 commit 1263861

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

docs/manual.pdf

2.25 KB
Binary file not shown.

docs/manual.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ A label as an edge vertex is interpreted as the position of the node with that l
730730

731731

732732

733-
== Edge types
733+
== Edge types <edge-types>
734734

735735
There are three types of edges: `"line"`, `"arc"`, and `"poly"`.
736736
All edges have at least two `vertices`, but `"poly"` edges can have more.

src/edge.typ

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,12 @@
428428
/// - roughly above the connector, in the case of straight lines; or
429429
/// - on the outside of the curve, in the case of arcs.
430430
///
431-
/// - label-pos (number): Position of the label along the connector, from the
432-
/// start to end (from `0` to `1`).
431+
/// - label-pos (float, ratio, relative length): Position of the label along the
432+
/// edge, from the start to end.
433+
///
434+
/// A number or ratio between zero and one is interpreted as a fraction of the
435+
/// edge length. Physical and relative relative lengths work too. For example,
436+
/// `100% - 1em` means `1em` from the end.
433437
///
434438
/// #stack(
435439
/// dir: ltr,
@@ -440,6 +444,10 @@
440444
/// ),
441445
/// )
442446
///
447+
/// For `"poly"` edges (see @edge-types), a number does not specify a fraction
448+
/// of the path length; instead, the $k$th vertex is at position $k/n$ where
449+
/// $n$ is the number of vertices. Each midpoint is then at $k/n + 0.5$.
450+
///
443451
/// - label-sep (length): Separation between the connector and the label anchor.
444452
///
445453
/// With the default anchor (automatically set to `"south"` in this case):

0 commit comments

Comments
 (0)