|
|
@ -48,7 +48,15 @@ export function StudySite(props) { |
|
|
|
var y = event.pageY; |
|
|
|
|
|
|
|
// Add data to the heatmap |
|
|
|
heatmapInstance.addData({ x: x, y: y, value: 1 }); |
|
|
|
const currentTime = new Date(); |
|
|
|
const websiteLocation = window.location.href; |
|
|
|
heatmapInstance.addData({ |
|
|
|
x: x, |
|
|
|
y: y, |
|
|
|
value: 1, |
|
|
|
timestamp: currentTime, |
|
|
|
url: websiteLocation, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
document.addEventListener("scroll", function (event) { |
|
|
@ -61,7 +69,15 @@ export function StudySite(props) { |
|
|
|
var y = event.pageY; |
|
|
|
|
|
|
|
// Add more value for clicks |
|
|
|
heatmapInstance.addData({ x: x, y: y, value: 5 }); |
|
|
|
const currentTime = new Date(); |
|
|
|
const websiteLocation = window.location.href; |
|
|
|
heatmapInstance.addData({ |
|
|
|
x: x, |
|
|
|
y: y, |
|
|
|
value: 5, |
|
|
|
timestamp: currentTime, |
|
|
|
url: websiteLocation, |
|
|
|
}); |
|
|
|
updateHeatmapSize(); |
|
|
|
}); |
|
|
|
|
|
|
@ -97,10 +113,14 @@ export function StudySite(props) { |
|
|
|
|
|
|
|
for (let i = 0; i < touches.length; i++) { |
|
|
|
ongoingTouches.push(copyTouch(touches[i])); |
|
|
|
const currentTime = new Date(); |
|
|
|
const websiteLocation = window.location.href; |
|
|
|
heatmapInstance.addData({ |
|
|
|
x: touches[i].pageX, |
|
|
|
y: touches[i].pageY, |
|
|
|
value: 5, |
|
|
|
timestamp: currentTime, |
|
|
|
url: websiteLocation, |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
@ -112,10 +132,14 @@ export function StudySite(props) { |
|
|
|
const idx = ongoingTouchIndexById(touches[i].identifier); |
|
|
|
|
|
|
|
if (idx >= 0) { |
|
|
|
const currentTime = new Date(); |
|
|
|
const websiteLocation = window.location.href; |
|
|
|
heatmapInstance.addData({ |
|
|
|
x: touches[i].pageX, |
|
|
|
y: touches[i].pageY, |
|
|
|
value: 5, |
|
|
|
timestamp: currentTime, |
|
|
|
url: websiteLocation, |
|
|
|
}); |
|
|
|
|
|
|
|
ongoingTouches.splice(idx, 1, copyTouch(touches[i])); // swap in the new touch record |
|
|
@ -132,10 +156,14 @@ export function StudySite(props) { |
|
|
|
let idx = ongoingTouchIndexById(touches[i].identifier); |
|
|
|
|
|
|
|
if (idx >= 0) { |
|
|
|
const currentTime = new Date(); |
|
|
|
const websiteLocation = window.location.href; |
|
|
|
heatmapInstance.addData({ |
|
|
|
x: touches[i].pageX, |
|
|
|
y: touches[i].pageY, |
|
|
|
value: 5, |
|
|
|
timestamp: currentTime, |
|
|
|
url: websiteLocation, |
|
|
|
}); |
|
|
|
|
|
|
|
ongoingTouches.splice(idx, 1); // remove it; we're done |
|
|
|