mermaid/docs/Setup.md

1205 lines
42 KiB
Markdown
Raw Normal View History

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2019-07-12 20:40:54 +02:00
## mermaidAPI
2019-07-12 20:40:54 +02:00
2021-11-10 08:41:52 +01:00
Edit this
Page[\[N|Solid\](img/GitHub-Mark-32px.png)][1]
2019-07-12 20:40:54 +02:00
2021-11-10 08:41:52 +01:00
This is the API to be used when optionally handling the integration with the web page, instead of
using the default integration provided by mermaid.js.
2020-12-05 14:47:45 +01:00
2021-11-10 08:41:52 +01:00
The core of this api is the [**render**][2] function which, given a graph
definition as text, renders the graph/diagram and returns an svg element for the graph.
2019-08-28 21:50:44 +02:00
It is is then up to the user of the API to make use of the svg, either insert it somewhere in the
2021-11-10 08:41:52 +01:00
page or do something completely different.
2019-08-28 21:55:35 +02:00
2019-08-28 21:56:27 +02:00
In addition to the render function, a number of behavioral configuration options are available.
2019-07-12 20:40:54 +02:00
2021-01-28 20:55:58 +01:00
## Configuration
2021-11-10 08:41:52 +01:00
**Configuration methods in Mermaid version 8.6.0 have been updated, to learn more\[[click
here][3]].**
2021-01-28 20:55:58 +01:00
## **What follows are config instructions for older versions**
These are the default options which can be overridden with the initialization call like so:
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Example 1:**<pre> mermaid.initialize({ flowchart:{ htmlLabels: false } }); </pre>
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Example 2:**<pre> <script> var config = { startOnLoad:true, flowchart:{ useMaxWidth:true,
htmlLabels:true, curve:'cardinal', },
2021-01-28 20:55:58 +01:00
securityLevel:'loose',
2021-11-10 08:41:52 +01:00
}; mermaid.initialize(config); </script> </pre>
A summary of all options and their defaults is found [here][4].
A description of each option follows below.
2021-01-28 20:55:58 +01:00
## theme
2021-11-10 08:41:52 +01:00
Theme , the CSS style sheet
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------- | --------------- | ------ | -------- | ---------------------------------------------- |
| theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** To disable any pre-defined mermaid theme, use "null".<pre> "theme": "forest",
"themeCSS": ".node rect { fill: red; }" </pre>
2021-01-28 20:55:58 +01:00
## fontFamily
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- |
2021-10-23 13:57:24 +02:00
| fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif;'.
2021-01-28 20:55:58 +01:00
## logLevel
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------- | ----------------------------------------------------- | ---------------- | -------- | ------------- |
| logLevel | This option decides the amount of logging to be used. | string \| number | Required | 1, 2, 3, 4, 5 |
2021-01-28 20:55:58 +01:00
**Notes:**
2021-11-10 08:41:52 +01:00
- Debug: 1
- Info: 2
- Warn: 3
- Error: 4
- Fatal: 5 (default)
2021-01-28 20:55:58 +01:00
## securityLevel
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ------------- | --------------------------------- | ------ | -------- | ------------------------------- |
| securitylevel | Level of trust for parsed diagram | string | Required | 'strict', 'loose', 'antiscript' |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes**:
2021-01-28 20:55:58 +01:00
2021-06-04 06:56:11 +02:00
- **strict**: (**default**) tags in text are encoded, click functionality is disabled
2021-01-28 20:55:58 +01:00
- **loose**: tags in text are allowed, click functionality is enabled
2021-11-10 08:41:52 +01:00
- **antiscript**: html tags in text are allowed, (only script element is removed), click
functionality is enabled
2021-01-28 20:55:58 +01:00
## startOnLoad
2021-10-23 13:57:24 +02:00
| Parameter | Description | Type | Required | Values |
| ----------- | -------------------------------------------- | ------- | -------- | ----------- |
| startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:** Default value: true
2021-01-28 20:55:58 +01:00
## arrowMarkerAbsolute
| Parameter | Description | Type | Required | Values |
| ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false |
**Notes**:
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
This matters if you are using base tag settings.
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
Default value: false
2021-01-28 20:55:58 +01:00
## secure
2021-11-10 08:41:52 +01:00
This option controls which currentConfig keys are considered _secure_ and can only be changed
via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the
`secure` keys in the current currentConfig. This prevents malicious graph directives from
2021-01-28 20:55:58 +01:00
overriding a site's default security.
2021-04-24 07:13:49 +02:00
**Notes**:
Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
2021-01-28 20:55:58 +01:00
## deterministicIds
2021-11-10 08:41:52 +01:00
This option controls if the generated ids of nodes in the SVG are generated randomly or based
on a seed. If set to false, the IDs are generated based on the current date and thus are not
deterministic. This is the default behaviour.
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes**:
2021-11-10 08:41:52 +01:00
This matters if your files are checked into sourcecontrol e.g. git and should not change unless
content is changed.
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
Default value: false
2021-01-28 20:55:58 +01:00
## deterministicIDSeed
2021-11-10 08:41:52 +01:00
This option is the optional seed for deterministic ids. if set to undefined but
deterministicIds is true, a simple number iterator is used. You can set this attribute to base
the seed on a static string.
2021-01-28 20:55:58 +01:00
## flowchart
The object containing configurations specific for flowcharts
### diagramPadding
| Parameter | Description | Type | Required | Values |
| -------------- | ----------------------------------------------- | ------- | -------- | ------------------ |
2021-04-24 07:13:49 +02:00
| diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |
**Notes:**
2021-11-10 08:41:52 +01:00
The amount of padding around the diagram as a whole so that embedded diagrams have margins,
expressed in pixels
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
Default value: 8
2021-01-28 20:55:58 +01:00
### htmlLabels
| Parameter | Description | Type | Required | Values |
| ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:** Default value: true.
2021-01-28 20:55:58 +01:00
### nodeSpacing
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| ----------- | --------------------------------------------------- | ------- | -------- | ------------------- |
| nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:**
2021-11-10 08:41:52 +01:00
Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the
vertical spacing for LR as well as RL graphs.\*\*
2021-04-24 07:13:49 +02:00
Default value: 50
2021-01-28 20:55:58 +01:00
### rankSpacing
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- |
| rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes**:
2021-11-10 08:41:52 +01:00
Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal
spacing for LR as well as RL graphs.
2021-04-24 07:13:49 +02:00
Default value 50
2021-01-28 20:55:58 +01:00
### curve
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- |
| curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' |
**Notes:**
2021-01-28 20:55:58 +01:00
2021-10-23 13:57:24 +02:00
Default Value: 'basis'
2021-01-28 20:55:58 +01:00
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See notes | boolean | 4 | true, false |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:**
When this flag is set the height and width is set to 100% and is then scaling with the
2021-01-28 20:55:58 +01:00
available space if not the absolute space required is used.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
### defaultRenderer
| Parameter | Description | Type | Required | Values |
| --------------- | ----------- | ------- | -------- | ----------------------- |
| defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |
**Notes:**
Decides which rendering engine that is to be used for the rendering. Legal values are:
2021-11-10 08:41:52 +01:00
dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid
Default value: 'dagre-d3'
2021-01-28 20:55:58 +01:00
## sequence
The object containing configurations specific for sequence diagrams
### activationWidth
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ---------------------------- | ------- | -------- | ------------------ |
| activationWidth | Width of the activation rect | Integer | Required | Any Positive Value |
**Notes:** Default value :10
2021-01-28 20:55:58 +01:00
### diagramMarginX
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ |
| diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:** Default value: 50
2021-01-28 20:55:58 +01:00
### diagramMarginY
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| -------------- | ------------------------------------------------- | ------- | -------- | ------------------ |
| diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:** Default value: 10
2021-01-28 20:55:58 +01:00
### actorMargin
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ----------- | --------------------- | ------- | -------- | ------------------ |
| actorMargin | Margin between actors | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 50
2021-01-28 20:55:58 +01:00
### width
| Parameter | Description | Type | Required | Values |
| --------- | -------------------- | ------- | -------- | ------------------ |
| width | Width of actor boxes | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 150
2021-01-28 20:55:58 +01:00
### height
| Parameter | Description | Type | Required | Values |
| --------- | --------------------- | ------- | -------- | ------------------ |
| height | Height of actor boxes | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 65
2021-01-28 20:55:58 +01:00
### boxMargin
| Parameter | Description | Type | Required | Values |
| --------- | ------------------------ | ------- | -------- | ------------------ |
| boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 10
2021-01-28 20:55:58 +01:00
### boxTextMargin
| Parameter | Description | Type | Required | Values |
| ------------- | -------------------------------------------- | ------- | -------- | ------------------ |
2021-04-24 07:13:49 +02:00
| boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 5
2021-01-28 20:55:58 +01:00
### noteMargin
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ---------- | ------------------- | ------- | -------- | ------------------ |
| noteMargin | margin around notes | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 10
2021-01-28 20:55:58 +01:00
### messageMargin
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ------------- | ---------------------- | ------- | -------- | ------------------ |
| messageMargin | Space between messages | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 35
2021-01-28 20:55:58 +01:00
### messageAlign
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ------------ | --------------------------- | ------ | -------- | ------------------------- |
| messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 'center'
2021-01-28 20:55:58 +01:00
### mirrorActors
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ------------ | --------------------------- | ------- | -------- | ----------- |
| mirrorActors | Mirror actors under diagram | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: true
2021-01-28 20:55:58 +01:00
2021-09-23 19:42:51 +02:00
### forceMenus
| Parameter | Description | Type | Required | Values |
| ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- |
| forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False |
**Notes:**
Default value: false.
2021-01-28 20:55:58 +01:00
### bottomMarginAdj
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ------------------------------------------ | ------- | -------- | ------------------ |
| bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value |
**Notes:**
Depending on css styling this might need adjustment.
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
Default value: 1
2021-01-28 20:55:58 +01:00
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See Notes | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** When this flag is set to true, the height and width is set to 100% and is then
scaling with the available space. If set to false, the absolute space required is used.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
### rightAngles
| Parameter | Description | Type | Required | Values |
| ----------- | ------------------------------------ | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| rightAngles | display curve arrows as right angles | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
**Notes:**
This will display arrows that start and begin at the same node as right angles, rather than a curve
2021-04-24 07:13:49 +02:00
Default value: false
2021-01-28 20:55:58 +01:00
### showSequenceNumbers
| Parameter | Description | Type | Required | Values |
| ------------------- | ------------------------------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| showSequenceNumbers | This will show the node numbers | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: false
2021-01-28 20:55:58 +01:00
### actorFontSize
| Parameter | Description | Type | Required | Values |
| ------------- | -------------------------------------------------- | ------- | -------- | ------------------ |
| actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** **Default value 14**..
2021-01-28 20:55:58 +01:00
### actorFontFamily
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- |
2021-10-23 13:57:24 +02:00
| actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily |
2021-01-28 20:55:58 +01:00
**Notes:** Default value: "'Open Sans", sans-serif'
2021-01-28 20:55:58 +01:00
### actorFontWeight
This sets the font weight of the actor's description
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 400.
2021-01-28 20:55:58 +01:00
### noteFontSize
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ------------ | ----------------------------------------------- | ------- | -------- | ------------------ |
| noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 14
2021-01-28 20:55:58 +01:00
### noteFontFamily
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- |
2021-10-23 13:57:24 +02:00
| noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: ''"trebuchet ms", verdana, arial, sans-serif'
2021-01-28 20:55:58 +01:00
### noteFontWeight
This sets the font weight of the note's description
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 400
2021-01-28 20:55:58 +01:00
### noteAlign
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- |
| noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 'center'
2021-01-28 20:55:58 +01:00
### messageFontSize
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ----------------------------------------- | ------- | -------- | ------------------- |
| messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 16
2021-01-28 20:55:58 +01:00
### messageFontFamily
2021-04-29 18:50:12 +02:00
| Parameter | Description | Type | Required | Values |
| ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- |
2021-10-23 13:57:24 +02:00
| messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif'
2021-01-28 20:55:58 +01:00
### messageFontWeight
This sets the font weight of the message's description
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 400.
2021-01-28 20:55:58 +01:00
### wrap
This sets the auto-wrap state for the diagram
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: false.
2021-01-28 20:55:58 +01:00
### wrapPadding
This sets the auto-wrap padding for the diagram (sides only)
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 0.
2021-01-28 20:55:58 +01:00
### labelBoxWidth
This sets the width of the loop-box (loop, alt, opt, par)
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 50.
2021-01-28 20:55:58 +01:00
### labelBoxHeight
This sets the height of the loop-box (loop, alt, opt, par)
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 20.
2021-01-28 20:55:58 +01:00
## gantt
2021-04-24 07:13:49 +02:00
The object containing configurations specific for gantt diagrams
2021-01-28 20:55:58 +01:00
### titleTopMargin
### titleTopMargin
| Parameter | Description | Type | Required | Values |
| -------------- | ---------------------------------------------- | ------- | -------- | ------------------ |
| titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 25
2021-01-28 20:55:58 +01:00
### barHeight
| Parameter | Description | Type | Required | Values |
| --------- | ----------------------------------- | ------- | -------- | ------------------ |
| barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 20
2021-01-28 20:55:58 +01:00
### barGap
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ |
| barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 4
2021-01-28 20:55:58 +01:00
### topPadding
| Parameter | Description | Type | Required | Values |
| ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ |
| topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 50
2021-04-24 07:13:49 +02:00
### rightPadding
| Parameter | Description | Type | Required | Values |
| ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ |
| rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 75
2021-01-28 20:55:58 +01:00
### leftPadding
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ |
| leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 75
2021-01-28 20:55:58 +01:00
### gridLineStartPadding
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| -------------------- | -------------------------------------------- | ------- | -------- | ------------------ |
| gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 35
2021-01-28 20:55:58 +01:00
### fontSize
| Parameter | Description | Type | Required | Values |
| --------- | ----------- | ------- | -------- | ------------------ |
| fontSize | Font size | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 11
2021-01-28 20:55:58 +01:00
2021-03-13 16:45:27 +01:00
### sectionFontSize
2021-01-28 20:55:58 +01:00
2021-10-23 13:57:24 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ---------------------- | ------- | -------- | ------------------ |
| sectionFontSize | Font size for sections | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 11
2021-01-28 20:55:58 +01:00
### numberSectionStyles
| Parameter | Description | Type | Required | Values |
| ------------------- | ---------------------------------------- | ------- | -------- | ------------------ |
| numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 4
2021-01-28 20:55:58 +01:00
### axisFormat
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ---------- | --------------------------- | ---- | -------- | ---------------- |
| axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd |
2021-01-28 20:55:58 +01:00
**Notes:**
This might need adjustment to match your locale and preferences
2021-04-24 07:13:49 +02:00
Default value: '%Y-%m-%d'.
2021-01-28 20:55:58 +01:00
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See notes | boolean | 4 | true, false |
**Notes:**
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
When this flag is set the height and width is set to 100% and is then scaling with the
2021-01-28 20:55:58 +01:00
available space if not the absolute space required is used.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
2021-04-29 18:50:12 +02:00
### topAxis
| Parameter | Description | Type | Required | Values |
| --------- | ----------- | ------- | -------- | ----------- |
| topAxis | See notes | Boolean | 4 | True, False |
2021-11-10 08:41:52 +01:00
**Notes:** when this flag is set date labels will be added to the top of the chart
2021-04-29 18:50:12 +02:00
**Default value false**.
2021-01-28 20:55:58 +01:00
## journey
The object containing configurations specific for journey diagrams
### diagramMarginX
| Parameter | Description | Type | Required | Values |
| -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ |
2021-04-24 07:13:49 +02:00
| diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 50
2021-01-28 20:55:58 +01:00
### diagramMarginY
| Parameter | Description | Type | Required | Values |
| -------------- | -------------------------------------------------- | ------- | -------- | ------------------ |
2021-04-24 07:13:49 +02:00
| diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 10
2021-01-28 20:55:58 +01:00
2021-03-13 16:45:27 +01:00
### leftMargin
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ----------- | --------------------- | ------- | -------- | ------------------ |
| actorMargin | Margin between actors | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 50
2021-01-28 20:55:58 +01:00
### width
| Parameter | Description | Type | Required | Values |
| --------- | -------------------- | ------- | -------- | ------------------ |
| width | Width of actor boxes | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 150
2021-01-28 20:55:58 +01:00
### height
| Parameter | Description | Type | Required | Values |
| --------- | --------------------- | ------- | -------- | ------------------ |
| height | Height of actor boxes | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 65
2021-01-28 20:55:58 +01:00
### boxMargin
| Parameter | Description | Type | Required | Values |
| --------- | ------------------------ | ------- | -------- | ------------------ |
| boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 10
2021-01-28 20:55:58 +01:00
### boxTextMargin
| Parameter | Description | Type | Required | Values |
| ------------- | -------------------------------------------- | ------- | -------- | ------------------ |
2021-04-24 07:13:49 +02:00
| boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 5
2021-01-28 20:55:58 +01:00
### noteMargin
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ---------- | ------------------- | ------- | -------- | ------------------ |
| noteMargin | Margin around notes | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 10
2021-01-28 20:55:58 +01:00
### messageMargin
| Parameter | Description | Type | Required | Values |
| ------------- | ----------------------- | ------- | -------- | ------------------ |
| messageMargin | Space between messages. | Integer | Required | Any Positive Value |
**Notes:**
Space between messages.
2021-04-24 07:13:49 +02:00
Default value: 35
2021-01-28 20:55:58 +01:00
### messageAlign
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ------------ | --------------------------- | ---- | -------- | ------------------------- |
| messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 'center'
2021-01-28 20:55:58 +01:00
### bottomMarginAdj
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ------------------------------------------ | ------- | -------- | ------------------ |
| bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value |
**Notes:**
Depending on css styling this might need adjustment.
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
Default value: 1
2021-01-28 20:55:58 +01:00
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See notes | boolean | 4 | true, false |
**Notes:**
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
When this flag is set the height and width is set to 100% and is then scaling with the
2021-01-28 20:55:58 +01:00
available space if not the absolute space required is used.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
### rightAngles
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| ----------- | --------------------------------- | ---- | -------- | ----------- |
| rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false |
**Notes:**
This will display arrows that start and begin at the same node as right angles, rather than a curves
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
Default value: false
2021-01-28 20:55:58 +01:00
## useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See notes | boolean | 4 | true, false |
**Notes:**
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
When this flag is set the height and width is set to 100% and is then scaling with the
2021-01-28 20:55:58 +01:00
available space if not the absolute space required is used.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
## defaultRenderer
| Parameter | Description | Type | Required | Values |
| --------------- | ----------- | ------- | -------- | ----------------------- |
| defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |
**Notes**:
Decides which rendering engine that is to be used for the rendering. Legal values are:
2021-11-10 08:41:52 +01:00
dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid
Default value: 'dagre-d3'
2021-01-28 20:55:58 +01:00
## useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See notes | boolean | 4 | true, false |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:**
When this flag is set the height and width is set to 100% and is then scaling with the
2021-01-28 20:55:58 +01:00
available space if not the absolute space required is used.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
## defaultRenderer
| Parameter | Description | Type | Required | Values |
| --------------- | ----------- | ------- | -------- | ----------------------- |
| defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |
**Notes:**
Decides which rendering engine that is to be used for the rendering. Legal values are:
2021-11-10 08:41:52 +01:00
dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid
Default value: 'dagre-d3'
2021-01-28 20:55:58 +01:00
## er
The object containing configurations specific for entity relationship diagrams
### diagramPadding
| Parameter | Description | Type | Required | Values |
| -------------- | ----------------------------------------------- | ------- | -------- | ------------------ |
2021-04-24 07:13:49 +02:00
| diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |
**Notes:**
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
The amount of padding around the diagram as a whole so that embedded diagrams have margins,
expressed in pixels
2021-04-24 07:13:49 +02:00
Default value: 20
2021-01-28 20:55:58 +01:00
### layoutDirection
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ---------------------------------------- | ------ | -------- | ---------------------- |
| layoutDirection | Directional bias for layout of entities. | string | Required | "TB", "BT", "LR", "RL" |
2021-01-28 20:55:58 +01:00
**Notes:**
2021-04-24 07:13:49 +02:00
2021-01-28 20:55:58 +01:00
'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left.
2021-04-24 07:13:49 +02:00
2021-01-28 20:55:58 +01:00
T = top, B = bottom, L = left, and R = right.
2021-04-24 07:13:49 +02:00
2021-04-29 18:50:12 +02:00
Default value: 'TB'
2021-01-28 20:55:58 +01:00
### minEntityWidth
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| -------------- | ---------------------------------- | ------- | -------- | ------------------ |
2021-10-23 13:57:24 +02:00
| minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Expressed in pixels. Default value: 100
2021-01-28 20:55:58 +01:00
### minEntityHeight
2021-04-24 07:13:49 +02:00
| Parameter | Description | Type | Required | Values |
| --------------- | ----------------------------------- | ------- | -------- | ------------------ |
| minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Expressed in pixels Default value: 75
2021-01-28 20:55:58 +01:00
### entityPadding
| Parameter | Description | Type | Required | Values |
| ------------- | ------------------------------------------------------------ | ------- | -------- | ------------------ |
| entityPadding | Minimum internal padding between text in box and box borders | Integer | 4 | Any Positive Value |
2021-01-28 20:55:58 +01:00
2021-04-24 07:13:49 +02:00
**Notes:**
The minimum internal padding between text in an entity box and the enclosing box borders,
2021-11-10 08:41:52 +01:00
expressed in pixels.
2021-04-24 07:13:49 +02:00
Default value: 15
2021-01-28 20:55:58 +01:00
### stroke
| Parameter | Description | Type | Required | Values |
| --------- | ----------------------------------- | ------ | -------- | -------------------- |
2021-04-24 07:13:49 +02:00
| stroke | Stroke color of box edges and lines | string | 4 | Any recognized color |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 'gray'
2021-01-28 20:55:58 +01:00
### fill
| Parameter | Description | Type | Required | Values |
| --------- | -------------------------- | ------ | -------- | -------------------- |
2021-04-24 07:13:49 +02:00
| fill | Fill color of entity boxes | string | 4 | Any recognized color |
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
**Notes:** Default value: 'honeydew'
2021-01-28 20:55:58 +01:00
### fontSize
| Parameter | Description | Type | Required | Values |
| --------- | ------------------- | ------- | -------- | ------------------ |
| fontSize | Font Size in pixels | Integer | | Any Positive Value |
2021-04-24 07:13:49 +02:00
**Notes:**
2021-11-10 08:41:52 +01:00
Font size (expressed as an integer representing a number of pixels) Default value: 12
2021-01-28 20:55:58 +01:00
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See Notes | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
**Notes:**
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
When this flag is set to true, the diagram width is locked to 100% and scaled based on
available space. If set to false, the diagram reserves its absolute width.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
## pie
The object containing configurations specific for pie diagrams
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See Notes | boolean | Required | true, false |
2021-01-28 20:55:58 +01:00
**Notes:**
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
When this flag is set to true, the diagram width is locked to 100% and scaled based on
available space. If set to false, the diagram reserves its absolute width.
2021-04-24 07:13:49 +02:00
Default value: true
## requirement
The object containing configurations specific for req diagrams
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
2021-04-24 07:13:49 +02:00
| useMaxWidth | See Notes | boolean | Required | true, false |
**Notes:**
2021-04-24 07:13:49 +02:00
2021-11-10 08:41:52 +01:00
When this flag is set to true, the diagram width is locked to 100% and scaled based on
available space. If set to false, the diagram reserves its absolute width.
2021-04-24 07:13:49 +02:00
Default value: true
2021-01-28 20:55:58 +01:00
2022-06-13 09:03:33 +02:00
## c4
The object containing configurations specific for c4 diagrams
### diagramMarginX
| Parameter | Description | Type | Required | Values |
| -------------- | ---------------------------------------------- | ------- | -------- | ------------------ |
| diagramMarginX | Margin to the right and left of the c4 diagram | Integer | Required | Any Positive Value |
**Notes:** Default value: 50
### diagramMarginY
| Parameter | Description | Type | Required | Values |
| -------------- | ------------------------------------------- | ------- | -------- | ------------------ |
| diagramMarginY | Margin to the over and under the c4 diagram | Integer | Required | Any Positive Value |
**Notes:** Default value: 10
### c4ShapeMargin
| Parameter | Description | Type | Required | Values |
| ----------- | --------------------- | ------- | -------- | ------------------ |
| shapeMargin | Margin between shapes | Integer | Required | Any Positive Value |
**Notes:** Default value: 50
### width
| Parameter | Description | Type | Required | Values |
| --------- | --------------------- | ------- | -------- | ------------------ |
| width | Width of person boxes | Integer | Required | Any Positive Value |
**Notes:** Default value: 216
### height
| Parameter | Description | Type | Required | Values |
| --------- | ---------------------- | ------- | -------- | ------------------ |
| height | Height of person boxes | Integer | Required | Any Positive Value |
**Notes:** Default value: 60
### boxMargin
| Parameter | Description | Type | Required | Values |
| --------- | ------------------------ | ------- | -------- | ------------------ |
| boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |
**Notes:** Default value: 10
### useMaxWidth
| Parameter | Description | Type | Required | Values |
| ----------- | ----------- | ------- | -------- | ----------- |
| useMaxWidth | See Notes | boolean | Required | true, false |
**Notes:** When this flag is set to true, the height and width is set to 100% and is then
scaling with the available space. If set to false, the absolute space required is used.
Default value: true
### wrap
This sets the auto-wrap state for the diagram
**Notes:** Default value: true.
### wrapPadding
This sets the auto-wrap padding for the diagram (sides only)
**Notes:** Default value: 0.
## setSiteConfig
## setSiteConfig
| Function | Description | Type | Values |
| ------------- | ------------------------------------- | ----------- | --------------------------------------- |
| setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
2020-07-02 16:59:09 +02:00
2021-11-10 08:41:52 +01:00
**Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls
to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig)
will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this
function _Default value: At default, will mirror Global Config_
2020-07-02 16:59:09 +02:00
### Parameters
- `conf` The base currentConfig to use as siteConfig
Returns **[object][5]** The siteConfig
2020-07-02 16:59:09 +02:00
## parse
### Parameters
2022-03-07 08:04:04 +01:00
- `text`
2022-03-07 08:04:04 +01:00
Returns **any**
## getSiteConfig
## getSiteConfig
2020-04-11 18:02:05 +02:00
| Function | Description | Type | Values |
| ------------- | ------------------------------------------------- | ----------- | -------------------------------- |
| setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig |
2020-04-11 18:02:05 +02:00
2021-11-10 08:41:52 +01:00
**Notes**: Returns **any** values in siteConfig.
2020-04-11 18:02:05 +02:00
Returns **[object][5]** The siteConfig
2020-07-02 16:59:09 +02:00
## setConfig
2020-04-11 18:02:05 +02:00
## setConfig
2020-04-11 18:02:05 +02:00
| Function | Description | Type | Values |
| ------------- | ------------------------------------- | ----------- | --------------------------------------- |
| setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
2020-07-02 16:59:09 +02:00
2021-11-10 08:41:52 +01:00
**Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure
keys. Any values found in conf with key found in siteConfig.secure will be replaced with the
corresponding siteConfig value.
2020-04-11 18:02:05 +02:00
### Parameters
2020-04-11 18:02:05 +02:00
2021-11-10 08:41:52 +01:00
- `conf` **any** The potential currentConfig
2020-07-02 16:59:09 +02:00
2021-11-10 08:41:52 +01:00
Returns **any** The currentConfig merged with the sanitized conf
2020-04-11 18:02:05 +02:00
## getConfig
2020-04-11 18:02:05 +02:00
## getConfig
2020-07-02 16:59:09 +02:00
2021-11-10 08:41:52 +01:00
| Function | Description | Type | Return Values |
| --------- | ------------------------- | ----------- | ------------------------------ |
| getConfig | Obtains the currentConfig | Get Request | Any Values from current Config |
2020-04-11 18:02:05 +02:00
2021-11-10 08:41:52 +01:00
**Notes**: Returns **any** the currentConfig
2020-04-11 18:02:05 +02:00
2021-11-10 08:41:52 +01:00
Returns **any** The currentConfig
2020-07-02 16:59:09 +02:00
## sanitize
2020-04-11 18:02:05 +02:00
## sanitize
2020-04-11 18:02:05 +02:00
| Function | Description | Type | Values |
| -------- | -------------------------------------- | ----------- | ------ |
| sanitize | Sets the siteConfig to desired values. | Put Request | None |
2020-07-02 16:59:09 +02:00
2021-11-10 08:41:52 +01:00
Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies
options in-place
2020-04-11 18:02:05 +02:00
### Parameters
2020-04-11 18:02:05 +02:00
2021-11-10 08:41:52 +01:00
- `options` **any** The potential setConfig parameter
2020-07-02 16:59:09 +02:00
2021-11-07 03:36:06 +01:00
## addDirective
Pushes in a directive to the configuration
### Parameters
- `directive` **[object][5]** The directive to push in
2021-11-07 03:36:06 +01:00
## reset
2020-04-11 18:02:05 +02:00
## reset
2020-04-11 18:02:05 +02:00
| Function | Description | Type | Required | Values |
| -------- | ---------------------------- | ----------- | -------- | ------ |
| reset | Resets currentConfig to conf | Put Request | Required | None |
2020-07-02 16:59:09 +02:00
2021-11-15 09:07:08 +01:00
## conf
2020-04-11 18:02:05 +02:00
| Parameter | Description | Type | Required | Values |
| --------- | -------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- |
| conf | base set of values, which currentConfig could be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array |
2021-11-10 08:41:52 +01:00
**Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`)
2020-12-05 14:47:45 +01:00
## render
2020-11-08 10:29:00 +01:00
Function that renders an svg with a graph from a chart definition. Usage example below.
2019-07-12 20:40:54 +02:00
2021-11-02 03:43:54 +01:00
```javascript
2019-07-12 20:40:54 +02:00
mermaidAPI.initialize({
2021-11-10 08:41:52 +01:00
startOnLoad: true,
});
$(function () {
const graphDefinition = 'graph TB\na-->b';
const cb = function (svgGraph) {
console.log(svgGraph);
};
mermaidAPI.render('id1', graphDefinition, cb);
});
2019-07-12 20:40:54 +02:00
```
2020-12-05 14:47:45 +01:00
### Parameters
2021-11-10 08:41:52 +01:00
- `id` **any** The id of the element to be rendered
- `_txt` **any** The graph definition
- `cb` **any** Callback which is called after rendering is finished with the svg code as inparam.
2021-11-10 08:41:52 +01:00
- `container` **any** Selector to element in which a div with the graph temporarily will be
inserted. In one is provided a hidden div will be inserted in the body of the page instead. The
element will be removed when rendering is completed.
2019-08-28 21:50:44 +02:00
2022-03-07 08:04:04 +01:00
Returns **any**
## updateRendererConfigs
### Parameters
2022-03-07 08:04:04 +01:00
- `conf` **any**
## reinitialize
To be removed
## initialize
### Parameters
2022-03-07 08:04:04 +01:00
- `options` **any**
2022-03-07 08:04:04 +01:00
##
2020-12-05 14:47:45 +01:00
## mermaidAPI configuration defaults
```html
<script>
2022-03-24 20:25:22 +01:00
var 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);
</script>
```
2020-12-05 14:47:45 +01:00
[1]: https://github.com/mermaid-js/mermaid/blob/develop/src/mermaidAPI.js
2021-11-10 08:41:52 +01:00
[2]: Setup.md?id=render
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
[3]: 8.6.0_docs.md
2021-01-28 20:55:58 +01:00
2021-11-10 08:41:52 +01:00
[4]: #mermaidapi-configuration-defaults
2021-11-07 03:36:06 +01:00
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object