svg_path/arrangement_graph/drawing
SVG drawing helpers for arrangement graphs and their source paths.
Types
Placement of an edge annotation derived from the stored segment itself.
rotation is an SVG rotation angle for which the annotation’s local up
direction follows the segment tangent.
pub type EdgeAnnotationPose {
EdgeAnnotationPose(point: svg_path.Point, rotation: Float)
}
Constructors
-
EdgeAnnotationPose(point: svg_path.Point, rotation: Float)
Values
pub fn annotated_drawing(
graph: arrangement_graph.ArrangementGraph,
source: svg_path.Path,
tolerance tolerance: Float,
) -> Result(List(svg.ThingToDraw), arrangement_graph.Error)
Draw an arrangement graph using the shared Boolean-debug style.
Each tangent-oriented cartouche shows global winding immediately to the left/right of the edge in black, with forward/reverse multiplicity below in red. Red arrowheads show the stored forward direction. Vertices use the established white-circle/red-outline style. Cartouches are sized per edge and never exceed 80% of the chord remaining between its endpoint nodes.
pub fn drawing(
graph: arrangement_graph.ArrangementGraph,
) -> List(svg.ThingToDraw)
Draw edges, clustered vertices, vertex ids, and directional multiplicities.
pub fn edge_annotation_pose(
edge: arrangement_graph.ArrangementEdge,
) -> Result(EdgeAnnotationPose, svg_path.Error)
Return the midpoint and tangent-aligned orientation for an edge annotation.
pub fn path_direction_arrows(
path: svg_path.Path,
color: String,
) -> List(svg.ThingToDraw)
Draw endpoint arrowheads for every segment of a path.
pub fn segment_direction_arrow(
segment: svg_path.Segment,
color: String,
) -> Result(svg.ThingToDraw, Nil)
Draw one arrowhead whose tip is the head of a segment.