docs: function () {
      // Thigs to perform after nodes are repositioned on screen
      var afterReposition = function() {
        if (options.fit) {
          options.cy.fit(options.eles.nodes(), options.padding);
        }
  
        if (!ready) {
          ready = true;
          self.cy.one('layoutready', options.ready);
          self.cy.trigger({type: 'layoutready', layout: self});
        }
      };
      
      var ticksPerFrame = self.options.refresh;
      var isDone;
  
      for( var i = 0; i < ticksPerFrame && !isDone; i++ ){
        isDone = self.stopped || self.layout.tick();
      }
      
      // If layout is done
      if (isDone) {
        // If the layout is not a sublayout and it is successful perform post layout.
        if (layout.checkLayoutSuccess() && !layout.isSubLayout) {
          layout.doPostLayout();
        }
        
        // If layout has a tilingPostLayout function property call it.
        if (layout.tilingPostLayout) {
          layout.tilingPostLayout();
        }
        
        layout.isLayoutFinished = true;
        
        self.options.eles.nodes().positions(getPositions);
        
        afterReposition();
        
        // trigger layoutstop when the layout stops (e.g. finishes)
        self.cy.one('layoutstop', self.options.stop);
        self.cy.trigger({ type: 'layoutstop', layout: self });
  
        if (frameId) {
          cancelAnimationFrame(frameId);
        }
        
        ready = false;
        return;
      }
      
      var animationData = self.layout.getPositionsData(); // Get positions of layout nodes note that all nodes may not be layout nodes because of tiling
      
      // Position nodes, for the nodes whose id does not included in data (because they are removed from their parents and included in dummy compounds)
      // use position of their ancestors or dummy ancestors
      options.eles.nodes().positions(function (ele, i) {
        if (typeof ele === "number") {
          ele = i;
        }
        var theId = ele.id();
        var pNode = animationData[theId];
        var temp = ele;
        // If pNode is undefined search until finding position data of its first ancestor (It may be dummy as well)
        while (pNode == null) {
          pNode = animationData[temp.data('parent')] || animationData['DummyCompound_' + temp.data('parent')];
          animationData[theId] = pNode;
          temp = temp.parent()[0];
          if(temp == undefined){
            break;
          }
        }
        if(pNode != null){
          return {
            x: pNode.x,
            y: pNode.y
          };
        }
        else{
          return {
            x: ele.x,
            y: ele.y
          };
        }
      });
  
      afterReposition();
  
      frameId = requestAnimationFrame(iterateAnimated);
    }