Aumiqx Technologies
AUM
Open menu
Lab 01npm · v0.1.1

What if gestures were just math?

Every gesture library listens to the DOM. This one reads a list of (x, y, t) points and tells you what the hand did: tap, swipe, flick, hold or pan. It runs anywhere those points exist.

size
~6KB
size
dependencies
0
dependencies
gesture types
7
gesture types
GitHub npm
@aumiqx/gesture

01 · Try it

Draw something. Watch it think.

The ink colour is your real speed. The bars are predict() racing while you move. Each gesture you finish stays on the canvas, and you can replay the last one.
ink = speedslowfast

Draw anything here.

swipe · tap · hold · flick · wander · or pick a preset

Confidence race

waiting

  • tap0%
  • long-press0%
  • swipe0%
  • flick0%
  • pan0%

The working

Every number the classifier looks at lands here: distance, duration, velocity, curvature and drift.

02 · The API

Three functions. That's the whole API.

No classes, no lifecycle, no config objects. Points in, classification out.

01 · When the finger lifts

recognize(points)

Classifies a finished gesture and returns its type, direction, confidence, velocity and more.

const g = recognize(points);
// { type: "swipe", direction: "right",
//   confidence: 0.92, velocity: 0.78, ... }

02 · While it's still moving

predict(points)

Classifies a partial trace, so the UI can start responding before the gesture ends. The race above runs on it.

const { likely, alternatives } = predict(points);
// likely: { type: "swipe", confidence: 0.7 }
// alternatives: [{ type: "pan", ... }]

03 · Two taps, one intent

recognizeDoubleTap(a, b)

Checks two tap sequences for timing and distance and returns a double-tap, or null.

const dbl = recognizeDoubleTap(first, second);
// { type: "double-tap", interval: 180,
//   confidence: 0.95, center: { x, y } }

03 · Where it goes

Anywhere there are coordinates. Not just the browser.

01

Canvas and WebGL

Gesture controls with no DOM elements. Read swipes, flicks and holds straight from pointer data in your render loop.

02

Session replays

Classify logged pointer data on a server to find rage taps, hesitant drags and confused navigation.

03

Predictive UI

Call predict() mid-gesture and start the response before the finger lifts.

04

Accessibility

Tune thresholds for shaky or imprecise input, so intent isn't mistaken for tremor.

05

Gesture vocabularies

Chain results into compound moves: swipe then hold for drag mode, double-tap then swipe to select.

06

Any input source

Mouse, touch, pen or trackpad. If it produces (x, y, t), it works on web, mobile and desktop.

04 · Under the hood

Ten small functions. No model, no training data.

Classification is a set of thresholds over these measurements. You can read every one of them in the working panel above.
FunctionWhat it measures
distance(a, b)Distance between two points
straightLineDistance(pts)First point to last
totalPathLength(pts)Every segment added up
duration(pts)Time from first to last point
velocity(pts)Average speed
curvature(pts)How far the path bends from straight
maxDrift(pts)Furthest any point strays from the middle
centroid(pts)Average position
angle(a, b)Direction between two points
predictEnd(pts)Where the motion is heading a few frames on
DOM required
No
Runtime
Browser, Node, Deno, Bun
Framework
Any, or none
Types
TypeScript included
Models or training
None. Thresholds only
Thresholds
All configurable

More from the lab.

All labs