d2js: fix browser worker elk check

This commit is contained in:
delfino 2025-02-24 00:26:34 +00:00
parent 1e36752194
commit 1417ded66a
No known key found for this signature in database
GPG key ID: CFE0DD6A770BF48C

View file

@ -38,11 +38,6 @@ export function setupMessageHandler(isNode, port, initWasm) {
const layout = await elk.layout(elkGraph2);
globalThis.elkResult = layout;
}
const elkGraph = await d2.getELKGraph(JSON.stringify(data));
const elkGraph2 = JSON.parse(elkGraph).data;
const layout = await elk.layout(elkGraph2);
globalThis.elkResult = layout;
const result = await d2.compile(JSON.stringify(data));
const response = JSON.parse(result);
if (response.error) throw new Error(response.error.message);