We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"elkjs": "^0.9.3",
Official sample code copied from readme page:
const ELK = require('elkjs') const elk = new ELK() const graph = { id: "root", layoutOptions: { 'elk.algorithm': 'layered' }, children: [ { id: "n1", width: 30, height: 30 }, { id: "n2", width: 30, height: 30 }, { id: "n3", width: 30, height: 30 } ], edges: [ { id: "e1", sources: [ "n1" ], targets: [ "n2" ] }, { id: "e2", sources: [ "n1" ], targets: [ "n3" ] } ] } elk.layout(graph) .then(console.log) .catch(console.error)
It works very well.
If I specify a worker url:
const ELK = require("elkjs"); const Worker = require("web-worker"); const workers = new Set(); const elk = new ELK({ workerUrl: require.resolve("elkjs/lib/elk-worker.min.js"), }); const graph = { id: "root", layoutOptions: { "elk.algorithm": "layered" }, children: [ { id: "n1", width: 30, height: 30 }, { id: "n2", width: 30, height: 30 }, { id: "n3", width: 30, height: 30 }, ], edges: [ { id: "e1", sources: ["n1"], targets: ["n2"] }, { id: "e2", sources: ["n1"], targets: ["n3"] }, ], }; elk .layout(graph) .then((s) => { console.log(s); workers.forEach((worker) => worker.terminate()); }) .catch(console.error);
It works but it does NOT exit.
Which means the worker is still active.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
"elkjs": "^0.9.3",
Official sample code copied from readme page:
It works very well.
If I specify a worker url:
It works but it does NOT exit.
Which means the worker is still active.
The text was updated successfully, but these errors were encountered: