_getForceContribution(parentBranch, node) {
    // we get no force contribution from an empty region
    if (parentBranch.childrenCount > 0) {
      // get the distance from the center of mass to the node.
      const dx = parentBranch.centerOfMass.x - node.x;
      const dy = parentBranch.centerOfMass.y - node.y;
      const distance = Math.sqrt(dx * dx + dy * dy);

      // BarnesHutSolver condition
      // original condition : s/d < theta = passed  ===  d/s > 1/theta = passed
      // calcSize = 1/s --> d * 1/s > 1/theta = passed
      if (distance * parentBranch.calcSize > this.thetaInversed) {
        this._calculateForces(distance, dx, dy, node, parentBranch);
      } else {
        // Did not pass the condition, go into children if available
        if (parentBranch.childrenCount === 4) {
          this._getForceContributions(parentBranch, node);
        } else {
          // parentBranch must have only one node, if it was empty we wouldnt be here
          if (parentBranch.children.data.id != node.id) {
            // if it is not self
            this._calculateForces(distance, dx, dy, node, parentBranch);
          }
        }
      }
    }
  }
This function traverses the barnesHutTree. It checks when it can approximate distant nodes with their center of mass.
If a region contains a single node, we check if it is not itself, then we apply the force.
@param {object} parentBranch
@param {Node} node
@private