mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 10:36:43 +02:00
fix mermiad version placeholder
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/rendering-util/render.ts:24](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L24)
|
[packages/mermaid/src/rendering-util/render.ts:25](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L25)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/rendering-util/render.ts:23](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L23)
|
[packages/mermaid/src/rendering-util/render.ts:24](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L24)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -36,4 +36,4 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/rendering-util/render.ts:22](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L22)
|
[packages/mermaid/src/rendering-util/render.ts:23](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L23)
|
||||||
|
@@ -28,7 +28,7 @@ page.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:435](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L435)
|
[packages/mermaid/src/mermaid.ts:445](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L445)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ A graph definition key
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:437](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L437)
|
[packages/mermaid/src/mermaid.ts:447](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L447)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ Use [initialize](mermaid.Mermaid.md#initialize) and [run](mermaid.Mermaid.md#run
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:430](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L430)
|
[packages/mermaid/src/mermaid.ts:440](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L440)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -116,13 +116,13 @@ This function should be called before the run function.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:434](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L434)
|
[packages/mermaid/src/mermaid.ts:444](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L444)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### mermaidAPI
|
### mermaidAPI
|
||||||
|
|
||||||
• **mermaidAPI**: `Readonly`<{ `defaultConfig`: [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.defaultConfig; `getConfig`: () => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.getConfig; `getDiagramFromText`: (`text`: `string`, `metadata`: `Pick`<`DiagramMetadata`, `"title"`>) => `Promise`<`Diagram`> ; `getSiteConfig`: () => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`userOptions`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => `void` ; `parse`: (`text`: `string`, `parseOptions`: [`ParseOptions`](mermaid.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](mermaid.ParseOptions.md)) => `Promise`<[`ParseResult`](mermaid.ParseResult.md)> ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](mermaid.RenderResult.md)> ; `reset`: () => `void` ; `setConfig`: (`conf`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.setConfig; `updateSiteConfig`: (`conf`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.updateSiteConfig }>
|
• **mermaidAPI**: `Readonly`<{ `defaultConfig`: [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.defaultConfig; `getConfig`: () => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.getConfig; `getDiagramFromText`: (`text`: `string`, `metadata`: `Pick`<`DiagramMetadata`, `"title"`>) => `Promise`<`Diagram`> ; `getSiteConfig`: () => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`userOptions`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => `void` ; `parse`: (`text`: `string`, `parseOptions`: [`ParseOptions`](mermaid.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<`Diagram` | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](mermaid.ParseOptions.md)) => `Promise`<`Diagram`> ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`, `positions?`: `Positions`) => `Promise`<[`RenderResult`](mermaid.RenderResult.md)> ; `reset`: () => `void` ; `setConfig`: (`conf`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.setConfig; `updateSiteConfig`: (`conf`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.updateSiteConfig }>
|
||||||
|
|
||||||
**`Deprecated`**
|
**`Deprecated`**
|
||||||
|
|
||||||
@@ -130,32 +130,32 @@ Use [parse](mermaid.Mermaid.md#parse) and [render](mermaid.Mermaid.md#render) in
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:424](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L424)
|
[packages/mermaid/src/mermaid.ts:434](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L434)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### parse
|
### parse
|
||||||
|
|
||||||
• **parse**: (`text`: `string`, `parseOptions`: [`ParseOptions`](mermaid.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](mermaid.ParseOptions.md)) => `Promise`<[`ParseResult`](mermaid.ParseResult.md)>
|
• **parse**: (`text`: `string`, `parseOptions?`: [`ParseOptions`](mermaid.ParseOptions.md)) => `Promise`<`boolean` | `void` | `Diagram` & `ConfigTuple`>
|
||||||
|
|
||||||
#### Type declaration
|
#### Type declaration
|
||||||
|
|
||||||
▸ (`text`, `parseOptions`): `Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>
|
▸ (`text`, `parseOptions?`): `Promise`<`boolean` | `void` | `Diagram` & `ConfigTuple`>
|
||||||
|
|
||||||
Parse the text and validate the syntax.
|
Parse the text and validate the syntax.
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| :------------- | :----------------------------------------------------------------------- | :------------------------------ |
|
| :-------------- | :---------------------------------------- | :------------------------------ |
|
||||||
| `text` | `string` | The mermaid diagram definition. |
|
| `text` | `string` | The mermaid diagram definition. |
|
||||||
| `parseOptions` | [`ParseOptions`](mermaid.ParseOptions.md) & { `suppressErrors`: `true` } | Options for parsing. |
|
| `parseOptions?` | [`ParseOptions`](mermaid.ParseOptions.md) | Options for parsing. |
|
||||||
|
|
||||||
##### Returns
|
##### Returns
|
||||||
|
|
||||||
`Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>
|
`Promise`<`boolean` | `void` | `Diagram` & `ConfigTuple`>
|
||||||
|
|
||||||
An object with the `diagramType` set to type of the diagram if valid. Otherwise `false` if parseOptions.suppressErrors is `true`.
|
If valid, Diagram otherwise `false` if parseOptions.suppressErrors is `true`.
|
||||||
|
|
||||||
**`See`**
|
**`See`**
|
||||||
|
|
||||||
@@ -165,22 +165,22 @@ An object with the `diagramType` set to type of the diagram if valid. Otherwise
|
|||||||
|
|
||||||
Error if the diagram is invalid and parseOptions.suppressErrors is false or not set.
|
Error if the diagram is invalid and parseOptions.suppressErrors is false or not set.
|
||||||
|
|
||||||
▸ (`text`, `parseOptions?`): `Promise`<[`ParseResult`](mermaid.ParseResult.md)>
|
**`Example`**
|
||||||
|
|
||||||
##### Parameters
|
```js
|
||||||
|
console.log(await mermaid.parse('flowchart \n a --> b'));
|
||||||
| Name | Type |
|
// { diagramType: 'flowchart-v2' }
|
||||||
| :-------------- | :---------------------------------------- |
|
console.log(await mermaid.parse('wrong \n a --> b', { suppressErrors: true }));
|
||||||
| `text` | `string` |
|
// false
|
||||||
| `parseOptions?` | [`ParseOptions`](mermaid.ParseOptions.md) |
|
console.log(await mermaid.parse('wrong \n a --> b', { suppressErrors: false }));
|
||||||
|
// throws Error
|
||||||
##### Returns
|
console.log(await mermaid.parse('wrong \n a --> b'));
|
||||||
|
// throws Error
|
||||||
`Promise`<[`ParseResult`](mermaid.ParseResult.md)>
|
```
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:425](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L425)
|
[packages/mermaid/src/mermaid.ts:435](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L435)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ Error if the diagram is invalid and parseOptions.suppressErrors is false or not
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:419](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L419)
|
[packages/mermaid/src/mermaid.ts:429](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L429)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ Used to register external diagram types.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:433](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L433)
|
[packages/mermaid/src/mermaid.ts:443](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L443)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -242,25 +242,26 @@ Used to register external diagram types.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:432](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L432)
|
[packages/mermaid/src/mermaid.ts:442](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L442)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### render
|
### render
|
||||||
|
|
||||||
• **render**: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](mermaid.RenderResult.md)>
|
• **render**: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`, `positions?`: `Positions`) => `Promise`<[`RenderResult`](mermaid.RenderResult.md)>
|
||||||
|
|
||||||
#### Type declaration
|
#### Type declaration
|
||||||
|
|
||||||
▸ (`id`, `text`, `svgContainingElement?`): `Promise`<[`RenderResult`](mermaid.RenderResult.md)>
|
▸ (`id`, `text`, `svgContainingElement?`, `positions?`): `Promise`<[`RenderResult`](mermaid.RenderResult.md)>
|
||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
| Name | Type |
|
| Name | Type |
|
||||||
| :---------------------- | :-------- |
|
| :---------------------- | :---------- |
|
||||||
| `id` | `string` |
|
| `id` | `string` |
|
||||||
| `text` | `string` |
|
| `text` | `string` |
|
||||||
| `svgContainingElement?` | `Element` |
|
| `svgContainingElement?` | `Element` |
|
||||||
|
| `positions?` | `Positions` |
|
||||||
|
|
||||||
##### Returns
|
##### Returns
|
||||||
|
|
||||||
@@ -268,7 +269,7 @@ Used to register external diagram types.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:426](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L426)
|
[packages/mermaid/src/mermaid.ts:436](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L436)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -316,7 +317,7 @@ Renders the mermaid diagrams
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:431](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L431)
|
[packages/mermaid/src/mermaid.ts:441](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L441)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -351,7 +352,7 @@ to it (eg. dart interop wrapper). (Initially there is no parseError member of me
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:436](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L436)
|
[packages/mermaid/src/mermaid.ts:446](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L446)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -361,4 +362,4 @@ to it (eg. dart interop wrapper). (Initially there is no parseError member of me
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:418](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L418)
|
[packages/mermaid/src/mermaid.ts:428](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L428)
|
||||||
|
@@ -284,7 +284,7 @@ This option decides the amount of logging to be used by mermaid.
|
|||||||
|
|
||||||
### look
|
### look
|
||||||
|
|
||||||
• `Optional` **look**: `"classic"` | `"handDrawn"`
|
• `Optional` **look**: `"neo"` | `"classic"` | `"handDrawn"`
|
||||||
|
|
||||||
Defines which main look to use for the diagram.
|
Defines which main look to use for the diagram.
|
||||||
|
|
||||||
@@ -461,7 +461,7 @@ This is useful when you want to control how to handle syntax errors in your appl
|
|||||||
|
|
||||||
### theme
|
### theme
|
||||||
|
|
||||||
• `Optional` **theme**: `"default"` | `"base"` | `"dark"` | `"forest"` | `"neutral"` | `"null"`
|
• `Optional` **theme**: `"default"` | `"base"` | `"dark"` | `"forest"` | `"neutral"` | `"neo"` | `"neo-dark"` | `"mc"` | `"null"`
|
||||||
|
|
||||||
Theme, the CSS style sheet.
|
Theme, the CSS style sheet.
|
||||||
You may also use `themeCSS` to override this value.
|
You may also use `themeCSS` to override this value.
|
||||||
|
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/diagram-api/types.ts:130](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L130)
|
[packages/mermaid/src/diagram-api/types.ts:153](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L153)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/diagram-api/types.ts:132](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L132)
|
[packages/mermaid/src/diagram-api/types.ts:155](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L155)
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
@@ -87,4 +87,4 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[packages/mermaid/src/mermaid.ts:440](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L440)
|
[packages/mermaid/src/mermaid.ts:450](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L450)
|
||||||
|
@@ -1,283 +0,0 @@
|
|||||||
> **Warning**
|
|
||||||
>
|
|
||||||
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
|
||||||
>
|
|
||||||
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/modules/mermaidAPI.md](../../../../packages/mermaid/src/docs/config/setup/modules/mermaidAPI.md).
|
|
||||||
|
|
||||||
# Module: mermaidAPI
|
|
||||||
|
|
||||||
## Interfaces
|
|
||||||
|
|
||||||
- [ParseOptions](../interfaces/mermaidAPI.ParseOptions.md)
|
|
||||||
- [RenderResult](../interfaces/mermaidAPI.RenderResult.md)
|
|
||||||
|
|
||||||
## References
|
|
||||||
|
|
||||||
### default
|
|
||||||
|
|
||||||
Renames and re-exports [mermaidAPI](mermaidAPI.md#mermaidapi)
|
|
||||||
|
|
||||||
## Type Aliases
|
|
||||||
|
|
||||||
### D3Element
|
|
||||||
|
|
||||||
Ƭ **D3Element**: `any`
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:68](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L68)
|
|
||||||
|
|
||||||
## Variables
|
|
||||||
|
|
||||||
### mermaidAPI
|
|
||||||
|
|
||||||
• `Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getDiagramFromText`: (`text`: `string`, `metadata`: `Pick`<`DiagramMetadata`, `"title"`>) => `Promise`<`Diagram`> ; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `void` ; `parse`: (`text`: `string`, `parseOptions`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<`Diagram` | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md)) => `Promise`<`Diagram`> ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](../interfaces/mermaidAPI.RenderResult.md)> ; `reset`: () => `void` ; `setConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.setConfig; `updateSiteConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.updateSiteConfig }>
|
|
||||||
|
|
||||||
## mermaidAPI configuration defaults
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const config = {
|
|
||||||
theme: 'default',
|
|
||||||
logLevel: 'fatal',
|
|
||||||
securityLevel: 'strict',
|
|
||||||
startOnLoad: true,
|
|
||||||
arrowMarkerAbsolute: false,
|
|
||||||
suppressErrorRendering: false,
|
|
||||||
|
|
||||||
er: {
|
|
||||||
diagramPadding: 20,
|
|
||||||
layoutDirection: 'TB',
|
|
||||||
minEntityWidth: 100,
|
|
||||||
minEntityHeight: 75,
|
|
||||||
entityPadding: 15,
|
|
||||||
stroke: 'gray',
|
|
||||||
fill: 'honeydew',
|
|
||||||
fontSize: 12,
|
|
||||||
useMaxWidth: true,
|
|
||||||
},
|
|
||||||
flowchart: {
|
|
||||||
diagramPadding: 8,
|
|
||||||
htmlLabels: true,
|
|
||||||
curve: 'basis',
|
|
||||||
},
|
|
||||||
sequence: {
|
|
||||||
diagramMarginX: 50,
|
|
||||||
diagramMarginY: 10,
|
|
||||||
actorMargin: 50,
|
|
||||||
width: 150,
|
|
||||||
height: 65,
|
|
||||||
boxMargin: 10,
|
|
||||||
boxTextMargin: 5,
|
|
||||||
noteMargin: 10,
|
|
||||||
messageMargin: 35,
|
|
||||||
messageAlign: 'center',
|
|
||||||
mirrorActors: true,
|
|
||||||
bottomMarginAdj: 1,
|
|
||||||
useMaxWidth: true,
|
|
||||||
rightAngles: false,
|
|
||||||
showSequenceNumbers: false,
|
|
||||||
},
|
|
||||||
gantt: {
|
|
||||||
titleTopMargin: 25,
|
|
||||||
barHeight: 20,
|
|
||||||
barGap: 4,
|
|
||||||
topPadding: 50,
|
|
||||||
leftPadding: 75,
|
|
||||||
gridLineStartPadding: 35,
|
|
||||||
fontSize: 11,
|
|
||||||
fontFamily: '"Open Sans", sans-serif',
|
|
||||||
numberSectionStyles: 4,
|
|
||||||
axisFormat: '%Y-%m-%d',
|
|
||||||
topAxis: false,
|
|
||||||
displayMode: '',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
mermaid.initialize(config);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:628](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L628)
|
|
||||||
|
|
||||||
## Functions
|
|
||||||
|
|
||||||
### appendDivSvgG
|
|
||||||
|
|
||||||
▸ **appendDivSvgG**(`parentRoot`, `id`, `enclosingDivId`, `divStyle?`, `svgXlink?`): `any`
|
|
||||||
|
|
||||||
Append an enclosing div, then svg, then g (group) to the d3 parentRoot. Set attributes.
|
|
||||||
Only set the style attribute on the enclosing div if divStyle is given.
|
|
||||||
Only set the xmlns:xlink attribute on svg if svgXlink is given.
|
|
||||||
Return the last node appended
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| :--------------- | :------- | :----------------------------------------------- |
|
|
||||||
| `parentRoot` | `any` | the d3 node to append things to |
|
|
||||||
| `id` | `string` | the value to set the id attr to |
|
|
||||||
| `enclosingDivId` | `string` | the id to set the enclosing div to |
|
|
||||||
| `divStyle?` | `string` | if given, the style to set the enclosing div to |
|
|
||||||
| `svgXlink?` | `string` | if given, the link to set the new svg element to |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`any`
|
|
||||||
|
|
||||||
- returns the parentRoot that had nodes appended
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:270](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L270)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### cleanUpSvgCode
|
|
||||||
|
|
||||||
▸ **cleanUpSvgCode**(`svgCode?`, `inSandboxMode`, `useArrowMarkerUrls`): `string`
|
|
||||||
|
|
||||||
Clean up svgCode. Do replacements needed
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| :------------------- | :-------- | :------------ | :---------------------------------------------------------- |
|
|
||||||
| `svgCode` | `string` | `''` | the code to clean up |
|
|
||||||
| `inSandboxMode` | `boolean` | `undefined` | security level |
|
|
||||||
| `useArrowMarkerUrls` | `boolean` | `undefined` | should arrow marker's use full urls? (vs. just the anchors) |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
the cleaned up svgCode
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:216](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L216)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### createCssStyles
|
|
||||||
|
|
||||||
▸ **createCssStyles**(`config`, `classDefs?`): `string`
|
|
||||||
|
|
||||||
Create the user styles
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| :---------- | :--------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| `config` | `MermaidConfig` | configuration that has style and theme settings to use |
|
|
||||||
| `classDefs` | `undefined` \| `null` \| `Map`<`string`, `DiagramStyleClassDef`> | the classDefs in the diagram text. Might be null if none were defined. Usually is the result of a call to getClasses(...) |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
the string with all the user styles
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:147](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L147)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### createUserStyles
|
|
||||||
|
|
||||||
▸ **createUserStyles**(`config`, `graphType`, `classDefs`, `svgId`): `string`
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type |
|
|
||||||
| :---------- | :----------------------------------------------------- |
|
|
||||||
| `config` | `MermaidConfig` |
|
|
||||||
| `graphType` | `string` |
|
|
||||||
| `classDefs` | `undefined` \| `Map`<`string`, `DiagramStyleClassDef`> |
|
|
||||||
| `svgId` | `string` |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:193](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L193)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### cssImportantStyles
|
|
||||||
|
|
||||||
▸ **cssImportantStyles**(`cssClass`, `element`, `cssClasses?`): `string`
|
|
||||||
|
|
||||||
Create a CSS style that starts with the given class name, then the element,
|
|
||||||
with an enclosing block that has each of the cssClasses followed by !important;
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| :----------- | :---------- | :------------ | :--------------------------------------------- |
|
|
||||||
| `cssClass` | `string` | `undefined` | CSS class name |
|
|
||||||
| `element` | `string` | `undefined` | CSS element |
|
|
||||||
| `cssClasses` | `string`\[] | `[]` | list of CSS styles to append after the element |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
- the constructed string
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:132](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L132)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### putIntoIFrame
|
|
||||||
|
|
||||||
▸ **putIntoIFrame**(`svgCode?`, `svgElement?`): `string`
|
|
||||||
|
|
||||||
Put the svgCode into an iFrame. Return the iFrame code
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| :------------ | :------- | :------------ | :--------------------------------------------------------------------------- |
|
|
||||||
| `svgCode` | `string` | `''` | the svg code to put inside the iFrame |
|
|
||||||
| `svgElement?` | `any` | `undefined` | the d3 node that has the current svgElement so we can get the height from it |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
- the code with the iFrame that now contains the svgCode
|
|
||||||
TODO replace btoa(). Replace with buf.toString('base64')?
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L247)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### removeExistingElements
|
|
||||||
|
|
||||||
▸ **removeExistingElements**(`doc`, `id`, `divId`, `iFrameId`): `void`
|
|
||||||
|
|
||||||
Remove any existing elements from the given document
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| :--------- | :--------- | :------------------------------------ |
|
|
||||||
| `doc` | `Document` | the document to removed elements from |
|
|
||||||
| `id` | `string` | id for any existing SVG element |
|
|
||||||
| `divId` | `string` | - |
|
|
||||||
| `iFrameId` | `string` | - |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`void`
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:320](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L320)
|
|
@@ -1,16 +0,0 @@
|
|||||||
1. Paddings of node labels for neo and classic does not differ, which it should. Status: Fixed
|
|
||||||
2. When layout is set to "elk" and look is "neo", the drop shadow is not present. Status: Fixed
|
|
||||||
3. Drop-shadows are not present for flow-charts, even if look is "neo". Status: Fixed
|
|
||||||
4. When look is "neo" and theme is "forest", the border of nodes is visible, which should not be the case: Status: Fixed
|
|
||||||
5. When look is "neo" and "theme" is "neo", the background color shall be white. Status: Fixed
|
|
||||||
6. Composite states contains borders in neo. Status: Fixed
|
|
||||||
7. Nested states contains borders in neo. Status: Fixed
|
|
||||||
8. The font-size of node labels seems a bit off.
|
|
||||||
9. When selecting look=neo and theme for composite stated, the height differs.
|
|
||||||
10. Drop-shadows for non-rectangular shapes are not supported: Status: Fixed
|
|
||||||
11. Gradient: Fix proper color from blue to red. Do last (render.ts)
|
|
||||||
12. Rx,Ry of rects in neo is not applied correct on rects except composite states
|
|
||||||
|
|
||||||
13. Stop state shall be filled and no drop-shadow on inner circle: Status: Fixed
|
|
||||||
14. No curve on line under title in composite states: Status fixed
|
|
||||||
15. When this.useGradient = false the color of the composite states are not correct
|
|
@@ -286,7 +286,7 @@ erDiagram
|
|||||||
|
|
||||||
- If you want the relationship label to be more than one word, you must use double quotes around the phrase
|
- If you want the relationship label to be more than one word, you must use double quotes around the phrase
|
||||||
- If you don't want a label at all on a relationship, you must use an empty double-quoted string
|
- If you don't want a label at all on a relationship, you must use an empty double-quoted string
|
||||||
- (v\<MERMAID_RELEASE_VERSION>+) If you want a multi-line label on a relationship, use `<br />` between the two lines (`"first line<br />second line"`)
|
- (v11.0.2-b.1+) If you want a multi-line label on a relationship, use `<br />` between the two lines (`"first line<br />second line"`)
|
||||||
|
|
||||||
## Styling
|
## Styling
|
||||||
|
|
||||||
|
@@ -192,7 +192,7 @@ erDiagram
|
|||||||
|
|
||||||
- If you want the relationship label to be more than one word, you must use double quotes around the phrase
|
- If you want the relationship label to be more than one word, you must use double quotes around the phrase
|
||||||
- If you don't want a label at all on a relationship, you must use an empty double-quoted string
|
- If you don't want a label at all on a relationship, you must use an empty double-quoted string
|
||||||
- (v<MERMAID_RELEASE_VERSION>+) If you want a multi-line label on a relationship, use `<br />` between the two lines (`"first line<br />second line"`)
|
- (v11.0.2-b.1+) If you want a multi-line label on a relationship, use `<br />` between the two lines (`"first line<br />second line"`)
|
||||||
|
|
||||||
## Styling
|
## Styling
|
||||||
|
|
||||||
|
@@ -58,8 +58,9 @@ export const cylinder = async (parent: SVGAElement, node: Node) => {
|
|||||||
const { labelStyles, nodeStyles } = styles2String(node);
|
const { labelStyles, nodeStyles } = styles2String(node);
|
||||||
node.labelStyle = labelStyles;
|
node.labelStyle = labelStyles;
|
||||||
const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
const labelPaddingX = node.look === 'neo' ? node.padding * 2 : node.padding;
|
const nodePadding = node.padding ?? 0;
|
||||||
const labelPaddingY = node.look === 'neo' ? node.padding * 1 : node.padding;
|
const labelPaddingX = node.look === 'neo' ? nodePadding * 2 : nodePadding;
|
||||||
|
const labelPaddingY = node.look === 'neo' ? nodePadding * 1 : nodePadding;
|
||||||
const w = bbox.width + labelPaddingY;
|
const w = bbox.width + labelPaddingY;
|
||||||
const rx = w / 2;
|
const rx = w / 2;
|
||||||
const ry = rx / (2.5 + w / 50);
|
const ry = rx / (2.5 + w / 50);
|
||||||
|
@@ -33,8 +33,9 @@ export const hexagon = async (parent: SVGAElement, node: Node): Promise<SVGAElem
|
|||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
|
|
||||||
const f = 4;
|
const f = 4;
|
||||||
const labelPaddingX = node.look === 'neo' ? node.padding * 3 : node.padding;
|
const nodePadding = node.padding ?? 0;
|
||||||
const labelPaddingY = node.look === 'neo' ? node.padding * 1.5 : node.padding;
|
const labelPaddingX = node.look === 'neo' ? nodePadding * 3 : nodePadding;
|
||||||
|
const labelPaddingY = node.look === 'neo' ? nodePadding * 1.5 : nodePadding;
|
||||||
const h = bbox.height + labelPaddingX;
|
const h = bbox.height + labelPaddingX;
|
||||||
const m = h / f;
|
const m = h / f;
|
||||||
const w = bbox.width + 2 * m + labelPaddingY;
|
const w = bbox.width + 2 * m + labelPaddingY;
|
||||||
|
@@ -12,8 +12,9 @@ export const lean_left = async (parent: SVGAElement, node: Node): Promise<SVGAEl
|
|||||||
const { labelStyles, nodeStyles } = styles2String(node);
|
const { labelStyles, nodeStyles } = styles2String(node);
|
||||||
node.labelStyle = labelStyles;
|
node.labelStyle = labelStyles;
|
||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
const labelPaddingX = node.look === 'neo' ? node.padding * 3 : node.padding;
|
const nodePadding = node.padding ?? 0;
|
||||||
const labelPaddingY = node.look === 'neo' ? node.padding * 1.5 : node.padding;
|
const labelPaddingX = node.look === 'neo' ? nodePadding * 3 : nodePadding;
|
||||||
|
const labelPaddingY = node.look === 'neo' ? nodePadding * 1.5 : nodePadding;
|
||||||
const w = Math.max(bbox.width + (labelPaddingY ?? 0), node?.width ?? 0);
|
const w = Math.max(bbox.width + (labelPaddingY ?? 0), node?.width ?? 0);
|
||||||
const h = Math.max(bbox.height + (labelPaddingX ?? 0), node?.height ?? 0);
|
const h = Math.max(bbox.height + (labelPaddingX ?? 0), node?.height ?? 0);
|
||||||
const points = [
|
const points = [
|
||||||
|
@@ -12,12 +12,12 @@ export const lean_right = async (parent: SVGAElement, node: Node): Promise<SVGAE
|
|||||||
const { labelStyles, nodeStyles } = styles2String(node);
|
const { labelStyles, nodeStyles } = styles2String(node);
|
||||||
node.labelStyle = labelStyles;
|
node.labelStyle = labelStyles;
|
||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
|
const nodePadding = node.padding ?? 0;
|
||||||
|
const labelPaddingX = node.look === 'neo' ? nodePadding * 3 : nodePadding;
|
||||||
|
const labelPaddingY = node.look === 'neo' ? nodePadding * 1.5 : nodePadding;
|
||||||
|
|
||||||
const labelPaddingX = node.look === 'neo' ? node.padding * 3 : node.padding;
|
const w = Math.max(bbox.width + labelPaddingY, node?.width ?? 0);
|
||||||
const labelPaddingY = node.look === 'neo' ? node.padding * 1.5 : node.padding;
|
const h = Math.max(bbox.height + labelPaddingX, node?.height ?? 0);
|
||||||
|
|
||||||
const w = Math.max(bbox.width + (labelPaddingY ?? 0), node?.width ?? 0);
|
|
||||||
const h = Math.max(bbox.height + (labelPaddingX ?? 0), node?.height ?? 0);
|
|
||||||
const points = [
|
const points = [
|
||||||
{ x: (-3 * h) / 6, y: 0 },
|
{ x: (-3 * h) / 6, y: 0 },
|
||||||
{ x: w, y: 0 },
|
{ x: w, y: 0 },
|
||||||
|
@@ -2,12 +2,13 @@ import type { Node, RectOptions } from '$root/rendering-util/types.d.ts';
|
|||||||
import { drawRect } from './drawRect.js';
|
import { drawRect } from './drawRect.js';
|
||||||
|
|
||||||
export const roundedRect = async (parent: SVGAElement, node: Node) => {
|
export const roundedRect = async (parent: SVGAElement, node: Node) => {
|
||||||
|
const nodePadding = node.padding ?? 0;
|
||||||
const options = {
|
const options = {
|
||||||
rx: node.look === 'neo' ? 3 : 5,
|
rx: node.look === 'neo' ? 3 : 5,
|
||||||
ry: node.look === 'neo' ? 3 : 5,
|
ry: node.look === 'neo' ? 3 : 5,
|
||||||
|
|
||||||
labelPaddingX: node.look === 'neo' ? node.padding * 2 : node.padding,
|
labelPaddingX: node.look === 'neo' ? nodePadding * 2 : nodePadding,
|
||||||
labelPaddingY: node.look === 'neo' ? node.padding : node.padding,
|
labelPaddingY: node.look === 'neo' ? nodePadding : nodePadding,
|
||||||
classes: '',
|
classes: '',
|
||||||
} as RectOptions;
|
} as RectOptions;
|
||||||
|
|
||||||
|
@@ -57,9 +57,9 @@ export const stadium = async (parent: SVGAElement, node: Node) => {
|
|||||||
const { labelStyles, nodeStyles } = styles2String(node);
|
const { labelStyles, nodeStyles } = styles2String(node);
|
||||||
node.labelStyle = labelStyles;
|
node.labelStyle = labelStyles;
|
||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
|
const nodePadding = node.padding ?? 0;
|
||||||
const labelPaddingX = node.look === 'neo' ? node.padding * 3 : node.padding;
|
const labelPaddingX = node.look === 'neo' ? nodePadding * 3 : nodePadding;
|
||||||
const labelPaddingY = node.look === 'neo' ? node.padding * 1.5 : node.padding;
|
const labelPaddingY = node.look === 'neo' ? nodePadding * 1.5 : nodePadding;
|
||||||
|
|
||||||
const h = bbox.height + labelPaddingX;
|
const h = bbox.height + labelPaddingX;
|
||||||
const w = bbox.width + h / 4 + labelPaddingY;
|
const w = bbox.width + h / 4 + labelPaddingY;
|
||||||
|
@@ -27,8 +27,9 @@ export const trapezoid = async (parent: SVGAElement, node: Node): Promise<SVGAEl
|
|||||||
const { labelStyles, nodeStyles } = styles2String(node);
|
const { labelStyles, nodeStyles } = styles2String(node);
|
||||||
node.labelStyle = labelStyles;
|
node.labelStyle = labelStyles;
|
||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
const labelPaddingX = node.look === 'neo' ? node.padding * 3 : node.padding;
|
const nodePadding = node.padding ?? 0;
|
||||||
const labelPaddingY = node.look === 'neo' ? node.padding * 1.5 : node.padding;
|
const labelPaddingX = node.look === 'neo' ? nodePadding * 3 : nodePadding;
|
||||||
|
const labelPaddingY = node.look === 'neo' ? nodePadding * 1.5 : nodePadding;
|
||||||
const w = bbox.width + labelPaddingY;
|
const w = bbox.width + labelPaddingY;
|
||||||
const h = bbox.height + labelPaddingX;
|
const h = bbox.height + labelPaddingX;
|
||||||
const points = [
|
const points = [
|
||||||
|
Reference in New Issue
Block a user