mermaid/docs/developer-docs/configuration.md

29 lines
1.1 KiB
Markdown
Raw Normal View History

# Configuration
2022-06-11 14:46:27 +01:00
When mermaid starts configuration is extracted to a configuration to be used for a diagram. There are 3 sources for configuration:
* The default configuration
2022-06-11 14:46:27 +01:00
* Overrides on the site level is set by the initialize call and will be applied to all diagrams in the site/app. The term for this is the **siteConfig**.
2022-03-31 11:59:32 -04:00
* Directives - diagram authors can update select configuration parameters directly in the diagram code via directives and these are applied to the render config.
**The render config** is configuration that is used when rendering by applying these configurations.
## Theme configuration
## Starting mermaid
```mermaid
sequenceDiagram
Site->>mermaid: initialize
Site->>mermaid: content loaded
mermaid->>mermaidAPI: init
```
## Initialize
2022-03-01 20:00:52 +08:00
Initialize call is called **only once**. It is called by the site integrator in order to override the default configuration on a site level.
## configApi.reset
This method resets the configuration for a diagram to the site configuration, the configuration provided by the site integrator. Before each rendering of a diagram reset is called in the very beginning of render.