From 0dcca35ec29f2a95e0e6082ef3cf61c646a48287 Mon Sep 17 00:00:00 2001 From: Yokozuna59 Date: Sat, 20 Jan 2024 11:14:58 +0000 Subject: [PATCH] Update docs --- docs/config/setup/interfaces/mermaidAPI.RenderResult.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/config/setup/interfaces/mermaidAPI.RenderResult.md b/docs/config/setup/interfaces/mermaidAPI.RenderResult.md index aebd88b23..c468df243 100644 --- a/docs/config/setup/interfaces/mermaidAPI.RenderResult.md +++ b/docs/config/setup/interfaces/mermaidAPI.RenderResult.md @@ -14,6 +14,15 @@ • `Optional` **bindFunctions**: (`element`: `Element`) => `void` +Bind function to be called after the svg has been inserted into the DOM. +This is necessary for adding event listeners to the elements in the svg. + +```js +const { svg, bindFunctions } = mermaidAPI.render('id1', 'graph TD;A-->B'); +div.innerHTML = svg; +bindFunctions?.(div); // To call bindFunctions only if it's present. +``` + #### Type declaration ▸ (`element`): `void`