_includes/heatmap.js in jekyll-zeta-0.7.2 vs _includes/heatmap.js in jekyll-zeta-0.7.3

- old
+ new

@@ -32,12 +32,33 @@ } if (yearCfg[preYear]) { arr.push(getYearData(preYear )) } - Promise.all(arr).then(d2=>{ - updateCell({...d2[0],...d2[1]}); + Promise.all(arr).then(alldata=>{ + let combineData = {}; + let d1 = alldata[0]; + let d2 = alldata[1]; + + for (const key in d1) { + if (Object.prototype.hasOwnProperty.call(d1, key)) { + const element = d1[key]; + let keyNew = 'K1-' + key; + combineData[keyNew] = element + } + } + + for (const key in d2) { + if (Object.prototype.hasOwnProperty.call(d2, key)) { + const element = d2[key]; + let keyNew = 'K2-' + key; + combineData[keyNew] = element + } + } + + + updateCell(combineData); }) }) function getIndex(ymd){ return DayCount - Math.floor((endStamp - new Date(ymd).getTime())/ (24 * 3600000)) -1 @@ -51,10 +72,12 @@ } function updateCell(data){ if(!data)return + console.log(data) + let daysEle = document.getElementById(dayEleId) let dayCells = daysEle.childNodes let Map = {} @@ -171,23 +194,20 @@ } function updateMultiDays(){ - let day = 6; + let day = 13; while (day -- ) { update1Day(); } if (G_idxOfDay >= 0) { requestAnimationFrame(updateMultiDays) } } - - setTimeout(() => { - requestAnimationFrame(updateMultiDays) - }, 200); + requestAnimationFrame(updateMultiDays) return