terror / terror/dotgraph

SVG rendering

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The SVG renderer walks a fully laid-out `IrGraph` and emits an SVG document as a string. SVG is generated directly as XML text using a small writer helper for indentation and escaping, with no external SVG library.

The rendering order is: compute the total bounding box from all node positions, edge points, and cluster boxes, adding margin from the `pad` attribute (default 4pt); emit the `` root with a `viewBox`; render clusters as `` elements with a background rectangle and label; render edges as `` elements (polyline or cubic Bezier) with inline arrowhead polygons; render nodes as `` elements containing the shape and a `` label. Multi-line labels using Graphviz's `\n`, `\l`, and `\r` escape sequences are split into multiple `` elements with explicit `dy` offsets. The `color`, `fillcolor`, `fontcolor`, `fontsize`, `fontname`, `bgcolor`, `margin`, and `pad` attributes are all resolved during rendering.

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the IrGraph representation and the SVG renderer's writer entry point described in the issue. Confirm how layout positions, edge points, cluster boxes, and rendering attributes are exposed. Done means producing valid SVG with the stated viewBox, clusters, edges, nodes, escaped multiline labels, resolved styling, and padding.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.