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