Skip to content

Repository files navigation

Eye Tracking Analysis Application

A comprehensive eye tracking data analysis platform built with Tauri, SolidJS, and TypeScript. This application analyzes how Cantonese-speaking children understand the word "only" (淨係, 得, 咋) through gaze pattern analysis and Area of Interest (AOI) classification.

Experiment Background

This application studies how Cantonese-speaking children understand the word "only" (淨係, 得, 咋) in different sentence structures:

  • Szinghai (Subject only): "淨係牛仔拎咗枝鉛筆" / "得牛仔拎咗枝鉛筆" (Only cow took a pencil)
  • Vzinghai (Verb only): "牛仔淨係拎咗枝鉛筆" / "牛仔拎咗枝鉛筆咋" (Cow only took a pencil)

Previous research shows Szinghai performs worse than Vzinghai. The experiment uses eye-tracking to validate if children's gaze patterns match their verbal answers.

Test Structure

  • Test names: Tx (correct answer expected), Fx (incorrect answer expected), where x = 1,2...
  • Subjects: 9 animals (貓仔、豬仔、牛仔、狗仔、馬騮、馬仔、雞仔、兔仔、羊仔)
  • Objects: 21 items (水樽、紙巾、火車、香蕉、餅乾、單車、匙羹、鉛筆、口罩、牙膏、蘋果、飛機、較剪、蛋糕、書包、鎖匙、頸巾、雪條、西瓜、枕頭、鑰匙)
  • Measure words: 8 types (個、盒、架、隻、塊、枝、把、條)
  • Verb: Always "拎咗" (took)
  • Only words: 淨係, 得, 咋, or no "only"

AOI (Areas of Interest) Logic example (not all)

  • Correct AOI: Object next to the mentioned object (for subject-only sentences)
  • Incorrect AOI: Other animals that took the pencil (indicates misunderstanding)

Project Overview

This application processes eye tracking data from the above experiment, providing:

  • Real-time gaze data visualization and analysis
  • AOI (Area of Interest) classification and comparison
  • Participant performance metrics and quality control
  • Advanced statistical analysis with bootstrapping and permutation testing
  • Multi-test comparison capabilities

Technology Stack

  • Frontend: SolidJS + TypeScript + Tailwind CSS
  • Backend: Tauri (Rust)
  • Database: SQLite (eye_tracking.db)
  • Charts: Chart.js with custom plugins
  • UI Components: Kobalte (headless UI primitives)

Recommended IDE Setup

Database Structure

The SQLite database (src-tauri/resources/eye_tracking.db) contains:

Core Tables

  • gaze_data (1.8M rows): Timestamped gaze coordinates with AOI classifications
    • Columns: Exact time, Gaze point X/Y, Box, Presented Media name, Timeline name, Participant name, Recording name, Test Name
  • test_catalog (48 rows): Test metadata and AOI definitions
    • Columns: test_name, sentence, group, self_AOIs, correct_AOIs, potentially_correct_AOIs, incorrect_AOIs, correct_NULL, potentially_correct_NULL, incorrect_NULL, image_path
  • participants (36 rows): Participant information with QAC flags
    • Columns: participant (PRIMARY KEY), is_qac (INTEGER NOT NULL)
  • recordings: Session metadata
  • test_group: Test grouping information

Data Relationships

Tests (stimuli) → Participants → Sessions (Timeline/Recording) → Gaze Points → AOI Classifications

Key Features

1. Gaze Analysis (/gaze)

  • Real-time gaze point visualization over stimulus images
  • Time-series charts showing AOI percentages over time
  • Quality filtering based on recording validity percentages
  • Playback controls with progressive revelation

2. Catalog Compare (/compare)

  • Side-by-side comparison of two test sessions
  • Synchronized playback with gaze overlay
  • Statistical analysis of AOI performance differences

3. Advanced Compare (/advanced)

  • Multi-test, multi-participant statistical analysis
  • Bootstrap confidence intervals and cluster permutation testing
  • Flexible AOI set configuration
  • Word window alignment and analysis

4. Data Management (/data-toggle)

  • Disable problematic test/participant/recording combinations
  • Quality control through selective data exclusion
  • Persistent settings via disabled_slices.json

Quality Assurance (QAC)

  • QAC Participants: TLK311–TLK320 marked as is_qac = 0 (non-QAC)
  • Quality Filtering: Recording validity percentages filter out low-quality sessions
  • Data Toggle: Manual exclusion of problematic data combinations

API Endpoints

Key Tauri commands:

  • get_participants(): Returns participant table with QAC flags
  • search_tests(): Searchable test metadata
  • get_gaze_data(): Filtered gaze data by test/participant/session
  • get_box_stats(): AOI percentage statistics
  • get_timeline_recordings(): Available sessions for test/participant pairs

Development Notes

Recent Improvements (2025-01-12)

  • Fixed participant selection issues in Advanced Compare
  • Added race condition protection to async effects
  • Cleaned up debug logging for production
  • Enhanced error handling and user feedback
  • Improved CSS consistency

Code Quality

  • Race condition protection in all async effects
  • Proper cleanup of stale requests
  • Production-ready logging (debug statements commented out)
  • Consistent error handling patterns

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages