src/similarweb.js
/**
 * Calculate numbers in traffic data based on total number and percentage
 * @param {object} traffic Data structures that stores traffic data
 */
Calculate numbers in traffic data based on total number and percentage
@param {object} traffic Data structures that stores traffic data
Calculate numbers in traffic data based on total number and percentage @param { object } traffic Data structures that stores traffic data
function calculateTrafficNumbers(traffic) {
  console.log('Calculating traffic numbers...');
  if (!traffic.success) {
    console.log('Traffic data of this item is not complete.');
    return;
  }
  calculateNumberInRank(traffic.marketingMix.numbers[0], traffic.geographyRank);
  calculateNumberInRank(traffic.marketingMix.numbers[2], traffic.referralRank);
  calculateNumberInRank(traffic.marketingMix.numbers[3], traffic.socialRank);
  calculateNumberInRank(traffic.marketingMix.numbers[6], traffic.adRank);
}
function calculateTrafficNumbers ( traffic ) { console . log ( 'Calculating traffic numbers...' ) ; if ( ! traffic . success ) { console . log ( 'Traffic data of this item is not complete.' ) ; return ; } calculateNumberInRank ( traffic . marketingMix . numbers [ 0 ] , traffic . geographyRank ) ; calculateNumberInRank ( traffic . marketingMix . numbers [ 2 ] , traffic . referralRank ) ; calculateNumberInRank ( traffic . marketingMix . numbers [ 3 ] , traffic . socialRank ) ; calculateNumberInRank ( traffic . marketingMix . numbers [ 6 ] , traffic . adRank ) ; }
Calculate numbers in traffic data based on total number and percentage
 @param {object} traffic Data structures that stores traffic data
Calculate numbers in traffic data based on total number and percentage @param { object } traffic Data structures that stores traffic data
// calculate geography rank number // referral referral rank number // referral social rank number // referral geography rank number