StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
615 B
26 lines
615 B
4 years ago
|
var rootPosition = { left: 0, top: 0 }
|
||
|
|
||
|
module.exports = mouseEventOffset
|
||
|
function mouseEventOffset (ev, target, out) {
|
||
|
target = target || ev.currentTarget || ev.srcElement
|
||
|
if (!Array.isArray(out)) {
|
||
|
out = [ 0, 0 ]
|
||
|
}
|
||
|
var cx = ev.clientX || 0
|
||
|
var cy = ev.clientY || 0
|
||
|
var rect = getBoundingClientOffset(target)
|
||
|
out[0] = cx - rect.left
|
||
|
out[1] = cy - rect.top
|
||
|
return out
|
||
|
}
|
||
|
|
||
|
function getBoundingClientOffset (element) {
|
||
|
if (element === window ||
|
||
|
element === document ||
|
||
|
element === document.body) {
|
||
|
return rootPosition
|
||
|
} else {
|
||
|
return element.getBoundingClientRect()
|
||
|
}
|
||
|
}
|