Skip to content

visualizer (deferred): high-fidelity render engine behind the emitter #308

Description

@joshua-temple

Problem

Mermaid is ideal for GitHub-native rendering but limited for high-fidelity output (precise
layout, SVG/PNG export, richer styling). This builds on the shipped Mermaid rendering to add
a more robust render engine for high-fidelity SVG/PNG, using crucible's render engine as a
reference (crucible/cmd/crucible/internal/render emits source under a Theme and renders
to SVG).

Why this is cheap to add

The emit layer is pluggable from issue 2: the robust engine is another Emitter behind
the same interface, consuming the same view model and the same Theme (issue 5). No
view-model or command rework is required - only a new emitter and a new --format value.
This is the payoff of building the seam up front, and the Mermaid path is already shipped.

Engine choice

Evaluate candidate approaches and select one during implementation; no maintainer
pre-decision is required. Evaluate crucible's approach and its alternatives when the work is
picked up, and record the choice in the PR. This does not commit to graphviz up front.

MVP-first structure

  1. Land an MVP high-fidelity render behind a new Emitter and a new --format value,
    selectable alongside the shipped Mermaid path.
  2. Confirm the MVP against golden fixtures and document it.
  3. Extend the MVP to full high fidelity (precise layout, richer styling, PNG export) after
    the MVP is confirmed.

Scope

  • A second Emitter producing the high-fidelity format, selected via a new --format
    value wired into issue 3's validation.
  • Reuse the existing Theme.

Tests (TDD)

  • The MVP emitter is selectable via --format and produces valid output for the same
    fixtures used by the Mermaid goldens, covered by golden/unit tests.
  • The Mermaid path is unaffected (regression guard on existing goldens).
  • The high-fidelity extension is covered by golden/unit tests once the MVP is confirmed.

Acceptance

  • An MVP high-fidelity render is selectable via --format, additive to Mermaid, with no
    change to the view model or command structure, and is covered by golden/unit tests and
    documented.
  • The full high-fidelity extension follows after the MVP is confirmed, under the same seam.

Dependencies

#301 (the pluggable emitter). Builds on the shipped Mermaid rendering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions