Skip to content

Running/Executing the file #5

Answered by s0l0ist
cpretzer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @cpretzer, the examples are to show you how to run an example JS/TS file, but they make a lot of assumptions about the runtime which will not work out of the box (mainly used in my development). There's no command to execute all the examples at this time. I'm working on improving this repo.

Here's a basic example of using node (v20.16.0) which will position and render the graph and save it to a file so you can view it locally:

Local rendering

const fs = require("node:fs");
const { DirectedGraph } = require("@vizdom/vizdom-ts-node");

// Create a new graph
const graph = new DirectedGraph();

// Add vertices
const v0 = graph.new_vertex({
  render: {
    label: "Hello",
  },
});
const v1 = 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by s0l0ist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants