A curved edge style draws edges between two nodes as a bezier curve.
More specifically, this edge uses a control point to dictate the curves of the line. By default, each control point's value is calculated automatically by using the "axis" parameter to determine the best strategy.
You can change the control point calculation by setting the controlPoint function on this edge style.
display.template('edge').as(thinkmap.display.edgestyle.curved())
display.template('edge').as(
thinkmap.display.edgestyle
.curved()
.axis('y')
.anchorFrom(thinkmap.display.anchor.northSouth())
.anchorTo(thinkmap.display.anchor.northSouth())
);
display.template('edge').as(
thinkmap.display.edgestyle
.curved()
.controlPoint(function(cp, p1, p2, edge, node){
cp.x = (p1.x + p2.x) / 2;
cp.y = p1.y;
})
);
Sets the axis for determining which axis the control point should be placed perpendicularly. The default is 'x' which is most commonly used for trees that run along the x-axis
the axis value which is either 'x' or 'y'
Sets or returns the function used to calculate the control point
If you are using your own custom control point function, the first argument into your function is the control point which you will manipulate directly. The additional arguments will be the two anchorPoints of the edge, the edge itself, and the node for which side you are calculating.
the function used to calculate the control point
Sets or returns the weight to use for determining the curvature of this edge. This number should typically be somewhere between .5 and 1. The lower the number, the straighter the edges will be. The default is .75
the weight value
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