static getImpactByNodeId(layoutShiftEvents) {
    /** @type {Map<number, number>} */
    const impactByNodeId = new Map();

    for (const event of layoutShiftEvents) {
      if (!event.impactedNodes) continue;

      let totalAreaOfImpact = 0;
      /** @type {Map<number, number>} */
      const pixelsMovedPerNode = new Map();

      for (const node of event.impactedNodes) {
        if (!node.node_id || !node.old_rect || !node.new_rect) continue;

        const oldRect = RectHelpers.traceRectToLHRect(node.old_rect);
        const newRect = RectHelpers.traceRectToLHRect(node.new_rect);
        const areaOfImpact = RectHelpers.getRectArea(oldRect) +
          RectHelpers.getRectArea(newRect) -
          RectHelpers.getRectOverlapArea(oldRect, newRect);

        pixelsMovedPerNode.set(node.node_id, areaOfImpact);
        totalAreaOfImpact += areaOfImpact;
      }

      for (const [nodeId, pixelsMoved] of pixelsMovedPerNode.entries()) {
        let clsContribution = impactByNodeId.get(nodeId) || 0;
        clsContribution += (pixelsMoved / totalAreaOfImpact) * event.weightedScore;
        impactByNodeId.set(nodeId, clsContribution);
      }
    }

    return impactByNodeId;
  }
Each layout shift event has a 'score' which is the amount added to the CLS as a result of the given shift(s).
We calculate the score per element by taking the 'score' of each layout shift event and
distributing it between all the nodes that were shifted, proportianal to the impact region of
each shifted element.

@param {LayoutShiftEvent[]} layoutShiftEvents
@return {Map<number, number>}