Button("Adding to the graph", async () => {
const graph = await gxr().graph();
graph.clear();
graph.add("A");
graph.add("B", { category: "B", properties: { age: "32" } });
graph.add("A", "B");
graph.add("X", "Y", "Z");
graph.add("B", "C", { relationship: "BC", properties: { since: 2010 } });
graph.add(["D", "E", "F"]);
graph.add(["G", "H", "I"], { category: "GHI" });
graph.add({ age: "23" });
graph.add({ id: "Person23", category: "Person", properties: { age: "23" } });
graph.add([{ id: "J", category: "J", properties: { age: 113 } }]);
graph.add([
{ age: Math.random() * 100 },
{ age: Math.random() * 100 },
{ age: Math.random() * 100 },
]);
graph.add(
[
{ age: Math.random() * 100 },
{ age: Math.random() * 100 },
{ age: Math.random() * 100 },
],
{ category: "Person" }
);
graph.add([
{ sourceId: "D", targetId: "E", relationship: "PRECEDES" },
{ sourceId: "E", targetId: "F", relationship: "PRECEDES" },
]);
console.log("Node count is correct", graph.nodes().length() === 21);
console.log("Edge count is correct", graph.edges().length() === 6);
})