sense-calendar-heatmap
Version:
Qlik Sense Visualization Extension with a diverging color scale. The values are displayed as colored cells per day. Days are arranged into columns by week, then grouped by month and years.
1 lines • 579 B
JavaScript
define(["./../external/d3/d3.min"],function(){"use strict";var e={format:d3.time.format("%Y-%m-%d"),dates:function(t){var a,n=[],r=new Date(t,0,1),o=0;do n.push({day:a=r.getDay(),week:o,month:r.getMonth(),Date:e.format(r)}),r.setDate(r.getDate()+1),6===a&&o++;while(r.getFullYear()===t);return n},months:function(e){var t,a,n,r,o=[],i=new Date(e,0,1),s=0;do{a=i.getDay(),n=s,t=i.getMonth();do r=i.getDay(),6===r&&s++,i.setDate(i.getDate()+1);while(i.getMonth()===t);o.push({firstDay:a,firstWeek:n,lastDay:r,lastWeek:6===r?s-1:s})}while(i.getFullYear()===e);return o}};return e});