Are inline themes supported? #4
-
First off, thanks for a great library. It's really easy to use, and solves the sticky problem of live updates that's so difficult when trying to call mermaid.js directly. I have no trouble at all rendering diagrams using the library, but I'm running into a problem when trying to apply a simple inline them. I've added the following to the beginning of my diagram definition:
With that theme definition, I just get the full diagram definition rendered as text in the page inside a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hi Josh! Great to hear that you find Blazorade Mermaid is helpful! One of the key principles of Blazorade Mermaid is that anything you can do with Mermaid in the "traditional" way using So, if you can't use custom themes as documented on the Mermaid site, then that's is a bug in Blazorade Mermaid. Theming support is one of the future development efforts I already have filed in #1. Now you helped me to get that list prioritized. Thank you! I'll focus on theming support in the future development efforts. Please consider following #1 to get updates on how that is progressing. If this is OK with you, I'll close this discussion, unless you have anything else you would like to add? Of course you can also add your input to the theming support issue #1. |
Beta Was this translation helpful? Give feedback.
-
OK, so I got the problem reproduced with your PR. Thanks again. That was actually quite an interesting bug. It might even be a bug in Mermaid itself, but I haven't yet tried to reproduce the bug with standard HTML and JS. Anyway, this is now fixed. What I did was that the JavaScript component in Blazorade Mermaid keeps track of how many times it has rendered a diagram. If no diagrams have been rendered, it adds a temporary simple diagram without inline themes to the DOM, renders that, and them removes it from the DOM. You can't even see that it is added and removed. This workaround seems to work with all of the different cases I tried. Also the changes that you sent in your PR are fixed. I published a new version of Blazorade Mermaid to Nuget, v1.1.1. I'll close this discussion if you confirm that your problems are also fixed now. |
Beta Was this translation helpful? Give feedback.
OK, so I got the problem reproduced with your PR. Thanks again. That was actually quite an interesting bug. It might even be a bug in Mermaid itself, but I haven't yet tried to reproduce the bug with standard HTML and JS.
Anyway, this is now fixed. What I did was that the JavaScript component in Blazorade Mermaid keeps track of how many times it has rendered a diagram. If no diagrams have been rendered, it adds a temporary simple diagram without inline themes to the DOM, renders that, and them removes it from the DOM. You can't even see that it is added and removed.
This workaround seems to work with all of the different cases I tried. Also the changes that you sent in your PR are fixed.
I…