Endpoints allow you to attach arrows to edgestyles.
Each edgestyle has a from and to endpoint. An endpoint starts at a respective point (typically the anchor point of the line style) and is rotated based on a reference point.
Each endpoint also has a length, which is the size of the arrow head. This length is necessary so that each edgestyle can adjust itself to accomodate the arrowhead. They have a starting point at a given anchor and are rotated against a reference point.
Thinkmap has a series of built in arrowtypes that you can use but you can also create you own as well.
When creating your own arrow head, the tip of the arrow must be positioned at 0,0 and the end of the arrow must be along the positive x-axis i.e. (<‐). You must also know the length of the arrow head in the positive x axis so line styles are aware of the size and can adjust itself accordingly.
Endpoints are implemented as an SVG use element that is appended to a linestyle. When creating your own arrow head, the arrowhead you create will be appeneded to the SVG defs of any Thinkmap display. Each edge that uses an endpoint will have a use element, which points to this arrow head definition.
Because an endpoint is a USE element, you can individually style certain properties of the endpoint with CSS. To facilitate this, each use element has two css classes you can make reference to: (endpointFrom and endpointTo). Therefore you can style certain characteriscs like so:
.endpointFrom{
fill: blue;
stroke: blue;
}
.endpointTo{
fill: none;
stroke: green;
}
thinkmap.display.edgestyle.linear()
.endpointFrom(thinkmap.display.endpoint.none())
.endpointTo(thinkmap.display.endpoint.nonde())
thinkmap.display.edgestyle.linear()
.endpointFrom(thinkmap.display.endpoint.arrow())
.endpointTo(thinkmap.display.endpoint.arrow())
var customEndpoint = thinkmap.display.endpoint.create(10,'arrow.svg');
thinkmap.display.edgestyle.linear()
.endpointFrom(customEndpoint)
.endpointTo(customEndpoint);