A piped edge style draws its edges using only vertical or horizontal lines. It is ideal for tree-type layouts such as org-charts, site maps, and activity diagrams.
Piped Edges have a from and to direction. These values can be either x, y or a function that returns x or y on each redraw. By default, a piped edge has a from and to direction of x.
If both directions are x or y, then a pct is used to determine when the lines should change directions. By default, this is 50%. For example, if both directions are x, then a pct value of .5 means don't change directions (in this case, it would be y) until you have traveled 50% of the distance in the x direction of the two nodes. If the directions from and to are not the same, then this value is ignored.
Piped Edges also have a corner radius when changing directions. This value can be either a number or a function that returns a number on each call.
Piped Edges, by default, use the midpoint anchor (thinkmap.display.anchor.midpoint())
display.template('edge').as(thinkmap.display.edgestyle.piped())
display.template('edge').as(
thinkmap.display.edgestyle
.piped()
.fromDir('x')
.toDir('y')
);
display.template('edge').as(
thinkmap.display.edgestyle
.piped()
.radius(5)
.pct(.5)
);
The direction the edge's path will travel leaving the from node. This can be either x, y or a function that returns x or y on each redraw. By default, this value is x
the direction the edge's path will travel leaving the from node
Sets or returns the value used to calculate the percentage when changing directions for the case that from direction and to direction are both equal (e.g 'x','x' or 'y','y')
If the directions are not the same, this value is ignored.
the function or value used to calculate the point to change directions
Sets or returns the value used to determine the corner radius when lines change directions. The default value is 2.
If this value is a function, then the function will be called on each redraw and be passed the edge along with the from and to anchor points. This function must then return a number.
If this value is greater than half the distance traveled, the corner radius will be scaled so it is not greater than this value.
the radius of the curve when changing direcions
The direction the edge's path will travel entering the to node. This can be either x, y or a function that returns x or y on each redraw. By default, this value is x
the direction the edge's path will travel leaving the from node
Sets or gets the anchor used on the from node.
If arguments are passed in, they are used to set the anchor and the EdgeStyle is returned. If no arguments are passed in, the anchor function is returned.
the function used to calculate the edges from anchor point
Sets or gets the anchor used on the to node.
If arguments are passed in, they are used to set the anchor and the EdgeStyle is returned. If no arguments are passed in, the anchor function is returned.
the function used to calculate the edges 'from' anchor point
Sets or gets the endpoint used on the from node
If arguments are passed in, they are used to set the endpoint and the EdgeStyle is returned. If no arguments are passed in, the endpoint function is returned.
the function used to calculate the edges from endpoint
Sets or gets the endpoint used on the to node
If arguments are passed in, they are used to set the endpoint and the EdgeStyle is returned. If no arguments are passed in, the endpoint function is returned.
the function used to calculate the edges 'to' endpoint
This method is called by the display to render the edge. This is not meant to be called directly. When creating your own edge styles, you would implement this method yourself so that the display can render it onto an edge.
the display that will render the edge
the edge will be rendered by this edge style