Render a term as an SVG tree. This renderer is intended to illustrate the shape of terms or display a simple parse tree.
This renderer is also an illustration of using a JavaScript library and SVG inside rendered elements. Note that the use of RequireJS avoids loading the library multiple times as well as poluting the namespace.
Note that while the script is being evaluated, `$.ajaxScript` is a
jQuery object pointing to the executing script. This is used to find the
span
element without using an id
attribute. Using id
is
undesirable as it is hard to guarantee their uniqueness. However, we
must find the desired element immediately and not in the RequireJS
callback, so we need to put it in a variable and scope the whole thing
in a function to avoid conflicts. JavaScript is fun!
false
, do not render lists.call(NodeFilter, Term, Label, Children)
to extract the label and children of a term. Operates
on terms for which this call succeeds on the top node.
If the call fails on a child, the child is rendered as
a term.call(Closure, Term, JSON)
, where the called closure must return
a nested dict and each node contains:
foreignObject
. The
Trident engine used by IE does not support foreignObject though
:-(