Construction
The nodes are a group / transform g,
containing a single a linking to itself
href='nodeID', then further
containing the visual elements.
<g transform="translate(x,y)">
<ellipse rx="R" />
<text>...</text>
</g>
- contains node in single
transformmatrix - makes it click-to-select via the anchor
:targetas getter, and feedback stylingwindow[location.hash.substring(1)]as getter
Edges are easier when undirected,
putting them before the nodes
in DOM order renders them underneath;
then any path,
line,
polyline
going from source to target position works.
For directed edges that should be styled as arrows,
the edge end-position has to be offset by
r*cos(a) / r*sin(a).