docs: function() {
          var numSeg = this.components.length - 1;
          var segments = new Array(numSeg), point1, point2;
          for(var i=0; i<numSeg; ++i) {
              point1 = this.components[i];
              point2 = this.components[i + 1];
              if(point1.x < point2.x) {
                  segments[i] = {
                      x1: point1.x,
                      y1: point1.y,
                      x2: point2.x,
                      y2: point2.y
                  };
              } else {
                  segments[i] = {
                      x1: point2.x,
                      y1: point2.y,
                      x2: point1.x,
                      y2: point1.y
                  };
              }
          }
          // more efficient to define this somewhere static
          function byX1(seg1, seg2) {
              return seg1.x1 - seg2.x1;
          }
          return segments.sort(byX1);
      }