npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@map-gesture-controls/core

v0.1.5

Published

Map-agnostic hand gesture detection and state machine (MediaPipe)

Readme

@map-gesture-controls/core

npm version License: MIT Bundle size TypeScript

Turn any web map into a hands-free experience. This is the map-agnostic gesture detection engine behind map-gesture-controls. It uses MediaPipe hand-tracking WASM to detect hand gestures from a webcam feed, classify them in real time, and expose a clean event-driven API. All processing runs locally in the browser. No video data ever leaves the device.

Building with OpenLayers? Use @map-gesture-controls/ol instead. It wraps this package and adds map integration out of the box.

What it does

  • Detects hands and classifies gestures at 30+ fps using MediaPipe Hand Landmarker
  • Recognizes fist (pan), open palm (zoom), and idle states
  • Manages gesture transitions with dwell timers and grace periods to avoid flickering
  • Provides a configurable webcam overlay with corner/full/hidden display modes
  • Ships fully typed TypeScript declarations

Install

npm install @map-gesture-controls/core

Quick start

import { GestureController } from '@map-gesture-controls/core';
import '@map-gesture-controls/core/style.css';

const controller = new GestureController({
  onGestureFrame(frame) {
    // frame.hands contains detected hands with landmarks and gesture type
    console.log(frame);
  },
});

// Must be called from a user interaction (button click) for webcam permission
await controller.start();

Exports

| Export | Type | Description | | --- | --- | --- | | GestureController | Class | Opens the webcam, runs MediaPipe detection, and emits gesture frames | | GestureStateMachine | Class | Manages gesture state transitions with dwell and grace timers | | WebcamOverlay | Class | Renders a configurable camera preview overlay | | classifyGesture | Function | Classifies a set of hand landmarks into fist, openPalm, or none | | getHandSize | Function | Computes the bounding size of a hand from its landmarks | | getTwoHandDistance | Function | Measures the distance between two detected hands | | DEFAULT_WEBCAM_CONFIG | Constant | Default webcam overlay settings | | DEFAULT_TUNING_CONFIG | Constant | Default tuning parameters |

Full TypeScript types are exported for GestureMode, GestureFrame, DetectedHand, WebcamConfig, TuningConfig, and more.

Gesture recognition

| Gesture | Detection rule | Use case | | --- | --- | --- | | Fist | One hand, 3+ fingers curled | Pan / drag | | Open palm | Two hands, all fingers extended and spread | Zoom in/out | | Idle | Anything else | No action |

Gestures are confirmed after a configurable dwell period (default 80 ms) and held through a grace period (default 150 ms) to prevent flickering when tracking briefly drops.

Use cases

  • Kiosk and exhibit displays where touch screens get dirty or break down
  • Accessibility for users who cannot use a mouse or touchscreen
  • Touchless interfaces in medical, industrial, or public environments
  • Custom map integrations beyond OpenLayers (build your own adapter using this core engine)

Browser support

Requires WebGL, getUserMedia (webcam), and WASM support. Works in Chrome 111+, Edge 111+, Firefox 115+, and Safari 17+.

Documentation

Full docs, live demos, and configuration reference at sanderdesnaijer.github.io/map-gesture-controls

Privacy

MediaPipe WASM and the hand landmarker model are loaded from public CDNs. No video frames are sent to any server. All gesture processing happens locally in the browser.

License

MIT