mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
chore: Cleanup
This commit is contained in:
@@ -530,7 +530,7 @@ stateDiagram-v2
|
|||||||
[*] --> A
|
[*] --> A
|
||||||
A --> B: test({ foo#colon; 'far' })
|
A --> B: test({ foo#colon; 'far' })
|
||||||
B --> [*]
|
B --> [*]
|
||||||
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
class B badBadEvent
|
class B badBadEvent
|
||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
@@ -543,14 +543,14 @@ stateDiagram-v2
|
|||||||
classDef notMoving fill:white
|
classDef notMoving fill:white
|
||||||
classDef movement font-style:italic;
|
classDef movement font-style:italic;
|
||||||
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
|
|
||||||
[*] --> Still
|
[*] --> Still
|
||||||
Still --> [*]
|
Still --> [*]
|
||||||
Still --> Moving
|
Still --> Moving
|
||||||
Moving --> Still
|
Moving --> Still
|
||||||
Moving --> Crash
|
Moving --> Crash
|
||||||
Crash --> [*]
|
Crash --> [*]
|
||||||
|
|
||||||
class Still notMoving
|
class Still notMoving
|
||||||
class Moving, Crash movement
|
class Moving, Crash movement
|
||||||
class Crash badBadEvent
|
class Crash badBadEvent
|
||||||
|
@@ -174,8 +174,8 @@ The syntax for adding title and description looks like this:
|
|||||||
accDescr: The description
|
accDescr: The description
|
||||||
|
|
||||||
accDescr {
|
accDescr {
|
||||||
Syntax for a description text
|
Syntax for a description text
|
||||||
written on multiple lines.
|
written on multiple lines.
|
||||||
}
|
}
|
||||||
|
|
||||||
In a similar way to the directives the jison syntax are quite similar between the diagrams.
|
In a similar way to the directives the jison syntax are quite similar between the diagrams.
|
||||||
|
@@ -80,7 +80,7 @@ mermaid.initialize(config);
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:949](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L949)
|
[mermaidAPI.ts:938](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L938)
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ Return the last node appended
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:292](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L292)
|
[mermaidAPI.ts:289](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L289)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ the cleaned up svgCode
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:243](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L243)
|
[mermaidAPI.ts:240](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L240)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ the string with all the user styles
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:170](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L170)
|
[mermaidAPI.ts:167](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L167)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ the string with all the user styles
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:220](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L220)
|
[mermaidAPI.ts:217](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L217)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ with an enclosing block that has each of the cssClasses followed by !important;
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:154](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L154)
|
[mermaidAPI.ts:151](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L151)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ with an enclosing block that has each of the cssClasses followed by !important;
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:128](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L128)
|
[mermaidAPI.ts:125](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L125)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ with an enclosing block that has each of the cssClasses followed by !important;
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:99](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L99)
|
[mermaidAPI.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L96)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ Put the svgCode into an iFrame. Return the iFrame code
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:271](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L271)
|
[mermaidAPI.ts:268](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L268)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -305,4 +305,4 @@ Remove any existing elements from the given document
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:343](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L343)
|
[mermaidAPI.ts:340](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L340)
|
||||||
|
@@ -111,9 +111,9 @@ b. The importing of mermaid library through the `mermaid.esm.js` or `mermaid.esm
|
|||||||
<body>
|
<body>
|
||||||
Here is a mermaid diagram:
|
Here is a mermaid diagram:
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] --> B[Load Balancer]
|
A[Client] --> B[Load Balancer]
|
||||||
B --> C[Server01]
|
B --> C[Server01]
|
||||||
B --> D[Server02]
|
B --> D[Server02]
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
@@ -156,18 +156,18 @@ Please refer to the [Mindmap](./mindmap.md?id=integrating-with-your-librarywebsi
|
|||||||
<body>
|
<body>
|
||||||
Here is one mermaid diagram:
|
Here is one mermaid diagram:
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] --> B[Load Balancer]
|
A[Client] --> B[Load Balancer]
|
||||||
B --> C[Server1]
|
B --> C[Server1]
|
||||||
B --> D[Server2]
|
B --> D[Server2]
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
And here is another:
|
And here is another:
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] -->|tcp_123| B
|
A[Client] -->|tcp_123| B
|
||||||
B(Load Balancer)
|
B(Load Balancer)
|
||||||
B -->|tcp_456| C[Server1]
|
B -->|tcp_456| C[Server1]
|
||||||
B -->|tcp_456| D[Server2]
|
B -->|tcp_456| D[Server2]
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
@@ -189,15 +189,15 @@ In this example mermaid.js is referenced in `src` as a separate JavaScript file,
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph LR
|
graph LR
|
||||||
A --- B
|
A --- B
|
||||||
B-->C[fa:fa-ban forbidden]
|
B-->C[fa:fa-ban forbidden]
|
||||||
B-->D(fa:fa-spinner);
|
B-->D(fa:fa-spinner);
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] --> B[Load Balancer]
|
A[Client] --> B[Load Balancer]
|
||||||
B --> C[Server1]
|
B --> C[Server1]
|
||||||
B --> D[Server2]
|
B --> D[Server2]
|
||||||
</pre>
|
</pre>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
|
@@ -68,7 +68,7 @@ export class DiagramNotFoundError extends Error {
|
|||||||
* @internal
|
* @internal
|
||||||
* @param diagrams - Array of {@link ExternalDiagramDefinition}.
|
* @param diagrams - Array of {@link ExternalDiagramDefinition}.
|
||||||
*/
|
*/
|
||||||
export const loadExternalDiagrams = async (diagrams: ExternalDiagramDefinition[]) => {
|
export const loadExternalDiagrams = async (...diagrams: ExternalDiagramDefinition[]) => {
|
||||||
log.debug(`Loading ${diagrams.length} external diagrams`);
|
log.debug(`Loading ${diagrams.length} external diagrams`);
|
||||||
// Load all lazy loaded diagrams in parallel
|
// Load all lazy loaded diagrams in parallel
|
||||||
const results = await Promise.allSettled(
|
const results = await Promise.allSettled(
|
||||||
|
@@ -76,7 +76,7 @@ const generateHeader = (file: string): string => {
|
|||||||
const sourcePathRelativeToGenerated = posix.join(relativePath, filePathFromRoot);
|
const sourcePathRelativeToGenerated = posix.join(relativePath, filePathFromRoot);
|
||||||
return `
|
return `
|
||||||
> **Warning**
|
> **Warning**
|
||||||
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
> ## Please edit the corresponding file in [${filePathFromRoot}](${sourcePathRelativeToGenerated}).`;
|
> ## Please edit the corresponding file in [${filePathFromRoot}](${sourcePathRelativeToGenerated}).`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -94,9 +94,9 @@ b. The importing of mermaid library through the `mermaid.esm.js` or `mermaid.esm
|
|||||||
<body>
|
<body>
|
||||||
Here is a mermaid diagram:
|
Here is a mermaid diagram:
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] --> B[Load Balancer]
|
A[Client] --> B[Load Balancer]
|
||||||
B --> C[Server01]
|
B --> C[Server01]
|
||||||
B --> D[Server02]
|
B --> D[Server02]
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
@@ -126,6 +126,10 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac
|
|||||||
| ----------- | --------------------------------- | ------- | ----------- |
|
| ----------- | --------------------------------- | ------- | ----------- |
|
||||||
| startOnLoad | Toggle for Rendering upon loading | Boolean | true, false |
|
| startOnLoad | Toggle for Rendering upon loading | Boolean | true, false |
|
||||||
|
|
||||||
|
### Adding external diagrams to mermaid
|
||||||
|
|
||||||
|
Please refer to the [Mindmap](./mindmap.md?id=integrating-with-your-librarywebsite) section for more information.
|
||||||
|
|
||||||
### Working Examples
|
### Working Examples
|
||||||
|
|
||||||
**Here is a full working example of the mermaidAPI being called through the CDN:**
|
**Here is a full working example of the mermaidAPI being called through the CDN:**
|
||||||
@@ -135,18 +139,18 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac
|
|||||||
<body>
|
<body>
|
||||||
Here is one mermaid diagram:
|
Here is one mermaid diagram:
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] --> B[Load Balancer]
|
A[Client] --> B[Load Balancer]
|
||||||
B --> C[Server1]
|
B --> C[Server1]
|
||||||
B --> D[Server2]
|
B --> D[Server2]
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
And here is another:
|
And here is another:
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] -->|tcp_123| B
|
A[Client] -->|tcp_123| B
|
||||||
B(Load Balancer)
|
B(Load Balancer)
|
||||||
B -->|tcp_456| C[Server1]
|
B -->|tcp_456| C[Server1]
|
||||||
B -->|tcp_456| D[Server2]
|
B -->|tcp_456| D[Server2]
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
@@ -168,15 +172,15 @@ In this example mermaid.js is referenced in `src` as a separate JavaScript file,
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph LR
|
graph LR
|
||||||
A --- B
|
A --- B
|
||||||
B-->C[fa:fa-ban forbidden]
|
B-->C[fa:fa-ban forbidden]
|
||||||
B-->D(fa:fa-spinner);
|
B-->D(fa:fa-spinner);
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Client] --> B[Load Balancer]
|
A[Client] --> B[Load Balancer]
|
||||||
B --> C[Server1]
|
B --> C[Server1]
|
||||||
B --> D[Server2]
|
B --> D[Server2]
|
||||||
</pre>
|
</pre>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
|
Reference in New Issue
Block a user