src/heatmap.js
function DetectMouseUser(event) {
        if(isMouseUser) {
            // collection throttle interval.
            setInterval(function() {
                trackData = true;
            }, 50);
            return true;
        }
        let current = movement;
        if(x && y){
            movement = movement + Math.abs(x - event.pageX) + Math.abs(y - event.pageY);
        }
        x = event.pageX;
        y = event.pageY;
        if ((current + 10) > movement) {
            movementOkcount++;
        }
        if(movementOkcount > 5) {
            isMouseUser = true;
        }
        return false;
    }
function DetectMouseUser(event) {
        if(isMouseUser) {
            // collection throttle interval.
            setInterval(function() {
                trackData = true;
            }, 50);
            return true;
        }
        let current = movement;
        if(x && y){
            movement = movement + Math.abs(x - event.pageX) + Math.abs(y - event.pageY);
        }
        x = event.pageX;
        y = event.pageY;
        if ((current + 10) > movement) {
            movementOkcount++;
        }
        if(movementOkcount > 5) {
            isMouseUser = true;
        }
        return false;
    }
function DetectMouseUser ( event ) { if ( isMouseUser ) { // collection throttle interval. setInterval ( function ( ) { trackData = true ; } , 50 ) ; return true ; } let current = movement ; if ( x && y ) { movement = movement + Math . abs ( x - event . pageX ) + Math . abs ( y - event . pageY ) ; } x = event . pageX ; y = event . pageY ; if ( ( current + 10 ) > movement ) { movementOkcount ++ ; } if ( movementOkcount > 5 ) { isMouseUser = true ; } return false ; }
Only use the mousemove data if the user
is actualy using a mouse. This can be hard
to detect. If you have a inproved sollution
please do not hesitate to contact
ceddl-polyfill team or create a pull
request.
Only use the mousemove data if the user is actualy using a mouse . This can be hard to detect . If you have a inproved sollution please do not hesitate to contact ceddl - polyfill team or create a pull request .