Change future entries in heat map to be empty
This commit is contained in:
parent
8232a14518
commit
38744c81c5
3 changed files with 13 additions and 1 deletions
|
@ -284,7 +284,7 @@ class Repository(RepositoryParamResource):
|
||||||
found_dates['%s/%s' % (count.date.month, count.date.day)] = True
|
found_dates['%s/%s' % (count.date.month, count.date.day)] = True
|
||||||
|
|
||||||
# Fill in any missing stats with zeros.
|
# Fill in any missing stats with zeros.
|
||||||
for day in range(-31, MAX_DAYS_IN_3_MONTHS):
|
for day in range(1, MAX_DAYS_IN_3_MONTHS):
|
||||||
day_date = datetime.now() - timedelta(days=day)
|
day_date = datetime.now() - timedelta(days=day)
|
||||||
key = '%s/%s' % (day_date.month, day_date.day)
|
key = '%s/%s' % (day_date.month, day_date.day)
|
||||||
if not key in found_dates:
|
if not key in found_dates:
|
||||||
|
|
|
@ -15,3 +15,9 @@
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.heatmap-element .cal-heatmap-container svg .highlight {
|
||||||
|
fill: white;
|
||||||
|
stroke: #eee;
|
||||||
|
stroke-dasharray: 2;
|
||||||
|
}
|
|
@ -26,6 +26,11 @@ angular.module('quay').directive('heatmap', function () {
|
||||||
|
|
||||||
if (!cal) {
|
if (!cal) {
|
||||||
var start = moment().add($scope.startCount * 1, $scope.startDomain).toDate();
|
var start = moment().add($scope.startCount * 1, $scope.startDomain).toDate();
|
||||||
|
var highlight = [];
|
||||||
|
for (i = 0; i < 31; ++i) {
|
||||||
|
var d = moment().add('day', i).toDate();
|
||||||
|
highlight.push(d);
|
||||||
|
}
|
||||||
|
|
||||||
cal = new CalHeatMap();
|
cal = new CalHeatMap();
|
||||||
cal.init({
|
cal.init({
|
||||||
|
@ -40,6 +45,7 @@ angular.module('quay').directive('heatmap', function () {
|
||||||
displayLegend: false,
|
displayLegend: false,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
weekStartOnMonday: false,
|
weekStartOnMonday: false,
|
||||||
|
highlight: highlight,
|
||||||
legendColors: {
|
legendColors: {
|
||||||
empty: "#f4f4f4",
|
empty: "#f4f4f4",
|
||||||
min: "#c9e9fb",
|
min: "#c9e9fb",
|
||||||
|
|
Reference in a new issue