mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-18 19:54:17 +01:00
feat: support multiple stereotypes in class diagrams
This commit is contained in:
93
demos/class-multiple-stereotypes.html
Normal file
93
demos/class-multiple-stereotypes.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>Class Diagram - Multiple Stereotypes Test</title>
|
||||
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||
<style>
|
||||
div.mermaid {
|
||||
font-family: 'Courier New', Courier, monospace !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Multiple Stereotypes Test</h1>
|
||||
|
||||
<h2>Test 1: Inline with class definition (single)</h2>
|
||||
<pre class="mermaid">
|
||||
classDiagram
|
||||
class Shape <<interface>>
|
||||
</pre>
|
||||
|
||||
<h2>Test 2: Inline with class definition (multiple)</h2>
|
||||
<pre class="mermaid">
|
||||
classDiagram
|
||||
class Shape <<interface>> <<injected>>
|
||||
</pre>
|
||||
|
||||
<h2>Test 3: Separate line (single)</h2>
|
||||
<pre class="mermaid">
|
||||
classDiagram
|
||||
class Shape
|
||||
<<interface>> Shape
|
||||
</pre>
|
||||
|
||||
<h2>Test 4: Separate line (multiple)</h2>
|
||||
<pre class="mermaid">
|
||||
classDiagram
|
||||
class Shape
|
||||
<<interface>> <<injected>> Shape
|
||||
</pre>
|
||||
|
||||
<h2>Test 5: Inside class body (single)</h2>
|
||||
<pre class="mermaid">
|
||||
classDiagram
|
||||
class Shape{
|
||||
<<interface>>
|
||||
noOfVertices
|
||||
draw()
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2>Test 6: Inside class body (multiple on same line)</h2>
|
||||
<pre class="mermaid">
|
||||
classDiagram
|
||||
class Shape{
|
||||
<<interface>> <<injected>>
|
||||
noOfVertices
|
||||
draw()
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2>Test 7: Combined example</h2>
|
||||
<pre class="mermaid">
|
||||
classDiagram
|
||||
class Shape{
|
||||
<<interface>> <<injected>>
|
||||
noOfVertices
|
||||
draw()
|
||||
}
|
||||
class Color{
|
||||
<<enumeration>>
|
||||
RED
|
||||
BLUE
|
||||
GREEN
|
||||
WHITE
|
||||
BLACK
|
||||
}
|
||||
Shape <|-- Color
|
||||
</pre>
|
||||
|
||||
<hr />
|
||||
<script type="module">
|
||||
import mermaid from './mermaid.esm.mjs';
|
||||
mermaid.initialize({
|
||||
theme: 'default',
|
||||
logLevel: 3,
|
||||
securityLevel: 'loose',
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user