bark
bark copied to clipboard
Helper functions
A collection of syntactic sugar functions to help make repetitive task easier. A couple of examples of what these might be called:
-
isDescendantOf
-
isChildOf
-
isSiblingOf
-
isRoot
-
isLeaf
The collection could also expose internal utility functions we are already using inside of the extension:
-
path_from_depth
-
increment_path
I would also add a findLowestCommonAncestor
method. LCA is a very common operation on graphs and the whole tree spanning from the LCA to the leaves (returned by findAncestors
) might not be needed or might be so large it has a noticeable impact in performance.
I would like to add a findLeafs
helper
I would like to add a
findLeafs
helper
Could you expand on that? Would that be different to what findDescendants
is doing?
I would like to add a
findLeafs
helperCould you expand on that? Would that be different to what
findDescendants
is doing?
e.x:
lvl1->lvl2.1->lvl3.1
|->lvl2.2->lvl3.2
findDescendants
gets all descendants.
findDescendants
on lvl1 would return lvl2.1 and lvl2.2 also if I am not mistaken (as well as lvl3).
findLeafs
would only return lvl3.1 and lvl3.2
**leaves is the correct plural of leaf so findLeaves I guess🙂
I would like to add a
findLeafs
helperCould you expand on that? Would that be different to what
findDescendants
is doing?e.x: lvl1->lvl2.1->lvl3.1 |->lvl2.2->lvl3.2
findDescendants
gets all descendants.findDescendants
on lvl1 would return lvl2.1 and lvl2.2 also if I am not mistaken (as well as lvl3).findLeafs
would only return lvl3.1 and lvl3.2**leaves is the correct plural of leaf so findLeaves I guess🙂
Ah yes, thank you! I get it now. I'll add it to the list, although ideally it should be possible to do if the results can filtered. (Currently not the case but it would be nicer if you could just filter leaves while querying the database)