I have an odd problem that maybe is simply my lacking experience, maybe you can give me some clues.
I'm trying to create a dynamic mermaid diagram but somehow somewhere along the way in between my mySQL database and the diagram rendering, quotes and break-tags are introduced into my code, and diagram rendering fails.
this is the code block where I'm trying to display the diagram:
Got it, took me a little, you need to run mermaid after server connect loads, otherwise nothing will be rendered as there's no data yet..
After reading this: https://mermaid.js.org/config/usage.html
Where did you get the mermaid definition code from?
Was it an HTML source?
Could the BR tags have been embedded in the source during a copy/paste??
Try examining the content of the actual DB record to see if the BR tags are there in the data
Easy enough to remove them, just apply the stripTags formatter to the spektrum output i.e. serverconnect1.data.query_spektrum[0].spektrum.stripTags()
so I'm a step further... if I run mermaid.run() via console it works. so there seems to be something wrong with event handling. I'm considering using a timer instead, but that's maybe a stupid solution. wappler definitely somehow adds break tags. my markup code is correct, if I run mermaid.run() manually, the diagram is rendered perfectly.
this is using the server connect: success event. maybe that's the wrong event to use?
maybe I wasn’t clear. the diagram is only rendered when I run mermaid.run() manually. calling it via dynamic event doesn’t work. so as it is, the website doesn’t work the way it is supposed to.
maybe I’m using the flow wrong? I’m using run > runJS > function name: mermaid function: run().