Skip to content

Interface: EdgeGeometry

Defined in: api/geometry.ts:132

Per-edge geometry extracted after spline routing, in points.

points concatenates all bezier control points from the edge spline, in order. An edge with no routed spline produces an empty points array. label is present only when the edge carries a centre label.

tailLabel/headLabel are the taillabel/headlabel port labels. They are present only once the layout has actually placed them (C lp->set), which is the same gate render() applies before emitting the <text>: a declared port label that place_portlabel skipped (no spline, IGNORED edge type) still holds calloc-zero coordinates, so it is reported as absent rather than as a label at the origin.

xlabel is the xlabel external label, positioned by the force-placement search rather than by spline midpoint arithmetic, so it is not derivable from label or points. It carries the same lp->set gate: a declared xlabel the search could not fit is reported as absent, exactly as render() declines to draw it.

sp/ep are the arrow attachment points. When an end carries an arrow the spline is shortened to leave room for it, and the arrow spans from the terminal control point out to this point — so a consumer drawing its own arrowheads reads the tip here instead of extrapolating one. Each is present only when that end actually has an arrow (C sflag/eflag); with no arrow the field holds the calloc-zero point, which is not geometry.

These are the attachment points on the node boundary, verbatim from the bezier — with arrowhead=none the spline simply ends there. Graphviz's own renderer insets the arrow polygon it draws by a penwidth-dependent amount (measured: ~1.5pt at penwidth=1, ~6.2pt at penwidth=5), so ep is the point to draw an arrow to, not a copy of the rendered polygon's tip.

See

  • lib/common/types.h:ED_spl, ED_label, ED_tail_label, ED_head_label, ED_xlabel
  • lib/common/types.h:bezier (sflag/eflag, sp/ep)

Properties

ep?

ts
optional ep?: {
  x: number;
  y: number;
};

Defined in: api/geometry.ts:146

Arrow attachment point at the head end, if that end carries an arrow.

x

ts
x: number;

y

ts
y: number;

See

lib/common/types.h:bezier.ep


ts
head: string;

Defined in: api/geometry.ts:134


headLabel?

ts
optional headLabel?: {
  x: number;
  y: number;
};

Defined in: api/geometry.ts:158

headlabel position, if placed.

x

ts
x: number;

y

ts
y: number;

See

lib/common/types.h:ED_head_label


label?

ts
optional label?: {
  x: number;
  y: number;
};

Defined in: api/geometry.ts:148

Centre edge label position, if present.

x

ts
x: number;

y

ts
y: number;

See

lib/common/types.h:ED_label


points

ts
points: {
  x: number;
  y: number;
}[];

Defined in: api/geometry.ts:136

Bezier control points for the edge spline, in points.

x

ts
x: number;

y

ts
y: number;

sp?

ts
optional sp?: {
  x: number;
  y: number;
};

Defined in: api/geometry.ts:141

Arrow attachment point at the tail end, if that end carries an arrow.

x

ts
x: number;

y

ts
y: number;

See

lib/common/types.h:bezier.sp


tail

ts
tail: string;

Defined in: api/geometry.ts:133


tailLabel?

ts
optional tailLabel?: {
  x: number;
  y: number;
};

Defined in: api/geometry.ts:153

taillabel position, if placed.

x

ts
x: number;

y

ts
y: number;

See

lib/common/types.h:ED_tail_label


xlabel?

ts
optional xlabel?: {
  x: number;
  y: number;
};

Defined in: api/geometry.ts:163

xlabel (external label) position, if placed.

x

ts
x: number;

y

ts
y: number;

See

lib/common/types.h:ED_xlabel