Skip to content

Commit

Permalink
fix: mermaid loading diagram error
Browse files Browse the repository at this point in the history
avoid use of (deprecated) mermaidAPI
  • Loading branch information
bsorrentino committed Jul 19, 2024
1 parent 53dfb22 commit 5ccef45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions server-jetty/src/main/js/src/lg4j-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { html, svg, LitElement } from 'lit';
import { Task } from '@lit/task'
import mermaid from 'mermaid';
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
const mermaidAPI = mermaid.mermaidAPI;
//const mermaidAPI = mermaid.mermaidAPI;


const renderSVG = (diagram) => html`
Expand All @@ -20,7 +20,7 @@ export class LG4jMermaid extends LitElement {
constructor() {
super();

mermaidAPI.initialize({
mermaid.initialize({
logLevel: 'none',
startOnLoad: false,
});
Expand All @@ -31,7 +31,7 @@ export class LG4jMermaid extends LitElement {

#mermaidTask = new Task(this, {
task: async ([textContent], { signal }) => {
return await mermaidAPI.render(
return await mermaid.render(
`graph-${Date.now()}-${Math.floor(Math.random() * 10000)}`,
textContent);

Expand Down
4 changes: 2 additions & 2 deletions server-jetty/src/main/js/src/twlit.js

Large diffs are not rendered by default.

0 comments on commit 5ccef45

Please sign in to comment.