aboutsummaryrefslogtreecommitdiff
path: root/assets/js/heatmap.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/heatmap.js')
-rw-r--r--assets/js/heatmap.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/assets/js/heatmap.js b/assets/js/heatmap.js
index 34b0359..00dab42 100644
--- a/assets/js/heatmap.js
+++ b/assets/js/heatmap.js
@@ -1,10 +1,10 @@
function calendarHeatmap() {
// defaults
- var width = 750;
- var height = 110;
- var legendWidth = 150;
+ var width = Number($(document).width()) - 72;
+ var height = 7.5 * (Number($(document).width()) / 70 + 2);
+ var legendWidth = 0;
var selector = 'body';
- var SQUARE_LENGTH = 11;
+ var SQUARE_LENGTH = Number($(document).width()) / 70;
var SQUARE_PADDING = 2;
var MONTH_LABEL_PADDING = 6;
var now = moment().endOf('day').toDate();
@@ -152,7 +152,8 @@ function calendarHeatmap() {
.attr('width', width)
.attr('class', 'calendar-heatmap')
.attr('height', height)
- .style('padding', '36px');
+ .style('padding', '36px')
+ .style('text-align', 'center');
dayRects = svg.selectAll('.day-cell')
.data(dateRange); // array of days for the last yr