svg_path/arrangement/drawing

SVG drawing helpers for arrangement graphs and their source paths.

Types

Proportional sizing for an annotated arrangement-graph drawing.

scale is a trusting drawing input and must be finite and greater than zero. Drawing helpers do not validate it.

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

Values

pub fn annotated_drawing(
  graph: arrangement.ArrangementGraph,
  source: svg_path.Path,
  tolerance tolerance: Float,
) -> Result(List(svg.ThingToDraw), arrangement.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.ArrangementGraph,
  source: svg_path.Path,
  tolerance tolerance: Float,
  options options: AnnotatedDrawingOptions,
) -> Result(List(svg.ThingToDraw), arrangement.Error)

Draw an arrangement graph with proportional control over its visual scale.

options.scale must be finite and greater than zero.

pub fn default_annotated_drawing_options() -> AnnotatedDrawingOptions

Default sizing for an annotated arrangement-graph drawing.

pub fn drawing(
  graph: arrangement.ArrangementGraph,
) -> List(svg.ThingToDraw)

Draw edges, clustered vertices, vertex ids, and directional multiplicities.

Search Document