Skip to content

Commit

Permalink
chore: Defer elk loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Feb 16, 2023
1 parent 8df965b commit 0375047
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { log } from '../../../logger';
import { setupGraphViewbox } from '../../../setupGraphViewbox';
import common, { evaluate } from '../../common/common';
import { interpolateToCurve, getStylesFromArray } from '../../../utils';
import ELK from 'elkjs';

import ELK from 'elkjs/lib/elk.bundled.js';
const elk = new ELK();
let elk;

const portPos = {};

Expand Down Expand Up @@ -766,6 +766,9 @@ const insertChildren = (nodeArray, parentLookupDb) => {
*/

export const draw = async function (text, id, _version, diagObj) {
if (!elk) {
elk = new ELK();
}
// Add temporary render element
diagObj.db.clear();
nodeDb = {};
Expand Down

0 comments on commit 0375047

Please sign in to comment.