json / src /lib /utils /core /addEdgeToGraph.ts
xinnni's picture
Upload 146 files
f909d7c verified
raw
history blame contribute delete
No virus
233 Bytes
import { Graph } from "../json/jsonParser";
export const addEdgeToGraph = (graph: Graph, from: string, to: string) => {
const newEdge = {
id: `e${from}-${to}`,
from: from,
to: to,
};
graph.edges.push(newEdge);
};