Package: thinkmap.display.anchor

Anchors allow you to choose how an edge visually connects to the nodes it links.

There are a number of built-in anchor functions that can be composed to form more complicated anchoring strategies.

An anchor is a function that takes a node and an edge, and returns a function that is used to calculate the anchor point. That function takes the anchor point - the point that the function will manipulate and a reference point, which is used by the anchor function to determine where to locate the anchor.

Examples:

Create a linear edge style where lines are drawn from upper-left to upper-left of nodes. thinkmap.display.edgestyle.linear( thinkmap.display.anchor.percentage(0,0), thinkmap.display.anchor.percentage(0,0) )
Create a linear edge style where lines are drawn from the left or right midpoints of the nodes. thinkmap.display.edgestyle.linear( thinkmap.display.anchor.eastWest(), thinkmap.display.anchor.eastWest() )

Functions