philogb/jit — pull request #93 by yaron-gilboa (2011-11-15 13:57:33+00:00)
Title: Update Source/Loader/Loader.js

Problem description:
When trying to load a tree with a single node (only the root node), nothing is drawn.

Problem cause:
Loader determines if the json represents a graph or a tree by examining the received json - if it is an array, it
is considered to be a graph, otherwise a tree. In case of a tree, Loader creates adjacencies (and not nodes),
which in turn creates the nodes. When the root node has no children, no adjacencies are created, thus the
root is also not created.

Solution description:
In case of a tree, Loader checks 1st if the root json node has children. If it does, Loader works as before. If
not, the root is explicitly created.