[Feature]: View Mermaid diagrams in documents full size, with zoom, and download them

Open
#830 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@adrianrobinson42 is already working on this.

Since Nov 20, 2026.

  • #831 by @adrianrobinson42 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
15/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
frontend

Research direction

The diagram rendering lives in ArtifactMarkdown.tsx, where Mermaid's useMaxWidth setting and the .mermaid-diagram svg { max-width: 100% } CSS rule shrink wide diagrams. The work is already in progress as PR #831, stacked on #828, so review that branch rather than starting fresh. Done means a full-size dialog with zoom, pan and fit controls, plus a Download SVG button that keeps the diagram's background.

Written by the indexing model from the issue text.

Description

area/frontend good first issue topic/knowledge
Description

Diagrams in generated documents are often too small to read in the document preview, even in the preview overlay. I'd like a way to see a diagram at full size and zoom in on it, and to download it.

The cause is that Mermaid draws each diagram at its natural size but limits it to its container's width (useMaxWidth), and the app's CSS does the same (.mermaid-diagram svg { max-width: 100% }). A wide left-to-right flowchart is therefore scaled down to a fraction of its size in an ordinary panel.

Use case

A generated architecture document has a component diagram with a dozen nodes in a row. In the preview it's a thin strip whose labels can't be read, and the preview overlay only makes it a little bigger. Reviewers want to read the diagram, zoom into one part of it, or download it to share and view elsewhere.

Area

Frontend (web application)

Additional context

I have this working and will raise a PR, stacked on the fix for #828 because both touch ArtifactMarkdown.tsx. It adds two buttons to each rendered Mermaid diagram:

  • View full size: a dialog at the diagram's own size, with zoom buttons, keyboard zoom, Ctrl or Command with the scroll wheel, fit to window, and drag to pan.
  • Download SVG: a standalone SVG on the background the diagram was drawn on.

It needs no new dependencies.

Dominant language
JavaScript
Stars
128
Forks
62
Avg merge
3d 16h
Merged PRs (30d)
102

Getting set up

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.

More from aws-samples/sample-collaborative-ai-dlc

All issues in aws-samples/sample-collaborative-ai-dlc

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.