Skip to content

Instantly share code, notes, and snippets.

@realFranco
Created November 27, 2021 15:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save realFranco/2aed83e80f0a7ca0fe15f652886bb3a8 to your computer and use it in GitHub Desktop.
Save realFranco/2aed83e80f0a7ca0fe15f652886bb3a8 to your computer and use it in GitHub Desktop.
Traverse into one element to another #jArchi
// Naive Graph Traversing.
console.log("edit a property from a relation");
$("#id-733e2449d19b455db12241633b28cdab").prop("top_bottom", 0);
$("#id-733e2449d19b455db12241633b28cdab").prop("bottom_top", 0);
console.log("every input relation from the current element");
$(ID).inRels().each(function(relation) {
if (relation.name){
console.log(relation);
console.log(relation.id);
console.log(relation.name);
console.log(relation.prop("top_bottom"));
console.log(relation.prop("bottom_top"));
//
console.log("source: " + relation.source);
console.log("source id: " + relation.source.id);
console.log("target: " + relation.target);
console.log("target id: " + relation.target.id);
}
});
console.log("END\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment