2022-04-07 13:08:35 +00:00
|
|
|
<!DOCTYPE html>
|
2022-10-02 13:51:25 -07:00
|
|
|
<html lang="en">
|
2022-09-05 00:48:36 +05:30
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
2022-09-26 18:16:36 -07:00
|
|
|
<title>Class diagrams Mermaid Quick Test Page</title>
|
2022-09-05 00:48:36 +05:30
|
|
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
|
|
|
<style>
|
|
|
|
div.mermaid {
|
|
|
|
/* font-family: 'trebuchet ms', verdana, arial; */
|
|
|
|
font-family: 'Courier New', Courier, monospace !important;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
2022-04-07 13:08:35 +00:00
|
|
|
|
2022-09-05 00:48:36 +05:30
|
|
|
<body>
|
2022-10-02 13:51:25 -07:00
|
|
|
<h1>Class diagram demos</h1>
|
|
|
|
|
2022-09-05 00:48:36 +05:30
|
|
|
<pre class="mermaid">
|
2022-11-19 12:48:17 -08:00
|
|
|
---
|
|
|
|
title: Demo Class Diagram
|
|
|
|
---
|
2022-04-07 13:08:35 +00:00
|
|
|
classDiagram
|
2022-09-26 18:16:36 -07:00
|
|
|
accTitle: Demo Class Diagram
|
|
|
|
accDescr: This class diagram show the abstract Animal class, and 3 classes that inherit from it: Duck, Fish, and Zebra.
|
|
|
|
|
|
|
|
Animal <|-- Duck
|
|
|
|
Animal <|-- Fish
|
|
|
|
Animal <|-- Zebra
|
|
|
|
Animal : +int age
|
|
|
|
Animal : +String gender
|
|
|
|
Animal: +isMammal()
|
|
|
|
Animal: +mate()
|
|
|
|
|
|
|
|
class Duck{
|
|
|
|
+String beakColor
|
|
|
|
+swim()
|
|
|
|
+quack()
|
|
|
|
}
|
|
|
|
class Fish{
|
|
|
|
-int sizeInFeet
|
|
|
|
-canEat()
|
|
|
|
}
|
|
|
|
class Zebra{
|
|
|
|
+bool is_wild
|
|
|
|
+run()
|
|
|
|
}
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
<hr />
|
2022-10-02 13:51:25 -07:00
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
classDiagram
|
|
|
|
Class01 <|-- AveryLongClass : Cool
|
|
|
|
|
|
|
|
<<interface>> Class01
|
|
|
|
Class03 "0" *-- "0..n" Class04
|
|
|
|
Class05 "1" o-- "many" Class06
|
|
|
|
Class07 .. Class08
|
|
|
|
Class09 "many" --> "1" C2 : Where am i?
|
|
|
|
Class09 "0" --* "1..n" C3
|
|
|
|
Class09 --|> Class07
|
|
|
|
Class07 : equals()
|
|
|
|
Class07 : Object[] elementData
|
|
|
|
Class01 : #size()
|
|
|
|
Class01 : -int chimp
|
|
|
|
Class01 : +int gorilla
|
|
|
|
Class08 <--> C2: Cool label
|
|
|
|
class Class10 {
|
|
|
|
<<service>>
|
|
|
|
int id
|
|
|
|
size()
|
|
|
|
}
|
2022-09-05 00:48:36 +05:30
|
|
|
</pre>
|
2022-09-26 18:16:36 -07:00
|
|
|
<hr />
|
2022-10-02 13:51:25 -07:00
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
classDiagram
|
|
|
|
class Class01~T~
|
|
|
|
Class01 : #size()
|
|
|
|
Class01 : -int chimp
|
|
|
|
Class01 : +int gorilla
|
|
|
|
class Class10~T~ {
|
|
|
|
<<service>>
|
|
|
|
int id
|
|
|
|
size()
|
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
<hr />
|
2022-10-02 13:51:25 -07:00
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
classDiagram
|
|
|
|
Class01~T~ <|-- AveryLongClass : Cool
|
|
|
|
<<interface>> Class01
|
|
|
|
Class03~T~ "0" *-- "0..n" Class04
|
|
|
|
Class05 "1" o-- "many" Class06
|
|
|
|
Class07~T~ .. Class08
|
|
|
|
Class09 "many" --> "1" C2 : Where am i?
|
|
|
|
Class09 "0" --* "1..n" C3
|
|
|
|
Class09 --|> Class07
|
|
|
|
Class07 : equals()
|
|
|
|
Class07 : Object[] elementData
|
|
|
|
Class01 : #size()
|
|
|
|
Class01 : -int chimp
|
|
|
|
Class01 : +int gorilla
|
|
|
|
Class08 <--> C2: Cool label
|
|
|
|
class Class10 {
|
|
|
|
<<service>>
|
|
|
|
int id
|
|
|
|
size()
|
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
<hr />
|
2022-10-02 13:51:25 -07:00
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
classDiagram
|
|
|
|
Interface1 ()-- Interface1Impl
|
|
|
|
</pre>
|
|
|
|
<hr />
|
2022-10-02 13:51:25 -07:00
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
classDiagram
|
|
|
|
direction LR
|
|
|
|
Animal ()-- Dog
|
|
|
|
Dog : bark()
|
|
|
|
Dog : species()
|
|
|
|
</pre>
|
|
|
|
<hr />
|
2022-10-02 13:51:25 -07:00
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
classDiagram
|
|
|
|
direction RL
|
|
|
|
Fruit ()-- Apple
|
|
|
|
Apple : color()
|
|
|
|
Apple : -int leafCount()
|
|
|
|
Fruit ()-- Pineapple
|
|
|
|
Pineapple : color()
|
|
|
|
Pineapple : -int leafCount()
|
|
|
|
Pineapple : -int spikeCount()
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<hr />
|
2022-04-07 13:08:35 +00:00
|
|
|
|
2022-09-05 00:48:36 +05:30
|
|
|
<script src="./mermaid.js"></script>
|
|
|
|
<script>
|
|
|
|
mermaid.initialize({
|
2022-09-26 18:16:36 -07:00
|
|
|
theme: 'default',
|
2022-09-05 00:48:36 +05:30
|
|
|
// themeCSS: '.node rect { fill: red; }',
|
|
|
|
logLevel: 3,
|
|
|
|
securityLevel: 'loose',
|
|
|
|
flowchart: { curve: 'basis' },
|
|
|
|
gantt: { axisFormat: '%m/%d/%Y' },
|
|
|
|
sequence: { actorMargin: 50 },
|
|
|
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|