Update assets/js/components/diagram.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>pull/6079/head
parent
d184f45434
commit
f908bab51f
|
@ -1,6 +1,12 @@
|
||||||
|
// Memoize the mermaid module import
|
||||||
|
let mermaidPromise = null;
|
||||||
|
|
||||||
export default function Diagram({ component }) {
|
export default function Diagram({ component }) {
|
||||||
// Import mermaid.js module
|
// Import mermaid.js module (memoized)
|
||||||
import('mermaid').then(({ default: mermaid }) => {
|
if (!mermaidPromise) {
|
||||||
|
mermaidPromise = import('mermaid');
|
||||||
|
}
|
||||||
|
mermaidPromise.then(({ default: mermaid }) => {
|
||||||
// Configure mermaid with InfluxData theming
|
// Configure mermaid with InfluxData theming
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
startOnLoad: false, // We'll manually call run()
|
startOnLoad: false, // We'll manually call run()
|
||||||
|
|
Loading…
Reference in New Issue