.PathSegment(go.SegmentType.Line, 0, 0));
    fig.add(new go.PathSegment(go.SegmentType.Line, w, 0).close());
    geo.spot1 = go.Spot.TopLeft;
    geo.spot2 = new go.Spot(1, 1, 0, Math.min(-d + 2, 0));
    return geo;
  });

  go.Shape.defineFigureGenerator('EndForEach', (shape, w, h) => {
    var param1 = shape ? shape.parameter1 : NaN; // length of triangular area in direction that it is pointing
    if (isNaN(param1)) param1 = 10;
    var d = Math.min(h / 2, param1);
    var geo = new go.Geometry();
    