Show domains in timeline chart.

This commit is contained in:
Marina Samuel 2014-05-22 16:15:24 -04:00
Родитель bb2a83f20b
Коммит e67eb6e2ec
3 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -7,7 +7,12 @@ function TimelineChart() {
.transitionDuration(300); .transitionDuration(300);
this._chart.tooltipContent((key, y, e, graph) => { this._chart.tooltipContent((key, y, e, graph) => {
return "<h2>" + graph.point.size + (graph.point.size > 1 ? " visits" : " visit") + "</h2>"; let label = "";
for (let domain in graph.point.domainList) {
label += "<h3>" + domain + ": " + graph.point.domainList[domain] + " visit(s)</h3>"
}
label += "<h2>Total: " + graph.point.size + (graph.point.size > 1 ? " visits" : " visit") + "</h2>";
return label;
}); });
this._chart.xAxis.tickFormat((d) => { return d3.time.format('%x')(new Date(d)); }); this._chart.xAxis.tickFormat((d) => { return d3.time.format('%x')(new Date(d)); });

Просмотреть файл

@ -77,9 +77,10 @@ TimelineDataProcessor.prototype = {
storage.chartData.timelineData[type][namespace][interest] = {}; storage.chartData.timelineData[type][namespace][interest] = {};
storage.chartData.timelineData[type][namespace][interest]["dates"] = {}; storage.chartData.timelineData[type][namespace][interest]["dates"] = {};
} }
visitCountSum = this._arraySum(bucketData[day][type][namespace][interest]); let domainsToCountMap = bucketData[day][type][namespace][interest];
let visitCountSum = this._arraySum(domainsToCountMap);
storage.chartData.timelineData[type][namespace][interest]["dates"][day] = storage.chartData.timelineData[type][namespace][interest]["dates"][day] =
{x: this._daysPostEpochToDate(day), size: visitCountSum}; {x: this._daysPostEpochToDate(day), size: visitCountSum, domainList: domainsToCountMap};
this._setMaxWeightAndDateCount(type, namespace, interest, visitCountSum); this._setMaxWeightAndDateCount(type, namespace, interest, visitCountSum);
} }

Просмотреть файл

@ -56,7 +56,7 @@ function Controller(options={}) {
}); });
this._urlClassifier = new UrlClassifier(this._workers); this._urlClassifier = new UrlClassifier(this._workers);
this._dayBuffer = new DayBuffer(new Pipeline(this._rankers, this._hostStripper, this._dayBuffer = new DayBuffer(new Pipeline(this._rankers,
this._timelineDataProcessor, this._weightIntensityDataProcessor, this._timelineDataProcessor, this._weightIntensityDataProcessor,
this._intentInterestDataProcessor, this._dispatcher)); this._intentInterestDataProcessor, this._dispatcher));
this._processingHistory = false; this._processingHistory = false;