Skip to content

Commit 113efd1

Browse files
Added placeholder docs fro C4C diagram
1 parent f159808 commit 113efd1

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- [Pie Chart](pie.md)
1616
- [Requirement Diagram](requirementDiagram.md)
1717
- [Gitgraph (Git) Diagram 🔥](gitgraph.md)
18+
- [C4C Diagram (Context) Diagram 🦺⚠️](c4c.md)
1819
- [Other Examples](examples.md)
1920

2021
- ⚙️ Deployment and Configuration

docs/c4c.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# C4C Diagrams
2+
3+
**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/docs/gitgraph.md)
4+
> C4 Diagram: This is an experimental diagram for now. The syntax and properties can change in future releases. Proper documentation will be provided when the syntax is stable.
5+
6+
7+
8+
Mermaid's c4 diagram sytax is compatible with plantUML. See example below:
9+
10+
```mermaid-example
11+
C4Context
12+
title System Context diagram for Internet Banking System
13+
14+
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
15+
Person(customerB, "Banking Customer B")
16+
Person_Ext(customerC, "Banking Customer C")
17+
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
18+
19+
Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")
20+
21+
Enterprise_Boundary(b1, "BankBoundary") {
22+
23+
SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
24+
25+
System_Boundary(b2, "BankBoundary2") {
26+
System(SystemA, "Banking System A")
27+
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts.")
28+
}
29+
30+
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
31+
SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")
32+
33+
Boundary(b3, "BankBoundary3", "boundary") {
34+
SystemQueue(SystemF, "Banking System F Queue", "A system of the bank, with personal bank accounts.")
35+
SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
36+
}
37+
}
38+
39+
BiRel(customerA, SystemAA, "Uses")
40+
BiRel(SystemAA, SystemE, "Uses")
41+
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
42+
Rel(SystemC, customerA, "Sends e-mails to")
43+
44+
45+
```
46+

src/diagrams/c4/c4Db.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import mermaidAPI from '../../mermaidAPI';
22
import * as configApi from '../../config';
33
import { log } from '../../logger';
44
import { sanitizeText } from '../common/common';
5+
import { setAccTitle, getAccTitle, getAccDescription, setAccDescription } from '../../commonDb';
56

67
let c4ShapeArray = [];
78
let boundaryParseStack = [''];
@@ -443,15 +444,6 @@ export const setTitle = function (txt) {
443444
title = sanitizedText;
444445
};
445446

446-
const setAccDescription = function (description_lex) {
447-
let sanitizedText = sanitizeText(description_lex, configApi.getConfig());
448-
description = sanitizedText;
449-
};
450-
451-
const getAccDescription = function () {
452-
return description;
453-
};
454-
455447
export default {
456448
addPersonOrSystem,
457449
addPersonOrSystemBoundary,
@@ -472,6 +464,8 @@ export default {
472464
getRels,
473465
getTitle,
474466
getC4Type,
467+
setAccTitle,
468+
getAccTitle,
475469
getAccDescription,
476470
setAccDescription,
477471
parseDirective,

0 commit comments

Comments
 (0)