Skip to content

Commit

Permalink
Merge pull request #1518 from mermaid-js/sidv/elkLoader
Browse files Browse the repository at this point in the history
feat: Add layout-elk
  • Loading branch information
ashishjain0512 authored Aug 28, 2024
2 parents 3fbe4a8 + d023a11 commit eaf8eb4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"vitest-dom": "^0.1.1"
},
"dependencies": {
"@mermaid-js/layout-elk": "^0.1.2",
"@mermaid-js/mermaid-zenuml": "^0.2.0",
"daisyui": "2.52.0",
"dayjs": "^1.11.7",
Expand Down
6 changes: 4 additions & 2 deletions src/lib/util/mermaid.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import mermaid from 'mermaid';
import type { MermaidConfig, RenderResult } from 'mermaid';
import elkLayouts from '@mermaid-js/layout-elk';
import zenuml from '@mermaid-js/mermaid-zenuml';
import type { MermaidConfig, RenderResult } from 'mermaid';
import mermaid from 'mermaid';

mermaid.registerLayoutLoaders(elkLayouts);
const init = mermaid.registerExternalDiagrams([zenuml]);

export const render = async (
Expand Down
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,14 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"

"@mermaid-js/layout-elk@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@mermaid-js/layout-elk/-/layout-elk-0.1.2.tgz#0255dfcf3c88cc84e2bead48d06b36b7ea0a0058"
integrity sha512-a5WbVHAXv+lMAeccex3zPwmJYmnuH8z7cdJkuunwzdhvmFKYwGPx7ggr2gIIxUR2lMMLALiEorwFx8/OAkrdUQ==
dependencies:
d3 "^7.9.0"
elkjs "^0.9.3"

"@mermaid-js/mermaid-zenuml@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@mermaid-js/mermaid-zenuml/-/mermaid-zenuml-0.2.0.tgz#6a418409804e25039d2a5c3ec7df0679cf53ed30"
Expand Down Expand Up @@ -2753,6 +2761,11 @@ electron-to-chromium@^1.4.668, electron-to-chromium@^1.5.4:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz#03bfdf422bdd2c05ee2657efedde21264a1a566b"
integrity sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==

elkjs@^0.9.3:
version "0.9.3"
resolved "https://registry.yarnpkg.com/elkjs/-/elkjs-0.9.3.tgz#16711f8ceb09f1b12b99e971b138a8384a529161"
integrity sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==

emoji-regex@^10.3.0:
version "10.3.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23"
Expand Down

0 comments on commit eaf8eb4

Please sign in to comment.