Colored error edge

This commit is contained in:
dwolfe884 2023-02-22 07:33:56 -06:00
parent ce396c6fd0
commit e780c4ce83
2 changed files with 2 additions and 2 deletions

View file

@ -106,7 +106,7 @@ function generatenodes(linenum, text, fromnode2, edgelabel) {
} }
if (!(whereto[0] in locations)) { if (!(whereto[0] in locations)) {
newnode = generateNewNode("```\nERROR: Jumping to non-existant\nlocation " + whereto[0].trim() + "\n```", -1, -1, 1); newnode = generateNewNode("```\nERROR: Jumping to non-existant\nlocation " + whereto[0].trim() + "\n```", -1, -1, 1);
var newedge = { "id": edgeid, "fromNode": nodeid - 2, "fromSide": "bottom", "toNode": newnode["id"], "toSide": "top", "label": "" }; var newedge = { "id": edgeid, "fromNode": nodeid - 2, "fromSide": "bottom", "toNode": newnode["id"], "toSide": "top", "label": "true", "color": "4" };
edges.push(newedge); edges.push(newedge);
nodes.push(newnode); nodes.push(newnode);
edgeid = edgeid + 1; edgeid = edgeid + 1;

View file

@ -106,7 +106,7 @@ function generatenodes(linenum: any, text: any, fromnode: any, edgelabel: string
//Make the error node //Make the error node
newnode = generateNewNode("```\nERROR: Jumping to non-existant\nlocation " + whereto[0].trim() + "\n```", -1, -1, 1) newnode = generateNewNode("```\nERROR: Jumping to non-existant\nlocation " + whereto[0].trim() + "\n```", -1, -1, 1)
//nodeid-2 refers to the ID of the node that generated the error //nodeid-2 refers to the ID of the node that generated the error
var newedge = {"id":edgeid,"fromNode":nodeid-2,"fromSide":"bottom","toNode":newnode['id'],"toSide":"top","label":""} var newedge = {"id":edgeid,"fromNode":nodeid-2,"fromSide":"bottom","toNode":newnode['id'],"toSide":"top","label":"true", "color":"4"}
edges.push(newedge) edges.push(newedge)
nodes.push(newnode) nodes.push(newnode)
edgeid = edgeid + 1 edgeid = edgeid + 1