From 51c3f50fd913e68b9302acc98a594d37aeb188d1 Mon Sep 17 00:00:00 2001 From: Alexander Bazo Date: Thu, 22 Aug 2019 20:29:11 +0200 Subject: [PATCH] Update Readme --- Readme.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 64eb6c6..96facf0 100644 --- a/Readme.md +++ b/Readme.md @@ -1,10 +1,12 @@ # GazeClient -A javascript library to subscribe to local gaze data streams in the OTH/UR Eyetracking Classroom. +A Javascript library to subscribe to local gaze data streams in the OTH/UR Eye-Tracking Classroom. Packed and compressed library files can be found in `/build`. + +GazeClient connects to a running [GazeServer](https://lab.las3.de/gitlab/eye-tracking-classroom/gaze-server.cs) instance on the local machine and publishes gaze data from the currently tracked user. Websockets are used to connect client and server. ## Usage -**Add the library:** +**Add the library to your application:** ``` @@ -19,12 +21,19 @@ gclient.addEventListener("gazeDataAvailable", function onGazeDataAvailable(event }); ``` -**Connect to a running gaze data server:** +**Connect to a running gaze data server by providing a valid URL:** ``` gclient.connect("ws://localhost:8001/gaze"); ``` +### Events + +| Event | Type | Description | Data | +|---|---|---|---| +| ConnectionOpenedEvent | connectionclosed | Invoked when client successfully connected to server. | - | +| ConnectionClosedEvent | connectionclosed | Invoked when client lost connection to server. | - | +| DataEvent | dataavailable | Invoked when new gaze data from eye-tracker is available. | On-display (x,y) coordinates for both eyes | ## Build @@ -32,4 +41,4 @@ gclient.connect("ws://localhost:8001/gaze"); - node.js -To build a current version of this library run `npm install` and `npm run build`. The client library is packed with [rollup](https://rollupjs.org/guide/en/) and copied to `build/` and `demo/`. \ No newline at end of file +To build a current version of this library run `npm install` and `npm run build`. The client library is packed with [rollup](https://rollupjs.org/guide/en/), compress with [uglify-es](https://github.com/mishoo/UglifyJS2/tree/harmony) and copied to `build/` and `demo/`. \ No newline at end of file -- libgit2 0.26.0