feat: Remove direct file dependency of mermaid from elk, by using peerDependency.

This commit is contained in:
Sidharth Vinod
2024-05-22 17:01:34 +05:30
parent aa63f320f8
commit 5b66810646
12 changed files with 120 additions and 57 deletions

View File

@@ -0,0 +1,17 @@
import type { LayoutLoaderDefinition } from 'mermaid';
const loader = async () => await import(`./render.js`);
const algos = ['elk.stress', 'elk.force', 'elk.mrtree', 'elk.sporeOverlap'];
export const layouts: LayoutLoaderDefinition[] = [
{
name: 'elk',
loader,
algorithm: 'elk.layered',
},
...algos.map((algo) => ({
name: algo,
loader,
algorithm: algo,
})),
];