dist/cytoscape.esm.js
function byGroup() {
    var nodes = this.spawn();
    var edges = this.spawn();

    for (var i = 0; i < this.length; i++) {
      var ele = this[i];

      if (ele.isNode()) {
        nodes.merge(ele);
      } else {
        edges.merge(ele);
      }
    }

    return {
      nodes: nodes,
      edges: edges
    };
  }
function byGroup() {
    var nodes = this.spawn();
    var edges = this.spawn();

    for (var i = 0; i < this.length; i++) {
      var ele = this[i];

      if (ele.isNode()) {
        nodes.merge(ele);
      } else {
        edges.merge(ele);
      }
    }

    return {
      nodes: nodes,
      edges: edges
    };
  }
function byGroup ( ) { var nodes = this . spawn ( ) ; var edges = this . spawn ( ) ; for ( var i = 0 ; i < this . length ; i ++ ) { var ele = this [ i ] ; if ( ele . isNode ( ) ) { nodes . merge ( ele ) ; } else { edges . merge ( ele ) ; } } return { nodes : nodes , edges : edges } ; }
internal helper to get nodes and edges as separate collections with single iteration over elements
internal helper to get nodes and edges as separate collections with single iteration over elements