mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-08 08:39:38 +02:00
Dynamic elk import
This commit is contained in:
@@ -9,7 +9,6 @@ import { log } from '../../../logger';
|
|||||||
import { setupGraphViewbox } from '../../../setupGraphViewbox';
|
import { setupGraphViewbox } from '../../../setupGraphViewbox';
|
||||||
import common, { evaluate } from '../../common/common';
|
import common, { evaluate } from '../../common/common';
|
||||||
import { interpolateToCurve, getStylesFromArray } from '../../../utils';
|
import { interpolateToCurve, getStylesFromArray } from '../../../utils';
|
||||||
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
||||||
|
|
||||||
let elk;
|
let elk;
|
||||||
|
|
||||||
@@ -767,6 +766,7 @@ const insertChildren = (nodeArray, parentLookupDb) => {
|
|||||||
|
|
||||||
export const draw = async function (text, id, _version, diagObj) {
|
export const draw = async function (text, id, _version, diagObj) {
|
||||||
if (!elk) {
|
if (!elk) {
|
||||||
|
const ELK = await import('elkjs/lib/elk.bundled.js');
|
||||||
elk = new ELK();
|
elk = new ELK();
|
||||||
}
|
}
|
||||||
// Add temporary render element
|
// Add temporary render element
|
||||||
|
Reference in New Issue
Block a user