message: added check for endless chain
diff: /**
  * @private
  */
  - function followLinks(pointGraph: PointGraph<IChainLink>, chainFound: { (chain: Partial<IChain>): void; }, chainNotFound?: { (path: IWalkPath): void; }) {
  + function followLinks(pointGraph: PointGraph<IChainLink>, chainFound: { (chain: Partial<IChain>, checkEndless: boolean): void; }, chainNotFound?: { (path: IWalkPath): void; }) {
  function followLink(currLink: IChainLink, chain: Partial<IChain>, firstLink: IChainLink) {
  followLink(values[0], chain, values[0]);
  if (chain.endless) {
  - chainFound(chain);
  + chainFound(chain, false);
  } else {
  //need to go in reverse
  chain.links.reverse();
  followLink(currLink, chain, firstLink);
  if (chain.links.length > 1) {
  - chainFound(chain);
  + chainFound(chain, true);
  } else {
  chainNotFound(chain.links[0].walkedPath);
  }
  return singleChain;
  }
  + /**
  + * @private
  + */
  + function linkEndpoint(link: IChainLink, beginning: boolean) {
  + let index = (beginning === link.reversed) ? 1 : 0;
  + return link.endPoints[index];
  + }
  +
  /**
  * Find paths that have common endpoints and form chains.
  *
  //follow paths to find endless chains
  followLinks(
  pointGraph,
  - function (chain: IChain) {
  + function (chain: IChain, checkEndless: boolean) {
  + if (checkEndless) {
  + chain.endless = measure.isPointEqual(linkEndpoint(chain.links[0], true), linkEndpoint(chain.links[chain.links.length - 1], false), opts.pointMatchingDistance);
  + } else {
  chain.endless = !!chain.endless;
  + }
  chainsByLayer[layer].push(chain);
  },
  function (walkedPath: IWalkPath) {
  