An interactive version of a Reingold–Tilford tree. Click on the nodes to expand or collapse. From http://bl.ocks.org/mbostock/4339083
Added search, expand and styling of results and its ancestors. Visible from http://bl.ocks.org/PBrockmann/0f22818096428b12ea23
Thank you for sharing your approach. Works really well with small data sets. A suggestion on reducing the search time . Since you are already doing a tree search for populating the names under function select2DataCollectName, you may as well store the each node object itself . Then we have a contiguous list of all node objects (not just names). At this point the parent information is not populated but since the list objects are pointers to the root object hence they will get automatically updated once the update(root) function executes. So the search string can be compared to the list using perhaps a statement like found_object=tmp2[tmp2.findIndex(o => o.name == 'animate')] where tmp2 is the list of node objects.
The function 'searchTree' can then be called but need only execute the 'while loop' since node object is already isolated and parent information can be retrieved from each node successively. The first 4 lines of function 'searchTree' can hence be indented out . Assuming indexed search will be faster than sequential linked list search, this should save some time.