forked from OpenTreeOfLife/opentree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
argus-json-notes.txt
33 lines (25 loc) · 1.55 KB
/
argus-json-notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Argus renders JSON (from taxomachine and treemachine).
It expects two objects:
1. a tree
2. object with a 'domsource' attribute (e.g. {"domsource":"ottol"})
The tree is nested set of node description. Each node has the attributes:
"children" -> list of child nodes.
"nleaves" -> 0 for a leaf, # of descendant "leaves" for the node. Note that
the # of leaves refers to the # of leaves in the tree that has been
pruned to "maxnodedepth" (see below), not the # of nodes in the source
graph that are descendants of the node.
"nTipDescendants" -> 0 for a leaf, # of tips within the node's clade,
*excluding* the node itself. (In other words, this reflects the full
source graph, irrespective of "maxonodedepth".)
"name" -> string with the node's name.
"nodeid" -> string that is a node ID in the webservice that generated the JSON
this ID is not guaranteed to be stable (at least, I don't think it is)
across multiple instances of the service. Perhaps not even stable if the
neo4j db is recreated. Argus uses this to enable navigation by attaching a
callback that requests more of the tree starting at node that corresponds to
this nodeid.
In addition the root is expected to have:
"maxnodedepth" -> number of node levels that include their children.
When this JSON is retrieved on the client, it is deserialized by a "reviver"
function that converts some elements (those with the 'nodeid' attribute) from
simple objects to instances of the ArgusNode pseudo-class.