Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7463c3c
feat(cynefin): add Cynefin framework diagram type
ragelink Mar 27, 2026
1c6ba87
fix(cynefin): fix item badge colors and arrow rendering
ragelink Mar 27, 2026
a505437
test(cynefin): add unit and integration tests (32 tests)
ragelink Mar 27, 2026
4a46bf1
merge: upstream/develop into feature/cynefin-diagram
ragelink Apr 10, 2026
ea1c48f
fix(cynefin): address review feedback (#7535)
ragelink Apr 10, 2026
1bb4012
Merge branch 'develop' into feature/cynefin-diagram
ragelink Apr 15, 2026
37ec643
Merge branch 'develop' into feature/cynefin-diagram
ragelink Apr 16, 2026
8a5dc95
fix(cynefin): address round 2 review feedback
ragelink Apr 16, 2026
17b8655
Merge remote-tracking branch 'origin/feature/cynefin-diagram' into fe…
ragelink Apr 16, 2026
dfa88d7
fix(cynefin): address round 3 review feedback
ragelink Apr 17, 2026
6bdff82
Merge branch 'develop' into feature/cynefin-diagram
ragelink Apr 17, 2026
98d6993
Merge branch 'develop' into feature/cynefin-diagram
ragelink Apr 21, 2026
42dab80
Merge branch 'develop' into feature/cynefin-diagram
ragelink Apr 22, 2026
950035d
Merge branch 'develop' into feature/cynefin-diagram
ragelink Apr 23, 2026
ab1c25a
Merge branch 'develop' into feature/cynefin-diagram
ragelink Apr 27, 2026
ff84234
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
ragelink Apr 27, 2026
100d8ce
fix(cynefin): align e2e folder layout and example id with CI checks
ragelink Apr 27, 2026
0323b90
refactor(cynefin): rename registered id and config key to 'cynefin'
ragelink Apr 27, 2026
584a42f
Merge remote-tracking branch 'origin/feature/cynefin-diagram' into fe…
ragelink Apr 28, 2026
241bd9a
fix(cynefin): correct cypress helpers import path after subfolder move
ragelink Apr 28, 2026
7871c55
Merge branch 'develop' into feature/cynefin-diagram
knsv Apr 29, 2026
48d65d0
Merge branch 'develop' into feature/cynefin-diagram
ragelink May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .build/jsonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const MERMAID_CONFIG_DIAGRAM_KEYS = [
'eventmodeling',
'radar',
'venn',
'cynefin',
] as const;

/**
Expand Down
24 changes: 24 additions & 0 deletions .changeset/add-cynefin-diagram.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'mermaid': minor
---

Add Cynefin framework diagram type (beta)

Adds the Cynefin framework as a new diagram type to Mermaid (available as `cynefin-beta`). The Cynefin framework, created by Dave Snowden, is a decision-making framework that categorizes problems into five complexity domains, widely used in agile, incident management, strategy, and organizational design.

Features:

- Five fixed domains in canonical layout: Complex, Complicated, Clear, Chaotic, and Confusion
- Wavy organic boundaries between domains using deterministic SVG bezier curves
- The "cliff" between Clear and Chaotic (catastrophic transition indicator)
- Confusion/Disorder center ellipse overlay
- Domain metadata including decision models (Probe/Sense/Respond etc.) and practice types
- Items placed as text badges within each domain
- Transition arrows between domains with optional labels
- Full theme integration across all five mermaid themes
- Schema-driven configuration: width, height, padding, showDomainDescriptions, boundaryAmplitude
- Accessibility: ARIA roles, labels, descriptions

This is the first text-based DSL for Cynefin diagrams in any diagramming tool.

Implementation includes Langium grammar, modular renderer, unit tests, integration tests, Cypress e2e tests, and comprehensive documentation.
1 change: 1 addition & 0 deletions .cspell/mermaid-terms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ catmull
compositTitleSize
cose
curv
cynefin
deaccelerator
Deaccelerator
deaccelerators
Expand Down
208 changes: 208 additions & 0 deletions cypress/integration/rendering/cynefin/cynefin.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
import { imgSnapshotTest } from '../../../helpers/util';

describe('cynefin framework', () => {
it('should render a simple cynefin diagram with all five domains', () => {
imgSnapshotTest(
`cynefin-beta
title Incident Response

complex
"Investigate root cause"
"Run chaos experiment"

complicated
"Analyze performance data"
"Expert review needed"

clear
"Restart service"
"Apply known fix"

chaotic
"Page on-call immediately"

confusion
"Unknown failure mode"
`
);
});

it('should render a cynefin diagram with transitions', () => {
imgSnapshotTest(
`cynefin-beta
title Strategy Categorization

complex
"Market research"

complicated
"Competitive analysis"

clear
"Standard pricing"

chaotic
"Crisis management"

complex --> complicated : "Pattern identified"
complicated --> clear : "Best practice codified"
clear --> chaotic : "Complacency"
chaotic --> complex : "Stabilized"
`
);
});

it('should render an empty cynefin framework', () => {
imgSnapshotTest(
`cynefin-beta
title Empty Framework

complex
complicated
clear
chaotic
`
);
});

it('should render cynefin with many items per domain', () => {
imgSnapshotTest(
`cynefin-beta
title Software Delivery

complex
"New product discovery"
"User behavior analysis"
"A/B testing strategy"

complicated
"Performance optimization"
"Security audit"
"Database migration"

clear
"Deploy to staging"
"Run test suite"
"Merge pull request"

chaotic
"Production outage"
"Data breach response"
`
);
});

it('should render cynefin with config override', () => {
imgSnapshotTest(
`cynefin-beta
complex
"Adaptive work"
clear
"Standard work"
`,
{ cynefin: { width: 1000, height: 700, boundaryAmplitude: 15 } }
);
});

it('should render cynefin without domain descriptions', () => {
imgSnapshotTest(
`cynefin-beta
title Minimal Labels

complex
"Item A"
clear
"Item B"
`,
{ cynefin: { showDomainDescriptions: false } }
);
});

it('should render cynefin with theme override', () => {
imgSnapshotTest(
`cynefin-beta
complex
"Test item"
clear
"Standard"
`,
{
theme: 'base',
themeVariables: {
cynefin: {
complexBg: '#FFE4B5',
clearBg: '#E6E6FA',
boundaryColor: '#FF0000',
},
},
}
);
});

it('should render cynefin with straight boundaries when amplitude is zero', () => {
imgSnapshotTest(
`cynefin-beta
title Straight Boundaries

complex
"Item A"
complicated
"Item B"
clear
"Item C"
chaotic
"Item D"
`,
{ cynefin: { boundaryAmplitude: 0 } }
);
});

it('should render cynefin with confusion domain items without overflow', () => {
imgSnapshotTest(
`cynefin-beta
title Confusion Items

confusion
"Unknown A"
"Unknown B"
"Unknown C"
"Unknown D"
"Unknown E"
`
);
});

it('should render cynefin with self-loop transitions silently dropped', () => {
imgSnapshotTest(
`cynefin-beta
title Self-loop Handling

complex
"Emergent work"
complicated
"Expert work"

complex --> complicated : "Pattern found"
complex --> complex : "Self-loop (dropped)"
`
);
});

it('should render cynefin with accessibility directives', () => {
imgSnapshotTest(
`cynefin-beta
accTitle: Cynefin framework for software delivery
accDescr: A Cynefin map categorizing software tasks by complexity domain

complex
"Feature discovery"
complicated
"Refactoring"
clear
"Hotfix"
chaotic
"Incident"
`
);
});
});
2 changes: 1 addition & 1 deletion docs/config/setup/defaultConfig/variables/configKeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

> `const` **configKeys**: `Set`<`string`>

Defined in: [packages/mermaid/src/defaultConfig.ts:311](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L311)
Defined in: [packages/mermaid/src/defaultConfig.ts:314](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L314)
18 changes: 13 additions & 5 deletions docs/config/setup/mermaid/interfaces/MermaidConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ Defined in: [packages/mermaid/src/config.type.ts:224](https://github.com/mermaid

---

### cynefin?

> `optional` **cynefin**: `CynefinDiagramConfig`

Defined in: [packages/mermaid/src/config.type.ts:245](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L245)

---

### darkMode?

> `optional` **darkMode**: `boolean`
Expand Down Expand Up @@ -105,7 +113,7 @@ You can set this attribute to base the seed on a static string.

> `optional` **dompurifyConfig**: `Config`

Defined in: [packages/mermaid/src/config.type.ts:245](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L245)
Defined in: [packages/mermaid/src/config.type.ts:246](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L246)

---

Expand Down Expand Up @@ -187,7 +195,7 @@ See <https://developer.mozilla.org/en-US/docs/Web/CSS/font-family>

> `optional` **fontSize**: `number`

Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L247)
Defined in: [packages/mermaid/src/config.type.ts:248](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L248)

---

Expand Down Expand Up @@ -313,7 +321,7 @@ Defines which main look to use for the diagram.

> `optional` **markdownAutoWrap**: `boolean`

Defined in: [packages/mermaid/src/config.type.ts:248](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L248)
Defined in: [packages/mermaid/src/config.type.ts:249](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L249)

---

Expand Down Expand Up @@ -445,7 +453,7 @@ Defined in: [packages/mermaid/src/config.type.ts:225](https://github.com/mermaid

> `optional` **suppressErrorRendering**: `boolean`

Defined in: [packages/mermaid/src/config.type.ts:254](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L254)
Defined in: [packages/mermaid/src/config.type.ts:255](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L255)

Suppresses inserting 'Syntax error' diagram in the DOM.
This is useful when you want to control how to handle syntax errors in your application.
Expand Down Expand Up @@ -515,7 +523,7 @@ Defined in: [packages/mermaid/src/config.type.ts:244](https://github.com/mermaid

> `optional` **wrap**: `boolean`

Defined in: [packages/mermaid/src/config.type.ts:246](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L246)
Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L247)

---

Expand Down
Loading
Loading