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
Is it possible to render in node.js using canvas/skia-canvas? I'm trying to do something like this but it complains about missing 'window':
main.mjs
import { Network } from 'vis-network'; import { DataSet } from 'vis-data'; import { Canvas } from 'skia-canvas'; const nodes = new DataSet([ { id: 1, label: "Node 1" }, { id: 2, label: "Node 2" }, { id: 3, label: "Node 3" }, { id: 4, label: "Node 4" }, { id: 5, label: "Node 5" }, ]); // create an array with edges const edges = new DataSet([ { from: 1, to: 3 }, { from: 1, to: 2 }, { from: 2, to: 4 }, { from: 2, to: 5 }, { from: 3, to: 3 }, ]); // create a network const container = new Canvas(400, 400); const data = { nodes: nodes, edges: edges, }; const options = {}; new Network(container, data, options); await canvas.saveAs("graph.png", {density:2})
node_modules/vis-network/peer/umd/vis-network.js:26803 if (window !== undefined) { ^ ReferenceError: window is not defined (...) Node.js v22.12.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is it possible to render in node.js using canvas/skia-canvas? I'm trying to do something like this but it complains about missing 'window':
main.mjs
The text was updated successfully, but these errors were encountered: