Update IntentInterestDataProcessor.
This commit is contained in:
Родитель
a4763f8d42
Коммит
988f9b437d
|
@ -69,10 +69,11 @@ TimelineDataProcessor.prototype = {
|
|||
return parseInt(dayCount) * 24 * 60 * 60 * 1000;
|
||||
},
|
||||
|
||||
_setMaxWeightAndDateCount: function(storedData, interest, newDayWeight) {
|
||||
_setMaxWeightAndDateCount: function(storedData, interest, newDayWeight, date) {
|
||||
if (!storedData[interest]["maxWeight"] ||
|
||||
newDayWeight > storedData[interest]["maxWeight"]) {
|
||||
storedData[interest]["maxWeight"] = newDayWeight;
|
||||
storedData[interest]["maxWeightDate"] = date;
|
||||
}
|
||||
storedData[interest]["dayCount"] =
|
||||
Object.keys(storedData[interest]["dates"]).length;
|
||||
|
@ -91,7 +92,7 @@ TimelineDataProcessor.prototype = {
|
|||
let visitCountSum = this._arraySum(domainsToCountMap);
|
||||
storedData[interest]["dates"][day] =
|
||||
{x: this._daysPostEpochToDate(day), size: visitCountSum, domainList: domainsToCountMap};
|
||||
this._setMaxWeightAndDateCount(storedData, interest, visitCountSum);
|
||||
this._setMaxWeightAndDateCount(storedData, interest, visitCountSum, day);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -151,6 +152,9 @@ WeightIntensityDataProcessor.prototype = {
|
|||
}
|
||||
storedData["interests"][sortedByDayCount[i]["category"]]["x"] = rankDayCount;
|
||||
storedData["interests"][sortedByWeights[i]["category"]]["y"] = rankMaxWeight;
|
||||
|
||||
storedData["interests"][sortedByWeights[i]["category"]]["maxWeightDate"] = sortedByWeights[i]["maxWeightDate"];
|
||||
storedData["interests"][sortedByWeights[i]["category"]]["dates"] = sortedByWeights[i]["dates"];
|
||||
}
|
||||
this._setXYMaxMin(storedData);
|
||||
});
|
||||
|
@ -169,6 +173,10 @@ IntentInterestDataProcessor.prototype = {
|
|||
consume: function(bucketData) {
|
||||
DataProcessorHelper.initChartInStorage("intentInterestData");
|
||||
DataProcessorHelper.iterateOverTypeNamespace(bucketData, storage.chartData.intentInterestData, (bucketData, storedData) => {
|
||||
if (!storedData["interests"]) {
|
||||
storedData["interests"] = {};
|
||||
}
|
||||
|
||||
let intentX = bucketData["xMin"];
|
||||
let intentY = bucketData["yMax"];
|
||||
let interestX = bucketData["xMax"];
|
||||
|
|
Загрузка…
Ссылка в новой задаче