svg_path/arrangement_graph/drawing
SVG drawing helpers for arrangement graphs and their source paths.
Types
Proportional sizing for an annotated arrangement-graph drawing.
pub type AnnotatedDrawingOptions {
AnnotatedDrawingOptions(scale: Float)
}
Constructors
-
AnnotatedDrawingOptions(scale: Float)
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 annotated_drawing_with(
graph: arrangement_graph.ArrangementGraph,
source: svg_path.Path,
tolerance tolerance: Float,
options options: AnnotatedDrawingOptions,
) -> Result(List(svg.ThingToDraw), arrangement_graph.Error)
Draw an arrangement graph with proportional control over its visual scale.
pub fn default_annotated_drawing_options() -> AnnotatedDrawingOptions
Default sizing for an annotated arrangement-graph drawing.
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 path_direction_arrows_with(
path: svg_path.Path,
color: String,
length_scale length_scale: Float,
width_scale width_scale: Float,
arrival_offset arrival_offset: Float,
opacity opacity: Float,
) -> List(svg.ThingToDraw)
Draw independently scaled 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.
pub fn segment_direction_arrow_with(
segment: svg_path.Segment,
color: String,
length_scale length_scale: Float,
width_scale width_scale: Float,
arrival_offset arrival_offset: Float,
opacity opacity: Float,
) -> Result(svg.ThingToDraw, Nil)
Draw one arrowhead whose tip is the head of a segment.
Length and width are scaled independently from the default dimensions.