mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 12:59:46 +02:00
feat: Break render and parse types
Both render and parse are async now. Return type of render contains svg and bindFunctions. Parse will not throw error if parseOptions.silent is passed.
This commit is contained in:
78
docs/config/setup/interfaces/mermaidAPI.RenderResult.md
Normal file
78
docs/config/setup/interfaces/mermaidAPI.RenderResult.md
Normal file
@@ -0,0 +1,78 @@
|
||||
> **Warning**
|
||||
>
|
||||
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||
>
|
||||
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.RenderResult.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.RenderResult.md).
|
||||
|
||||
# Interface: RenderResult
|
||||
|
||||
[mermaidAPI](../modules/mermaidAPI.md).RenderResult
|
||||
|
||||
Function that renders an svg with a graph from a chart definition. Usage example below.
|
||||
|
||||
```javascript
|
||||
mermaidAPI.initialize({
|
||||
startOnLoad: true,
|
||||
});
|
||||
$(function () {
|
||||
const graphDefinition = 'graph TB\na-->b';
|
||||
const cb = function (svgGraph) {
|
||||
console.log(svgGraph);
|
||||
};
|
||||
mermaidAPI.render('id1', graphDefinition, cb);
|
||||
});
|
||||
```
|
||||
|
||||
**`Param`**
|
||||
|
||||
The id for the SVG element (the element to be rendered)
|
||||
|
||||
**`Param`**
|
||||
|
||||
The text for the graph definition
|
||||
|
||||
**`Param`**
|
||||
|
||||
Callback which is called after rendering is finished with the svg code as in param.
|
||||
|
||||
**`Param`**
|
||||
|
||||
HTML element where the svg will be inserted. (Is usually element with the .mermaid class)
|
||||
If no svgContainingElement is provided then the SVG element will be appended to the body.
|
||||
Selector to element in which a div with the graph temporarily will be
|
||||
inserted. If 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.
|
||||
|
||||
## Properties
|
||||
|
||||
### bindFunctions
|
||||
|
||||
• `Optional` **bindFunctions**: (`element`: `Element`) => `void`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`element`): `void`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :-------- |
|
||||
| `element` | `Element` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[mermaidAPI.ts:382](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L382)
|
||||
|
||||
---
|
||||
|
||||
### svg
|
||||
|
||||
• **svg**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[mermaidAPI.ts:381](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L381)
|
Reference in New Issue
Block a user