## mermaidAPI 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. The core of this api is the [**render**][1] function which, given a graph definition, renders a graph/diagram and returns it as an svg element. It is is then up to the user of the API to make use of the svg, either insert it somewhere in the page or do something completely different. In addition to the render function, a number of behavioral configuration options are available. ## setSiteConfig ## setSiteConfig | Function | Description | Type | Values | | ------------- | ------------------------------------- | ----------- | --------------------------------------- | | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | **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\*\* ### Parameters - `conf` the base currentConfig to use as siteConfig Returns **any** the siteConfig ## getSiteConfig ## getSiteConfig | Function | Description | Type | Values | | ------------- | ------------------------------------------------- | ----------- | --------------------------------- | | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig | **Notes**: Returns **any** values in siteConfig. Returns **any** ## setConfig ## setConfig | Function | Description | Type | Values | | ------------- | ------------------------------------- | ----------- | --------------------------------------- | | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | **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. ### Parameters - `conf` the potential currentConfig Returns **any** the currentConfig merged with the sanitized conf ## getConfig ## getConfig | Function | Description | Type | Return Values | | --------- | ------------------------- | ----------- | ----------------------------- | | getConfig | Obtains the currentConfig | Get Request | Any Values from currentConfig | **Notes**: Returns **any** the currentConfig Returns **any** the currentConfig ## sanitize ## sanitize | Function | Description | Type | Values | | -------- | -------------------------------------- | ----------- | ------ | | sanitize | Sets the siteConfig to desired values. | Put Request | None | Ensures options parameter does not attempt to override siteConfig secure keys Note: modifies options in-place ### Parameters - `options` the potential setConfig parameter ## reset ## reset | Function | Description | Type | Required | Values | | -------- | ---------------------------- | ----------- | -------- | ------ | | reset | Resets currentConfig to conf | Put Request | Required | None | | Parameter | Description | Type | Required | Values | | --------- | ------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- | | conf | base set of values, which currentConfig coul be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array | \*Notes : (default: current siteConfig ) (optional, default `getSiteConfig()`) ### Parameters - `conf` the base currentConfig to reset to (default: current siteConfig ) (optional, default `getSiteConfig()`) ## mermaid.API Functions - `mermaidAPI.initialize` is a call to the mermaid API, that targets `config` and changes the before the diagram is rendered. **Notes**: `Config` is a variable that contains various configurable elements that can alter how the rendered SVG Diagram/Chart will look like. - `mermaidAPI.render` is function that renders a graph/diagram in svg format, from a chart definition inside `