feat: complete usecase diagram integration & validation#7530
feat: complete usecase diagram integration & validation#7530Sudhanshu-Ambastha wants to merge 31 commits intomermaid-js:developfrom
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 46dee6f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #7530 +/- ##
==========================================
- Coverage 3.34% 3.31% -0.04%
==========================================
Files 524 531 +7
Lines 55256 56311 +1055
Branches 795 805 +10
==========================================
+ Hits 1850 1864 +14
- Misses 53406 54447 +1041
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Hi @rolivencia, @knsv, |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|

📑 Summary
Implements a dedicated Use Case Diagram renderer for Mermaid (
usecaseDiagram), resolving the approved diagram request and addressing the curved path routing issue for include/extend relationships within system boundaries.The implementation follows UML 2.x standards for correct element shapes, relationship types, and layout conventions.
Resolves #7414
Also closes #4628
📏 Design Decisions
usecaseDb.ts) — A text-based parser readsusecaseDiagramsyntax directly.actor,usecase,system {}boundary,external,collaboration,note, and 9 relationship types.log.warnhint instead of causing runtime failures.usecaseRenderer.ts) — D3-based SVG renderer aligned with Mermaid’s rendering architecture.config.yaml) — IntroducesUsecaseDiagramConfiginto the global Mermaid configuration schema.usecaseStyles.ts) — Uses standard Mermaid theme variables (primaryColor,lineColor, etc.).styles.spec.ts) — Adds automated tests (Vitest) to ensure consistent rendering across default themes.usecaseDetector.ts) — Activates onusecaseDiagramoruseCasekeywords at the start of input.Example Syntax
usecaseDiagram actor "Customer" as C actor "Technician" as T external "Bank Server" as S system "ATM System" { usecase "Withdraw Cash" as UC1 usecase "Check Balance" as UC2 usecase "Login" as UC3 } note "Requires PIN" as N1 C --> UC1; UC2 T --> UC3 include: UC1 --> UC3 dependency: UC1 --> S generalization: T --> C anchor: N1 --> UC3📝 Notes for Reviewers
Relationship Rules
usecaseDb.ts(ALLOWEDtable)Invalid Relationships
log.warnhint for easier debuggingRendering
Known Issue
📋 Tasks
pnpm changeset