docs: function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {
      var keyAttr = orient === 'vertical' ? 'x' : 'y';
      zrUtil.each(nodesByBreadth, function (nodes) {
          nodes.sort(function (a, b) {
              return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];
          });
          var nodeX;
          var node;
          var dy;
          var y0 = 0;
          var n = nodes.length;
          var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';
          for (var i = 0; i < n; i++) {
              node = nodes[i];
              dy = y0 - node.getLayout()[keyAttr];
              if (dy > 0) {
                  nodeX = node.getLayout()[keyAttr] + dy;
                  orient === 'vertical'
                      ? node.setLayout({x: nodeX}, true)
                      : node.setLayout({y: nodeX}, true);
              }
              y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;
          }
          var viewWidth = orient === 'vertical' ? width : height;
          // If the bottommost node goes outside the bounds, push it back up
          dy = y0 - nodeGap - viewWidth;
          if (dy > 0) {
              nodeX = node.getLayout()[keyAttr] - dy;
              orient === 'vertical'
                  ? node.setLayout({x: nodeX}, true)
                  : node.setLayout({y: nodeX}, true);
  
              y0 = nodeX;
              for (i = n - 2; i >= 0; --i) {
                  node = nodes[i];
                  dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;
                  if (dy > 0) {
                      nodeX = node.getLayout()[keyAttr] - dy;
                      orient === 'vertical'
                          ? node.setLayout({x: nodeX}, true)
                          : node.setLayout({y: nodeX}, true);
                  }
                  y0 = node.getLayout()[keyAttr];
              }
          }
      });
  }