All Projects → u01ai11 → MouseView.js

u01ai11 / MouseView.js

Licence: MIT license
Attentional mouse tracking. Alternative to online eye tracking. Eye tracking without the eyes!

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to MouseView.js

FDBeye
R tools for eyetracker workflows.
Stars: ✭ 101 (+119.57%)
Mutual labels:  eye-tracking, psychology-experiments
habitus
🏄 State-of-the-art Tracker for emotions, habits and thoughts. | Gamified. | Anonymous and open source. | Healthiest version of you
Stars: ✭ 23 (-50%)
Mutual labels:  psychology, psychology-experiments
eye-contact-cnn
Deep neural network trained to detect eye contact from facial image
Stars: ✭ 31 (-32.61%)
Mutual labels:  psychology, eye-tracking
awesome-psychology
An awesome list of psychology courses, videos and books. Please, contribute!
Stars: ✭ 68 (+47.83%)
Mutual labels:  psychology, psychology-experiments
JATOS
Just Another Tool for Online Studies
Stars: ✭ 60 (+30.43%)
Mutual labels:  psychology, psychology-experiments
remote-calibrator
Measure screen size, track viewing distance and gaze, and more!
Stars: ✭ 12 (-73.91%)
Mutual labels:  psychology, psychophysics
rprime
R package for dealing with Eprime txt files
Stars: ✭ 22 (-52.17%)
Mutual labels:  psychology, psychology-experiments
WikiChron
Data visualization tool for wikis evolution
Stars: ✭ 19 (-58.7%)
Mutual labels:  research-tool
rs datasets
Tool for autodownloading recommendation systems datasets
Stars: ✭ 22 (-52.17%)
Mutual labels:  research-tool
xp
A framework (comand line tool + libraries) for creating flexible compute pipelines
Stars: ✭ 54 (+17.39%)
Mutual labels:  research-tool
NeuralAction
Neural Action is a real-time CNN-based gaze tracking application providing human-machine interface to improve accessibility.
Stars: ✭ 47 (+2.17%)
Mutual labels:  eye-tracking
catlearn
Formal Psychological Models of Categorization and Learning
Stars: ✭ 21 (-54.35%)
Mutual labels:  psychology
jspsych-psychophysics
A jsPsych plugin for psychophysics
Stars: ✭ 37 (-19.57%)
Mutual labels:  psychophysics
convert-eprime
Python functions to convert E-Prime files to csvs. Not currently being developed, but issues and PRs welcome!
Stars: ✭ 36 (-21.74%)
Mutual labels:  psychology-experiments
systole
Systole: A python package for cardiac signal synchrony and analysis
Stars: ✭ 51 (+10.87%)
Mutual labels:  psychology-experiments
copycat
Modern port of Melanie Mitchell's and Douglas Hofstadter's Copycat
Stars: ✭ 84 (+82.61%)
Mutual labels:  psychology
2017-summer-workshop
Exercises, data, and more for our 2017 summer workshop (funded by the Estes Fund and in partnership with Project Jupyter and Berkeley's D-Lab)
Stars: ✭ 33 (-28.26%)
Mutual labels:  psychology
awesome-cogsci
An Awesome List of Cognitive Science Resources
Stars: ✭ 71 (+54.35%)
Mutual labels:  psychology
FusionMouse
Combines Tobii eye tracking with TrackIR head tracking for a fast hands-free mouse replacement, in Rust!
Stars: ✭ 33 (-28.26%)
Mutual labels:  eye-tracking
Eye VR Segmentation
AR/VR Eye Semantic Segmentation - Rank 5th/17 - OpenEDS 2019
Stars: ✭ 45 (-2.17%)
Mutual labels:  eye-tracking

MouseView.js

Attentional mouse tracking. Alternative to online eye tracking.

Documentation and updates are hosted on MouseView.org. Current site status: Netlify Status

The blur library is very much a work in progress, so please don't use the gaussian blur in your own app, without conacting us. You have been warned. The known problems are summarised in the issues on this repo.

Demo available here

Details and validation published in Behavior Research Methods here

If you use this tool please cite:

Anwyl-Irvine, A. L., Armstrong, T., & Dalmaijer, E. S. (2021, September 29). MouseView.js: Reliable and valid attention tracking in web-based experiments using a cursor-directed aperture. Behavior Research Methods, https://doi.org/10.3758/s13428-021-01703-5

Getting Started

Install and setup

MouseView.js is designed to inject a layer over a webpage. Simply include the script on in your websites body tag.

The most up-to-date one is hosted on netlify:

<script src="https://mouseview-docs.netlify.app/MouseView.js" type="module"></script>

or you can just download a version to your site and include it that way

<script src="MouseView.js" type="module"></script>

or you can use it as an ES6 import in JavaScript

import * as mouseview from "/MouseView.js";
mouseview.init()

You can also install it from npm into your app.

npm install --save mouseviewjs

It also (experimentally) supports .mjs imports. But will throw an error if you run this outside a web browser (i.e. in an app or on a server).

import "/MouseView.js";
mouseview.init()

Once it is included it adds the mouseview object to the global namespace, you can set various parameters there, and initiate the overlay

// set some parameters
mouseview.params.apertureSize = 100
mouseview.params.overlayColour = '#17202A' //i.e. hex black
mouseview.params.overlayAlpha = 0.99

// initiate the overlay 
mouseview.init()

Settings

You can set multiple different attributes of the aperture and the overlay

// size of the aperture viewing window. This can be a percentage in a string or an integer in pixels
mouseview.params.apertureSize = '5%'

// the standard deviation (in pixels) of the gaussian filter applied to the edge of the aperture
mouseview.params.apertureGauss = 10 

// The colour of the overlay, this can be a colour word ('black', 'blue') or a hex string
mouseview.params.overlayColour = 'black' //i.e. hex black

// The opacity of the overlay, higher makes the content underneath less visible 
mouseview.params.overlayAlpha = 0.8 // how transparent the overlay will be

// The SD of the Gaussian blur applied to content underneath overlay 
// This is experimental -- not consistent accross browsers and websites, and adds considerable time to the delay
mouseview.params.overlayGaussian = 20 // SD in pixels for the gaussian blur filter (experimental -- not consistent on browsers)

// A callback function can be passed into this argument, that will be run on the completion of the guassian blurring
// As this can take up to a couple of seconds, this is very hand to hide elements or to start events after the blurr is in place!
mouseview.params.overlayGaussianFunc = () => { }

// You can also pass in the number of ms you want to wait before manually recapturing the blur (you may want to do this for dynamic contennt in the page)
// if you pass zero it updates only on page resize or scroll events
mouseview.params.overlayGaussianInterval = 0

Integration

We are making efforts to have this library integrated into existing platforms and tools for online data collection.

jsPsych

The current working example is using jsPsych through the form of plugins. A start and stop plugins.

A demo within a jsPsych experiment is available here

You can also take a look at how this works in the examples directory

Tracking

To start recording mouse movements you use the following functions

mouseview.startTracking() // this starts a record and logs timestamps in console
mouseview.stopTracking() // this stops and logs the data into the console 

The tracking data is stored in mouseviews namespace as an Array of objects with properties X, Y, time and event (for tracking data this is always 'sample'). Representing coordinates of the mouse on the viewport (not the page, relevant if scrolling is involved -- this will be updated in time), and the time in milliseconds from the recording start

mouseview.datalogger.data // this is where the data is stored

We also provide a utility function for logging in arbirary event strings -- you can use this to log things like image loads, or trial initation. It also logs in the current mouse location and the current timestamp.

mouseview.logEvent('Experiment Loaded')

You can also request a target interval for data storage in milliseconds. The default is 16.66ms, which is a frame refresh on a 60Hz monitor. This is dependent on the ability to flip a frame, so sometimes this may not be exact!

Local Storage

Mouseview.js allows you to store and retrieve data on the clients browser. This is helpful for tracking accross multiple pages, or presenting previous data on screen. When you store data it appends that page path to the beginning of the data array. When you retrieve data it will append the path of the page to the end of data array, so you can tell the difference between site pages.

// run this  before user navigates away
mouseview.storeData() // this starts a record and logs timestamps in console

// then on a new page to retrieve
mouseview.getData()

// now the namespace contains all the old data, but with the old path name at the start, and the new one at the end 
console.log(mouseview.datalogger.data)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].