mermaid/docs/config/setup/modules/mermaidAPI.md

124 lines
3.1 KiB
Markdown
Raw Normal View History

2022-10-17 23:58:51 -03:00
> **Warning**
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
2022-10-29 00:46:25 +05:30
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/modules/mermaidAPI.md](../../../../packages/mermaid/src/docs/config/setup/modules/mermaidAPI.md).
2022-10-15 00:50:11 -03:00
# Module: mermaidAPI
## References
2022-10-31 22:15:07 +05:30
### default
2022-10-15 00:50:11 -03:00
Renames and re-exports [mermaidAPI](mermaidAPI.md#mermaidapi)
## Variables
2022-10-31 22:15:07 +05:30
### mermaidAPI
2022-10-15 00:50:11 -03:00
2022-10-25 17:54:07 -03:00
`Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `Promise`<`void`> ; `parse`: (`text`: `string`, `parseError?`: `ParseErrorFunction`) => `boolean` ; `parseDirective`: (`p`: `any`, `statement`: `string`, `context`: `string`, `type`: `string`) => `void` ; `render`: (`id`: `string`, `text`: `string`, `cb`: (`svgCode`: `string`, `bindFunctions?`: (`element`: `Element`) => `void`) => `void`, `container?`: `Element`) => `Promise`<`void`> ; `reset`: () => `void` ; `setConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.setConfig; `updateSiteConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.updateSiteConfig }>
2022-10-15 00:50:11 -03:00
2022-10-31 11:57:50 +05:30
## mermaidAPI configuration defaults
```ts
const config = {
theme: 'default',
logLevel: 'fatal',
securityLevel: 'strict',
startOnLoad: true,
arrowMarkerAbsolute: 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,
},
};
mermaid.initialize(config);
```
2022-10-15 00:50:11 -03:00
#### Defined in
2022-10-31 22:15:07 +05:30
[mermaidAPI.ts:546](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L546)
2022-10-15 00:50:11 -03:00
## Functions
2022-10-31 22:15:07 +05:30
### decodeEntities
2022-10-15 00:50:11 -03:00
**decodeEntities**(`text`): `string`
#### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
#### Returns
`string`
#### Defined in
2022-10-31 22:15:07 +05:30
[mermaidAPI.ts:72](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L72)
2022-10-15 00:50:11 -03:00
---
2022-10-31 22:15:07 +05:30
### encodeEntities
2022-10-15 00:50:11 -03:00
**encodeEntities**(`text`): `string`
#### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
#### Returns
`string`
#### Defined in
2022-10-31 22:15:07 +05:30
[mermaidAPI.ts:46](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L46)